Index: packages/GeoAPI.1.7.4/GeoAPI.1.7.4.nupkg =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/net20/GeoAPI.dll =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/net20/GeoAPI.xml =================================================================== diff -u --- packages/GeoAPI.1.7.4/lib/net20/GeoAPI.xml (revision 0) +++ packages/GeoAPI.1.7.4/lib/net20/GeoAPI.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,5702 @@ + + + + GeoAPI + + + + + Details of axis. This is used to label axes, and indicate the orientation. + + + + + Initializes a new instance of an AxisInfo. + + Name of axis + Axis orientation + + + + Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string. + + + + + Gets enumerated value for orientation. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Orientation of axis. Some coordinate systems use non-standard orientations. + For example, the first axis in South African grids usually points West, + instead of East. This information is obviously relevant for algorithms + converting South African grid coordinates into Lat/Long. + + + + + Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems. + + + + + Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude. + + + + + Increasing ordinates values go South. This is rarely used. + + + + + Increasing ordinates values go East. This is rarely used. + + + + + Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude. + + + + + Increasing ordinates values go up. This is used for vertical coordinate systems. + + + + + Increasing ordinates values go down. This is used for vertical coordinate systems. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) through + the equation: H=h-N. + + + + + Lowest possible value for horizontal datum types + + + + + Unspecified horizontal datum type. Horizontal datums with this type should never + supply a conversion to WGS84 using Bursa Wolf parameters. + + + + + These datums, such as ED50, NAD27 and NAD83, have been designed to support + horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent. + + + + + A geocentric datum is a "satellite age" modern geodetic datum mainly of global + extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These + datums were designed to support both a horizontal component of position and + a vertical component of position (through ellipsoidal heights). The regional + realizations of ITRF, such as ETRF, are also included in this category. + + + + + Highest possible value for horizontal datum types. + + + + + Lowest possible value for vertical datum types. + + + + + Unspecified vertical datum type. + + + + + A vertical datum for orthometric heights that are measured along the plumb line. + + + + + A vertical datum for ellipsoidal heights that are measured along the normal to + the ellipsoid used in the definition of horizontal datum. + + + + + The vertical datum of altitudes or heights in the atmosphere. These are + approximations of orthometric heights obtained with the help of a barometer or + a barometric altimeter. These values are usually expressed in one of the + following units: meters, feet, millibars (used to measure pressure levels), or + theta value (units used to measure geopotential height). + + + + + A normal height system. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) + through the equation: H=h-N. + + + + + This attribute is used to support the set of datums generated for hydrographic + engineering projects where depth measurements below sea level are needed. It is + often called a hydrographic or a marine datum. Depths are measured in the + direction perpendicular (approximately) to the actual equipotential surfaces of + the earth's gravity field, using such procedures as echo-sounding. + + + + + Highest possible value for vertical datum types. + + + + + Lowest possible value for local datum types. + + + + + Highest possible value for local datum types. + + + + + The IAngularUnit interface defines methods on angular units. + + + + + The IUnit interface abstracts different kinds of units, it has no methods. + + + + + The ISpatialReferenceInfo interface defines the standard + information stored with spatial reference objects. This + interface is reused for many of the spatial reference + objects in the system. + + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Gets or sets the name of the object. + + + + + Gets or sets the authority name for this object, e.g., “POSC”, + is this is a standard object with an authority specific + identity code. Returns “CUSTOM” if this is a custom object. + + + + + Gets or sets the authority specific identification code of the object + + + + + Gets or sets the alias of the object. + + + + + Gets or sets the abbreviation of the object. + + + + + Gets or sets the provider-supplied remarks for the object. + + + + + Returns the Well-known text for this spatial reference object + as defined in the simple features specification. + + + + + Gets an XML representation of this object. + + + + + Gets or sets the number of radians per angular unit. + + + + + An aggregate of two coordinate systems (CRS). One of these is usually a + CRS based on a two dimensional coordinate system such as a geographic or + a projected coordinate system with a horizontal datum. The other is a + vertical CRS which is a one-dimensional coordinate system with a vertical + datum. + + + + + Base interface for all coordinate systems + + + A coordinate system is a mathematical space, where the elements of the space are called + positions. Each position is described by a list of numbers. The length of the list corresponds + to the dimension of the coordinate system. So in a 2D coordinate system each position is + described by a list containing 2 numbers. + + However, in a coordinate system, not all lists of numbers correspond to a position - + some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon + coordinate system, the list (91,91) does not correspond to a position. + + Some coordinate systems also have a mapping from the mathematical space into locations + in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) + corresponds to a location on the surface of the Earth. This mapping from the mathematical + space into real-world locations is called a Datum. + + + + + Gets axis details for dimension within coordinate system. + + Dimension + Axis info + + + + Gets units for dimension within coordinate system. + + + + + Dimension of the coordinate system. + + + + + Gets default envelope of coordinate system. + + + Gets default envelope of coordinate system. Coordinate systems + which are bounded should return the minimum bounding box of their + domain. Unbounded coordinate systems should return a box which is + as large as is likely to be used. For example, a (lon,lat) + geographic coordinate system in degrees should return a box from + (-180,-90) to (180,90), and a geocentric coordinate system could + return a box from (-r,-r,-r) to (+r,+r,+r) where r is the + approximate radius of the Earth. + + + + + Gets first sub-coordinate system. + + + + + Gets second sub-coordinate system. + + + + + Creates spatial reference objects using codes. + + + The codes are maintained by an external authority. A commonly used authority is EPSG, which is also used in the GeoTIFF standard and in SharpMap. + + + + + Returns a projected coordinate system object corresponding to the given code. + + The identification code. + The projected coordinate system object with the given code. + + + + Returns a geographic coordinate system object corresponding to the given code. + + The identification code. + The geographic coordinate system object with the given code. + + + + Returns a horizontal datum object corresponding to the given code. + + The identification code. + The horizontal datum object with the given code. + + + + Returns an ellipsoid object corresponding to the given code. + + The identification code. + The ellipsoid object with the given code. + + + + Returns a prime meridian object corresponding to the given code. + + The identification code. + The prime meridian object with the given code. + + + + Returns a linear unit object corresponding to the given code. + + The identification code. + The linear unit object with the given code. + + + + Returns an angular unit object corresponding to the given code. + + The identification code. + The angular unit object for the given code. + + + + Creates a from a code. + + Authority code + Vertical datum for the given code + + + + Create a vertical coordinate system from a code. + + Authority code + + + + + Creates a 3D coordinate system from a code. + + Authority code + Compound coordinate system for the given code + + + + Creates a horizontal co-ordinate system from a code. + The horizontal coordinate system could be geographic or projected. + + Authority code + Horizontal coordinate system for the given code + + + + Gets the Geoid code from a WKT name. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced + by a quoted string, which is used as a key value. This method converts + the key value string into a code recognized by this authority. + + + + + + + Gets the WKT name of a Geoid. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced by + a quoted string, which is used as a key value. This method gets the OGC WKT + key value from a geoid code. + + + + + + + Returns the authority name for this factory (e.g., "EPSG" or "POSC"). + + + + + Gets a description of the object corresponding to a code. + + + + + Builds up complex objects from simpler objects or values. + + + ICoordinateSystemFactory allows applications to make coordinate systems that + cannot be created by a . This factory is very + flexible, whereas the authority factory is easier to use. + So can be used to make 'standard' coordinate + systems, and can be used to make 'special' + coordinate systems. + For example, the EPSG authority has codes for USA state plane coordinate systems + using the NAD83 datum, but these coordinate systems always use meters. EPSG does not + have codes for NAD83 state plane coordinate systems that use feet units. This factory + lets an application create such a hybrid coordinate system. + + + + + Creates a . + + Name of compound coordinate system. + Head coordinate system + Tail coordinate system + Compound coordinate system + + + + Creates an from radius values. + + + Name of ellipsoid + + + + Ellipsoid + + + + Creates a . + + The units of the axes in the fitted coordinate system will be + inferred from the units of the base coordinate system. If the affine map + performs a rotation, then any mixed axes must have identical units. For + example, a (lat_deg,lon_deg,height_feet) system can be rotated in the + (lat,lon) plane, since both affected axes are in degrees. But you + should not rotate this coordinate system in any other plane. + Name of coordinate system + Base coordinate system + + + Fitted coordinate system + + + + Creates an from an major radius, and inverse flattening. + + + Name of ellipsoid + Semi major-axis + Inverse flattening + Linear unit + Ellipsoid + + + + Creates a coordinate system object from an XML string. + + XML representation for the spatial reference + The resulting spatial reference object + + + + Creates a spatial reference object given its Well-known text representation. + The output object may be either a or + a . + + The Well-known text representation for the spatial reference + The resulting spatial reference object + + + + Creates a , which could be Lat/Lon or Lon/Lat. + + Name of geographical coordinate system + Angular units + Horizontal datum + Prime meridian + First axis + Second axis + Geographic coordinate system + + + + Creates from ellipsoid and Bursa-World parameters. + + + Since this method contains a set of Bursa-Wolf parameters, the created + datum will always have a relationship to WGS84. If you wish to create a + horizontal datum that has no relationship with WGS84, then you can + either specify a horizontalDatumType of , or create it via WKT. + + Name of ellipsoid + Type of datum + Ellipsoid + Wgs84 conversion parameters + Horizontal datum + + + + Creates a local coordinate system. + + + The dimension of the local coordinate system is determined by the size of + the axis array. All the axes will have the same units. If you want to make + a coordinate system with mixed units, then you can make a compound + coordinate system from different local coordinate systems. + + Name of local coordinate system + Local datum + Units + Axis info + Local coordinate system + + + + Creates a . + + Name of datum + Datum type + + + + + Creates a , relative to Greenwich. + + Name of prime meridian + Angular unit + Longitude + Prime meridian + + + + Creates a using a projection object. + + Name of projected coordinate system + Geographic coordinate system + Projection + Linear unit + Primary axis + Secondary axis + Projected coordinate system + + + + Creates a . + + Name of projection + Projection class + Projection parameters + Projection + + + + Creates a from a datum and linear units. + + Name of vertical coordinate system + Vertical datum + Unit + Axis info + Vertical coordinate system + + + + Creates a from an enumerated type value. + + Name of datum + Type of datum + Vertical datum + + + + A set of quantities from which other quantities are calculated. + + + For the OGC abstract model, it can be defined as a set of real points on the earth + that have coordinates. EG. A datum can be thought of as a set of parameters + defining completely the origin and orientation of a coordinate system with respect + to the earth. A textual description and/or a set of parameters describing the + relationship of a coordinate system to some predefined physical locations (such + as center of mass) and physical directions (such as axis of spin). The definition + of the datum may also include the temporal behavior (such as the rate of change of + the orientation of the coordinate axes). + + + + + Gets or sets the type of the datum as an enumerated code. + + + + + The IEllipsoid interface defines the standard information stored with ellipsoid objects. + + + + + Gets or sets the value of the semi-major axis. + + + + + Gets or sets the value of the semi-minor axis. + + + + + Gets or sets the value of the inverse of the flattening constant of the ellipsoid. + + + + + Gets or sets the value of the axis unit. + + + + + Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the + IVF as the defining value, and calculate the polar radius whenever asked. Other + ellipsoids use the polar radius to calculate the IVF whenever asked. This + distinction can be important to avoid floating-point rounding errors. + + + + + A coordinate system which sits inside another coordinate system. The fitted + coordinate system can be rotated and shifted, or use any other math transform + to inject itself into the base coordinate system. + + + + + Gets Well-Known Text of a math transform to the base coordinate system. + The dimension of this fitted coordinate system is determined by the source + dimension of the math transform. The transform should be one-to-one within + this coordinate system's domain, and the base coordinate system dimension + must be at least as big as the dimension of this coordinate system. + + + + + + Gets underlying coordinate system. + + + + + A 3D coordinate system, with its origin at the center of the Earth. + + + + + Returns the HorizontalDatum. The horizontal datum is used to determine where + the centre of the Earth is considered to be. All coordinate points will be + measured from the centre of the Earth, and not the surface. + + + + + Gets the units used along all the axes. + + + + + Returns the PrimeMeridian. + + + + + The IGeodeticSpatialReference interface defines a root interface for all types of geodetic + spatial references, it is a subclass of ICoordinateSystem. + + + + + The IGeographicCoordinateSystem interface is a subclass of IGeodeticSpatialReference and + defines the standard information stored with geographic coordinate system objects. + + + + + A 2D coordinate system suitable for positions on the Earth's surface. + + + + + Returns the HorizontalDatum. + + + + + Gets details on a conversion to WGS84. + + + + + Gets or sets the angular units of the geographic coordinate system. + + + + + Gets or sets the prime meridian of the geographic coordinate system. + + + + + Gets the number of available conversions to WGS84 coordinates. + + + + + The IGeographicTransform interface is implemented on geographic transformation + objects and implements datum transformations between geographic coordinate systems. + + + + + Transforms an array of points from the source geographic coordinate system + to the target geographic coordinate system. + + Points in the source geographic coordinate system + Points in the target geographic coordinate system + + + + Transforms an array of points from the target geographic coordinate system + to the source geographic coordinate system. + + Points in the target geographic coordinate system + Points in the source geographic coordinate system + + + + Gets or sets source geographic coordinate system for the transformation. + + + + + Gets or sets the target geographic coordinate system for the transformation. + + + + + Returns an accessor interface to the parameters for this geographic transformation. + + + + + Procedure used to measure positions on the surface of the Earth. + + + + + Gets or sets the ellipsoid of the datum. + + + + + Gets preferred parameters for a Bursa Wolf transformation into WGS84. The 7 returned values + correspond to (dx,dy,dz) in meters, (ex,ey,ez) in arc-seconds, and scaling in parts-per-million. + + + + + The ILinearUnit interface defines methods on linear units. + + + + + Gets or sets the number of meters per . + + + + + A local coordinate system, with uncertain relationship to the world. + + In general, a local coordinate system cannot be related to other coordinate + systems. However, if two objects supporting this interface have the same dimension, + axes, units and datum then client code is permitted to assume that the two coordinate + systems are identical. This allows several datasets from a common source (e.g. a CAD + system) to be overlaid. In addition, some implementations of the Coordinate + Transformation (CT) package may have a mechanism for correlating local datums. (E.g. + from a database of transformations, which is created and maintained from real-world + measurements.) + + + + + Gets or sets the local datum + + + + + Local datum. If two local datum objects have the same datum type and name, + then they can be considered equal. This means that coordinates can be + transformed between two different local coordinate systems, as long as + they are based on the same local datum. + + + + + The IParameterInfo interface provides an interface through which clients of a + Projected Coordinate System or of a Projection can set the parameters of the + projection. It provides a generic interface for discovering the names and default + values of parameters, and for setting and getting parameter values. Subclasses of + this interface may provide projection specific parameter access methods. + + + + + Returns the default parameters for this projection. + + + + + + Gets the parameter by its name + + + + + + + Gets the number of parameters expected. + + + + + Gets or sets the parameters set for this projection. + + + + + The IPrimeMeridian interface defines the standard information stored with prime + meridian objects. Any prime meridian object must implement this interface as + well as the ISpatialReferenceInfo interface. + + + + + Gets or sets the longitude of the prime meridian (relative to the Greenwich prime meridian). + + + + + Gets or sets the AngularUnits. + + + + + The IProjectedCoordinateSystem interface defines the standard information stored with + projected coordinate system objects. A projected coordinate system is defined using a + geographic coordinate system object and a projection object that defines the + coordinate transformation from the geographic coordinate system to the projected + coordinate systems. The instances of a single ProjectedCoordinateSystem COM class can + be used to model different projected coordinate systems (e.g., UTM Zone 10, Albers) + by associating the ProjectedCoordinateSystem instances with Projection instances + belonging to different Projection COM classes (Transverse Mercator and Albers, + respectively). + + + + + Gets or sets the geographic coordinate system associated with the projected + coordinate system. + + + + + Gets or sets the linear (projected) units of the projected coordinate system. + + + + + Gets or sets the projection for the projected coordinate system. + + + + + The IProjection interface defines the standard information stored with projection + objects. A projection object implements a coordinate transformation from a geographic + coordinate system to a projected coordinate system, given the ellipsoid for the + geographic coordinate system. It is expected that each coordinate transformation of + interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of + coType Projection, supporting the IProjection interface. + + + + + Gets an indexed parameter of the projection. + + Index of parameter + n'th parameter + + + + Gets an named parameter of the projection. + + The parameter name is case insensitive + Name of parameter + parameter or null if not found + + + + Gets number of parameters of the projection. + + + + + Gets the projection classification name (e.g. 'Transverse_Mercator'). + + + + + A one-dimensional coordinate system suitable for vertical measurements. + + + + + Gets the vertical datum, which indicates the measurement method + + + + + Gets the units used along the vertical axis. + + + + + Procedure used to measure vertical distances. + + + + + A named parameter value. + + + + + Creates an instance of a parameter + + Units are always either meters or degrees. + Name of parameter + Value + + + + Parameter name + + + + + Parameter value + + + + + A named projection parameter value. + + + The linear units of parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. (Notice that this is different from , + where the units are always meters and degrees.) + + + + + Initializes an instance of a ProjectionParameter + + Name of parameter + Parameter value + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Parameter name. + + + + + Parameter value. + The linear units of a parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Flags indicating parts of domain covered by a convex hull. + + + These flags can be combined. For example, the value 3 + corresponds to a combination of and , + which means that some parts of the convex hull are inside the + domain, and some parts of the convex hull are outside the domain. + + + + + At least one point in a convex hull is inside the transform's domain. + + + + + At least one point in a convex hull is outside the transform's domain. + + + + + At least one point in a convex hull is not transformed continuously. + + + As an example, consider a "Longitude_Rotation" transform which adjusts + longitude coordinates to take account of a change in Prime Meridian. If + the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not + transformed continuously, since it is on the meridian line which will + be split at +180/-180 degrees. + + + + + Describes a coordinate transformation. This interface only describes a + coordinate transformation, it does not actually perform the transform + operation on points. To transform points you must use a math transform. + + + + + Human readable description of domain in source coordinate system. + + + + + Authority which defined transformation and parameter values. + + + An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is ‘4326’ + + + + + Code used by authority to identify transformation. An empty string is used for no code. + + The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is ‘4326’. + + + + Gets math transform. + + + + + Name of transformation. + + + + + Gets the provider-supplied remarks. + + + + + Source coordinate system. + + + + + Target coordinate system. + + + + + Semantic type of transform. For example, a datum transformation or a coordinate conversion. + + + + + Creates coordinate transformations. + + + + + Creates a transformation between two coordinate systems. + + + This method will examine the coordinate systems in order to construct + a transformation between them. This method may fail if no path between + the coordinate systems is found, using the normal failing behavior of + the DCP (e.g. throwing an exception). + Source coordinate system + Target coordinate system + + + + + Transforms muti-dimensional coordinate points. + + + If a client application wishes to query the source and target coordinate + systems of a transformation, then it should keep hold of the + interface, and use the contained + math transform object whenever it wishes to perform a transform. + + + + + Tests whether this transform does not move any points. + + + + + + Gets the derivative of this transform at a point. If the transform does + not have a well-defined derivative at the point, then this function should + fail in the usual way for the DCP. The derivative is the matrix of the + non-translating portion of the approximate affine map at the point. The + matrix will have dimensions corresponding to the source and target + coordinate systems. If the input dimension is M, and the output dimension + is N, then the matrix will have size [M][N]. The elements of the matrix + {elt[n][m] : n=0..(N-1)} form a vector in the output space which is + parallel to the displacement caused by a small change in the m'th ordinate + in the input space. + + + + + + + Gets transformed convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which generates a convex + hull in the source space. The returned sequence of ordinates represents a convex hull in the + output space. The number of output points will often be different from the number of input + points. Each of the input points should be inside the valid domain (this can be checked by + testing the points' domain flags individually). However, the convex hull of the input points + may go outside the valid domain. The returned convex hull should contain the transformed image + of the intersection of the source convex hull and the source domain. + A convex hull is a shape in a coordinate system, where if two positions A and B are + inside the shape, then all positions in the straight line between A and B are also inside + the shape. So in 3D a cube and a sphere are both convex hulls. Other less obvious examples + of convex hulls are straight lines, and single points. (A single point is a convex hull, + because the positions A and B must both be the same - i.e. the point itself. So the straight + line between A and B has zero length.) + Some examples of shapes that are NOT convex hulls are donuts, and horseshoes. + + + + + + + Gets flags classifying domain points within a convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which + generates a convex hull in the source space. Conceptually, each of the + (usually infinite) points inside the convex hull is then tested against + the source domain. The flags of all these tests are then combined. In + practice, implementations of different transforms will use different + short-cuts to avoid doing an infinite number of tests. + + + + + + + Creates the inverse transform of this object. + + This method may fail if the transform is not one to one. However, all cartographic projections should succeed. + + + + + Transforms a coordinate point. The passed parameter point should not be modified. + + + + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a list of coordinate point ordinal values. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Transforms a list of coordinates. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Reverses the transformation + + + + + Transforms a coordinate sequence. The input coordinate sequence remains unchanged. + + The coordinate sequence to transform. + The transformed coordinate sequence. + + + + Gets the dimension of input points. + + + + + Gets the dimension of output points. + + + + + Gets a Well-Known text representation of this object. + + + + + Gets an XML representation of this object. + + + + + Creates math transforms. + + + CT_MathTransformFactory is a low level factory that is used to create CT_MathTransform objects. Many high level GIS applications will never need to use a CT_MathTransformFactory directly; they can use a CT_CoordinateTransformationFactory instead. However, the CT_MathTransformFactory interface is specified here, since it can be used directly by applications that wish to transform other types of coordinates (e.g. color coordinates, or image pixel coordinates). + The following comments assume that the same vendor implements the math transform factory interfaces and math transform interfaces. + A math transform is an object that actually does the work of applying formulae to coordinate values. The math transform does not know or care how the coordinates relate to positions in the real world. This lack of semantics makes implementing CT_MathTransformFactory significantly easier than it would be otherwise. + For example CT_MathTransformFactory can create affine math transforms. The affine transform applies a matrix to the coordinates without knowing how what it is doing relates to the real world. So if the matrix scales Z values by a factor of 1000, then it could be converting meters into millimeters, or it could be converting kilometers into meters. + Because math transforms have low semantic value (but high mathematical value), programmers who do not have much knowledge of how GIS applications use coordinate systems, or how those coordinate systems relate to the real world can implement CT_MathTransformFactory. + The low semantic content of math transforms also means that they will be useful in applications that have nothing to do with GIS coordinates. For example, a math transform could be used to map color coordinates between different color spaces, such as converting (red, green, blue) colors into (hue, light, saturation) colors. + Since a math transform does not know what its source and target coordinate systems mean, it is not necessary or desirable for a math transform object to keep information on its source and target coordinate systems. + + + + + Creates an affine transform from a matrix. + + If the transform's input dimension is M, and output dimension is N, then the matrix will have size [N+1][M+1]. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will be the j'th ordinate of the moved origin. The [i][N] element of the matrix will be 0 for i less than M, and 1 for i equals M. + + + + + + Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other. + + The dimension of the output space of the first transform must match the dimension of the input space in the second transform. If you wish to concatenate more than two transforms, then you can repeatedly use this method. + + + + + + + Creates a math transform from a Well-Known Text string. + + + + + + + Creates a math transform from XML. + + + + + + + Creates a transform from a classification name and parameters. + + + The client must ensure that all the linear parameters are expressed in meters, and all the angular parameters are expressed in degrees. Also, they must supply "semi_major" and "semi_minor" parameters for cartographic projection transforms. + + + + + + + + Creates a transform which passes through a subset of ordinates to another transform. + + + This allows transforms to operate on a subset of ordinates. For example, if you have (Lat,Lon,Height) coordinates, then you may wish to convert the height values from meters to feet without affecting the (Lat,Lon) values. If you wanted to affect the (Lat,Lon) values and leave the Height values alone, then you would have to swap the ordinates around to (Height,Lat,Lon). You can do this with an affine map. + + + + + + + + Tests whether parameter is angular. Clients must ensure that all angular parameter values are in degrees. + + + + + + + Tests whether parameter is linear. Clients must ensure that all linear parameter values are in meters. + + + + + + + Semantic type of transform used in coordinate transformation. + + + + + Unknown or unspecified type of transform. + + + + + Transform depends only on defined parameters. For example, a cartographic projection. + + + + + Transform depends only on empirically derived parameters. For example a datum transformation. + + + + + Transform depends on both defined and empirical parameters. + + + + + Parameters for a geographic transformation into WGS84. The Bursa Wolf parameters should be applied + to geocentric coordinates, where the X axis points towards the Greenwich Prime Meridian, the Y axis + points East, and the Z axis points North. + + + These parameters can be used to approximate a transformation from the horizontal datum to the + WGS84 datum using a Bursa Wolf transformation. However, it must be remembered that this transformation + is only an approximation. For a given horizontal datum, different Bursa Wolf transformations can be + used to minimize the errors over different regions. + If the DATUM clause contains a TOWGS84 clause, then this should be its “preferred” transformation, + which will often be the transformation which gives a broad approximation over the whole area of interest + (e.g. the area of interest in the containing geographic coordinate system). + Sometimes, only the first three or six parameters are defined. In this case the remaining + parameters must be zero. If only three parameters are defined, then they can still be plugged into the + Bursa Wolf formulas, or you can take a short cut. The Bursa Wolf transformation works on geocentric + coordinates, so you cannot apply it onto geographic coordinates directly. If there are only three + parameters then you can use the Molodenski or abridged Molodenski formulas. + If a datums ToWgs84Parameters parameter values are zero, then the receiving + application can assume that the writing application believed that the datum is approximately equal to + WGS84. + + + + + Initializes an instance of Wgs84ConversionInfo with default parameters (all values = 0) + + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + Area of use for this transformation + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf scaling in parts per million. + + + + + Human readable text describing intended region of transformation. + + + + + Affine Bursa-Wolf matrix transformation + + + Transformation of coordinates from one geographic coordinate system into another + (also colloquially known as a "datum transformation") is usually carried out as an + implicit concatenation of three transformations: + [geographical to geocentric >> geocentric to geocentric >> geocentric to geographic + + The middle part of the concatenated transformation, from geocentric to geocentric, is usually + described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 + parameters, in what is known as the "Bursa-Wolf" formula:
+ + S = 1 + Ppm/1000000 + [ Xt ] [ S -Ez*S +Ey*S Dx ] [ Xs ] + [ Yt ] = [ +Ez*S S -Ex*S Dy ] [ Ys ] + [ Zt ] [ -Ey*S +Ex*S S Dz ] [ Zs ] + [ 1 ] [ 0 0 0 1 ] [ 1 ] +
+ The parameters are commonly referred to defining the transformation "from source coordinate system + to target coordinate system", whereby (XS, YS, ZS) are the coordinates of the point in the source + geocentric coordinate system and (XT, YT, ZT) are the coordinates of the point in the target + geocentric coordinate system. But that does not define the parameters uniquely; neither is the + definition of the parameters implied in the formula, as is often believed. However, the + following definition, which is consistent with the "Position Vector Transformation" convention, + is common E&P survey practice: +
+ (dX, dY, dZ): Translation vector, to be added to the point's position vector in the source + coordinate system in order to transform from source system to target system; also: the coordinates + of the origin of source coordinate system in the target coordinate system + (RX, RY, RZ): Rotations to be applied to the point's vector. The sign convention is such that + a positive rotation about an axis is defined as a clockwise rotation of the position vector when + viewed from the origin of the Cartesian coordinate system in the positive direction of that axis; + e.g. a positive rotation about the Z-axis only from source system to target system will result in a + larger longitude value for the point in the target system. Although rotation angles may be quoted in + any angular unit of measure, the formula as given here requires the angles to be provided in radians. + : The scale correction to be made to the position vector in the source coordinate system in order + to obtain the correct scale in the target coordinate system. M = (1 + dS*10-6), whereby dS is the scale + correction expressed in parts per million. + for an explanation of the Bursa-Wolf transformation +
+ +
+ + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Indicates whether the current object is equal to another object of the same type. + + + + + + + Returns a hash code for the specified object + + A hash code for the specified object + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Gets an XML representation of this object + + + + + Returns true of all 7 parameter values are 0.0 + + + + + + A lightweight class used to store coordinates on the 2-dimensional Cartesian plane. + + It is distinct from , which is a subclass of . + Unlike objects of type (which contain additional + information such as an envelope, a precision model, and spatial reference + system information), a Coordinate only contains ordinate values + and propertied. + + + Coordinates are two-dimensional points, with an additional Z-ordinate. + If an Z-ordinate value is not specified or not defined, + constructed coordinates have a Z-ordinate of NaN + (which is also the value of ). + + + + Apart from the basic accessor functions, NTS supports + only specific operations involving the Z-ordinate. + + + + + Interface for lightweight classes used to store coordinates on the 2-dimensional Cartesian plane. + + + + + Computes the 2-dimensional distance to the coordiante. + + The other coordinate + The 2-dimensional distance to other + + + + Compares equality for x- and y-ordinates + + The other coordinate + true if x- and y-ordinates of coordinate and coordiante are equal. + + + + Compares equality for x-, y- and z-ordinates + + The other coordinate + true if x-, y- and z-ordinates of coordinate and coordiante are equal. + + + + The x-ordinate value + + + + + The y-ordinate value + + + + + The z-ordinate value + + + + + The measure value + + + + + Gets or sets all ordinate values + + + + + Gets or sets the value of this + + The index + + + + The value used to indicate a null or missing ordinate value. + In particular, used for the value of ordinates for dimensions + greater than the defined dimension of a coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + Constructs a Coordinate at (x,y,z). + + X value. + Y value. + Z value. + + + + Constructs a Coordinate at (0,0,NaN). + + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate at (x,y,NaN). + + X value. + Y value. + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + Tests if another coordinate has the same value for X and Y, within a tolerance. + + A . + The tolerance value. + true if the X and Y ordinates are within the given tolerance. + The Z ordinate is ignored. + + + + Returns true if other has the same values for the x and y ordinates. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + + Coordinate with which to do the comparison. + true if other is a Coordinate with the same values for the x and y ordinates. + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if + has the same values for X, Y and Z. + + A with which to do the 3D comparison. + + true if is a + with the same values for X, Y and Z. + + + + + Tests if another coordinate has the same value for Z, within a tolerance. + + A . + The tolerance value. + true if the Z ordinates are within the given tolerance. + + + + Returns a string of the form (x,y,z) . + + string of the form (x,y,z) + + + + Create a new object as copy of this instance. + + + + + + Computes the 2-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations. + The Z-ordinate is ignored. + + + + Computes the 3-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 3-dimensional Euclidean distance between the locations. + + + + Gets a hashcode for this coordinate. + + A hashcode for this coordinate. + + + + Computes a hash code for a double value, using the algorithm from + Joshua Bloch's book Effective Java" + + A hashcode for the double value + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if other has the same values for x, y and z. + + Coordinate with which to do the 3D comparison. + true if other is a Coordinate with the same values for x, y and z. + + + + Computes the 2-dimensional Euclidean distance to another location. + The Z-ordinate is ignored. + + Coordinate with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations + + + + Gets or sets the ordinate value for the given index. + The supported values for the index are + , and . + + The ordinate index + The ordinate value + Thrown if is not in the valid range. + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + X coordinate. + + + + + Y coordinate. + + + + + Z coordinate. + + + + + The measure value + + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + Gets/Sets the ordinate value for a given index + + The index of the ordinate + The ordinate value + + + + Defines a rectangular region of the 2D coordinate plane. + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + Defines a rectangular region of the 2D coordinate plane. + + + + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + + + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + + + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + + Returns if the point specified by and is contained by the envelope. + + The x-ordinate + The y-ordinate + True if the point is contained by the envlope + + + + Returns if the point specified by is contained by the envelope. + + The point + True if the point is contained by the envlope + + + + Returns if the envelope specified by is contained by this envelope. + + The envelope to test + True if the other envelope is contained by this envlope + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Method to initialize the envelope. Calling this function will result in returning true + + + + + Method to initialize the envelope with a . Calling this function will result in an envelope having no extent but a location. + + The point + + + + Method to initialize the envelope. Calling this function will result in an envelope having the same extent as . + + The envelope + + + + Method to initialize the envelope with two s. + + The first point + The second point + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Makes this Envelope a "null" envelope.. + + + + + Gets the area of the envelope + + + + + Gets the width of the envelope + + + + + Gets the height of the envelope + + + + + Gets the maximum x-ordinate of the envelope + + + + + Gets the maximum y-ordinate of the envelope + + + + + Gets the minimum x-ordinate of the envelope + + + + + Gets the mimimum y-ordinate of the envelope + + + + + Gets the or the center of the envelope + + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Interface describing objects that can perform an intersects predicate with objects. + + The type of the component that can intersect + + + + Predicate function to test if intersects with this object. + + The object to test + true if this objects intersects with + + + + Interface describing objects that can expand themselves by objects of type . + + The type of objects that can expand clients + + + + Method to expand this object by + + The object to expand with + + + + Function to expand compute a new object that is this object by expanded by . + + The object to expand with + The expanded object + + + + Test the point q to see whether it intersects the Envelope + defined by p1-p2. + + One extremal point of the envelope. + Another extremal point of the envelope. + Point to test for intersection. + true if q intersects the envelope p1-p2. + + + + Tests whether the envelope defined by p1-p2 + and the envelope defined by q1-q2 + intersect. + + One extremal point of the envelope Point. + Another extremal point of the envelope Point. + One extremal point of the envelope Q. + Another extremal point of the envelope Q. + true if Q intersects Point + + + + Creates a null Envelope. + + + + + Creates an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Creates an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Creates an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Create an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Makes this Envelope a "null" envelope.. + + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Use Intersects instead. + + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + + + + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Creates a new object that is a copy of the current instance. + + A new object that is a copy of this instance. + + + + Creates a deep copy of the current envelope. + + + + + + Calculates the union of the current box and the given point. + + + + + Calculates the union of the current box and the given coordinate. + + + + + Calculates the union of the current box and the given box. + + + + + Moves the envelope to the indicated coordinate. + + The new centre coordinate. + + + + Moves the envelope to the indicated point. + + The new centre point. + + + + Resizes the envelope to the indicated point. + + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre point. + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre coordinate. + The new width. + The new height. + + + + Zoom the box. + Possible values are e.g. 50 (to zoom in a 50%) or -50 (to zoom out a 50%). + + + Negative do Envelope smaller. + Positive do Envelope bigger. + + + perCent = -50 compact the envelope a 50% (make it smaller). + perCent = 200 enlarge envelope by 2. + + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Method to parse an envelope from its value + + The envelope string + The envelope + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Returns the difference between the maximum and minimum x values. + + max x - min x, or 0 if this is a null Envelope. + + + + Returns the difference between the maximum and minimum y values. + + max y - min y, or 0 if this is a null Envelope. + + + + Returns the Envelopes minimum x-value. min x > max x + indicates that this is a null Envelope. + + The minimum x-coordinate. + + + + Returns the Envelopes maximum x-value. min x > max x + indicates that this is a null Envelope. + + The maximum x-coordinate. + + + + Returns the Envelopes minimum y-value. min y > max y + indicates that this is a null Envelope. + + The minimum y-coordinate. + + + + Returns the Envelopes maximum y-value. min y > max y + indicates that this is a null Envelope. + + The maximum y-coordinate. + + + + Gets the area of this envelope. + + The area of the envelope, or 0.0 if envelope is null + + + + Gets the minimum extent of this envelope across both dimensions. + + + + + + Gets the maximum extent of this envelope across both dimensions. + + + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Gets the item that is bounded + + + + + An interface for classes which use the values of the coordinates in a . + Coordinate filters can be used to implement centroid and + envelope computation, and many other functions. + ICoordinateFilter is + an example of the Gang-of-Four Visitor pattern. + + Note: it is not recommended to use these filters to mutate the coordinates. + There is no guarantee that the coordinate is the actual object stored in the geometry. + In particular, modified values may not be preserved if the target Geometry uses a non-default . + If in-place mutation is required, use . + + + + + + + Performs an operation with or on coord. + + Coordinate to which the filter is applied. + + + + The internal representation of a list of coordinates inside a Geometry. + + This allows Geometries to store their + points using something other than the NTS class. + For example, a storage-efficient implementation + might store coordinate sequences as an array of x's + and an array of y's. + Or a custom coordinate class might support extra attributes like M-values. + + + Implementing a custom coordinate storage structure + requires implementing the and + interfaces. + To use the custom CoordinateSequence, create a + new parameterized by the CoordinateSequenceFactory + The can then be used to create new s. + The new Geometries will use the custom CoordinateSequence implementation. + + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + A copy of the i'th coordinate in the sequence + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + At least the first two dimensions must be copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + The value of the X ordinate in the index'th coordinate. + + + + Returns ordinate Y (1) of the specified coordinate. + + + The value of the Y ordinate in the index'th coordinate. + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + + If the sequence does not provide value for the required ordinate, the implementation must not throw an exception, it should return . + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The ordinate value, or if the sequence does not provide values for "/> + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + + If the sequence can't store the ordinate value, the implementation must not throw an exception, it should simply ignore the call. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. Note that + if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + Returns the kind of ordinates this sequence supplys. . + + + + + Returns the number of coordinates in this sequence. + + + + + An object that knows how to build a particular implementation of + ICoordinateSequence from an array of Coordinates. + + + + + + Returns a based on the given array; + whether or not the array is copied is implementation-dependent. + + A coordinates array, which may not be null nor contain null elements + A coordinate sequence. + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + If the requested dimension is larger than the CoordinateSequence implementation + can provide, then a sequence of maximum possible dimension should be created. + An error should not be thrown. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, and can be set. + + A coordinate sequence. + + + + Gets the Ordinate flags that sequences created by this factory can maximal cope with. + + + + + An interface for classes which process the coordinates in a . + A filter can either record information about each coordinate, + or change the value of the coordinate. + Filters can be + used to implement operations such as coordinate transformations, centroid and + envelope computation, and many other functions. + classes support the concept of applying a + CoordinateSequenceFilter to each + s they contain. + + For maximum efficiency, the execution of filters can be short-circuited by using the property. + + + + CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern. + Note: In general, it is preferable to treat Geometrys as immutable. + Mutation should be performed by creating a new Geometry object (see + and for convenient ways to do this). + An exception to this rule is when a new Geometry has been created via . + In this case mutating the Geometry will not cause aliasing issues, + and a filter is a convenient way to implement coordinate transformation. + + + Martin Davis + + + + + + + Performs an operation on a coordinate in a . + + the CoordinateSequence to which the filter is applied + i the index of the coordinate to apply the filter to + + + + Reports whether the application of this filter can be terminated. + + + Once this method returns false, it should + continue to return false on every subsequent call. + + + + + Reports whether the execution of this filter has modified the coordinates of the geometry. + If so, will be executed + after this filter has finished being executed. + + Most filters can simply return a constant value reflecting whether they are able to change the coordinates. + + + + Geometry classes support the concept of applying + an IGeometryComponentFilter filter to the Geometry. + + + The filter is applied to every component of the Geometry + which is itself a Geometry + and which does not itself contain any components. + (For instance, all the LinearRings in Polygons are visited, + but in a MultiPolygon the Polygons themselves are not visited.) + Thus the only classes of Geometry which must be + handled as arguments to + are s, s and s. + An IGeometryComponentFilter filter can either + record information about the Geometry + or change the Geometry in some way. + IGeometryComponentFilter is an example of the Gang-of-Four Visitor pattern. + > + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned. + If geomList contains several Polygons, a + MultiPolygon is returned. + If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned. + If geomList is empty, an empty GeometryCollection + is returned. + + The Geometry to combine. + + A Geometry of the "smallest", "most type-specific" + class that can contain the elements of geomList. + + + + + Returns a clone of g based on a CoordinateSequence created by this + GeometryFactory's CoordinateSequenceFactory. + + + + + Creates a Point using the given Coordinate; a null Coordinate will create + an empty Geometry. + + The coordinate + A Point + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + The coordiante sequence. + A Point + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LinearRing using the given Coordinates; a null or empty array will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence possibly empty, or null. + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + Geometries, each of which may be empty but not null. + + + + Creates a with the same extent as the given envelope. + + + + + Gets the coordinate sequence factory to use when creating geometries. + + + + + Gets the spatial reference id to assign when creating geometries + + + + + Gets the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + GeometryCollection classes support the concept of + applying a IGeometryFilter to the Geometry. + The filter is applied to every element Geometry. + A IGeometryFilter can either record information about the Geometry + or change the Geometry in some way. + IGeometryFilter is an example of the Gang-of-Four Visitor pattern. + + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components which are s. + + Martin Davis + + + + + + Interface for basic implementation of Geometry. + + + + + Gets an array of ordinate values. + + + + + Gets the geometry at the given index + + A method moved in IGeometry + The index of the geometry to get + A geometry that is part of the + + + + Normalizes this geometry + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Gets the Well-Known-Binary representation of this geometry + + A byte array describing this geometry + + + + Gets the Well-Known-Text representation of this geometry + + A text describing this geometry + + + + Computes the convex hull for this geometry + + The convex hull + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS equals predicate. + + A geometry + true if this geometry is topologically equal to + + + + Tests whether two geometries are exactly equal + in their normalized forms. + > + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + + + + + + Returns the minimum distance between this Geometry + and the Geometry g. + + The Geometry from which to compute the distance. + + + + Performs an operation with or on this Geometry's + coordinates. If you are using this method to modify the point, be sure + to call afterwards. + Note that you cannot use this method to modify this Geometry + if its underlying 's Get method + returns a copy of the , rather than the actual + Coordinate stored (if it even stores Coordinates at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + If this method modifies any coordinate values, must be called to update the geometry state. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + Notifies this geometry that its coordinates have been changed by an external + party (using a CoordinateFilter, for example). The Geometry will flush + and/or update any information it has cached (such as its ). + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When is called, this method will be called for + this Geometry and its component geometries. + + + + + The used to create this geometry + + + + + The the used to create this. + + + + + Gets the spatial reference id + + + + + Gets the geometry type + + + + + Gets the OGC geometry type + + + + + Gets the area of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the length of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the number of geometries that make up this geometry + + + A method moved in IGeometry + + + + + Get the number of coordinates, that make up this geometry + + A method moved to IGeometry + + + + Gets the boundary geometry + + + + + Gets the of the boundary + + + + + Gets the centroid of the geometry + + A property moved in IGeometry + + + + Gets a that is guaranteed to be part of the geometry, usually the first. + + + + + Gets an array of s that make up this geometry. + + + + + Gets the of this geometry + + + + + Gets the envelope this would fit into. + + + + + Gets the envelope this would fit into. + + + + + Gets a point that is ensured to lie inside this geometry. + + + + + A ISurface method moved in IGeometry + + + + + Gets or sets the user data associated with this geometry + + + + + Structure for a closed 1-dimensional ℝ-interval + + + + + The lower bound of the interval + + + + + The upper bound of the interval + + + + + Initializes this structure with = = + + The value for min and max + + + + Initializes this structure with and values + + The minimum interval values + The maximum interval values + + + + Method to expand + + + + + + + + + + + + + + + + + + + Function to compute an interval that contains this and + + The interval + An interval + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval ℝ[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval ℝ[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval ℝ[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Function to test if this intersects the interval . + + + + true if this interval intersects + + + + Function to test if this intersects the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval intersects the interval ℝ[, ]. + + + + Creates an empty or uninitialzed Interval + + An empty or uninitialized + + + + Creates an interval with the range ℝ[,] + + The value + An + + + + Creates an interval with the range ℝ[,].
+ If necessary, val1 and val2 are exchanged. +
+ The minimum value + The maximum value + An +
+ + + Creates an interval with the range ℝ[,]. + + The template interval + An + + + + Equality operator for s + + The left-hand-side + The right-hand-side + true if the s are equal. + + + + Inequality operator for s + + The left-hand-side + The right-hand-side + true if the s are not equal. + + + + Gets a value if this interval is empty/undefined + + + + + Gets a value indicating the width of the + + + + + Gets a value indicating the centre of the interval (Min + Width * 0.5) + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that are s. + + Martin Davis + + + + + + + + + + + Floating precision corresponds to the standard + double-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Floating single precision corresponds to the standard + single-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Fixed Precision indicates that coordinates have a fixed number of decimal places. + The number of decimal places is determined by the log10 of the scale factor. + + + + + Interface for classes specifying the precision model of the Coordinates in a IGeometry. + In other words, specifies the grid of allowable points for all IGeometrys. + + + + + Function to compute a precised value of + + The value to precise + The precised value + + + + Method to precise . + + The coordinate to precise + + + + Gets a value indicating the precision model type + + + + + Gets a value indicating if this precision model has floating precision + + + + + Gets a value indicating the maximum precision digits + + + + + Gets a value indicating the scale factor of a fixed precision model + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that ar s. + + Martin Davis + + + + + + Interface for surfaces + + + + + Interface for a curve + + + + + Gets a value indicating the sequence of coordinates that make up curve + + + + + Gets a value indicating the start point of the curve + + + + + Gets a value indicating the end point of the curve + + + + + Gets a value indicating that the curve is closed. + In this case an are equal. + + + + + Gets a value indicating that the curve is a ring. + + + + + Gets a value indicating whether this ring is oriented counter-clockwise. + + + + + Provides constants representing the dimensions of a point, a curve and a surface. + + + Also provides constants representing the dimensions of the empty geometry and + non-empty geometries, and the wildcard constant meaning "any dimension". + These constants are used as the entries in s. + + + + + Dimension value of a point (0). + + + + + Dimension value of a curve (1). + + + + + Dimension value of a surface (2). + + + + + Dimension value of a empty point (-1). + + + + + Dimension value of non-empty geometries (= {Point,Curve,A}). + + + + + Dimension value for any dimension (= {False, True}). + + + + + Class containing static methods for conversions + between dimension values and characters. + + + + + Symbol for the FALSE pattern matrix entry + + + + + Symbol for the TRUE pattern matrix entry + + + + + Symbol for the DONTCARE pattern matrix entry + + + + + Symbol for the P (dimension 0) pattern matrix entry + + + + + Symbol for the L (dimension 1) pattern matrix entry + + + + + Symbol for the A (dimension 2) pattern matrix entry + + + + + Converts the dimension value to a dimension symbol, + for example, True => 'T' + + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + + + + Converts the dimension symbol to a dimension value, + for example, '*' => Dontcare + + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + + + + Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. + + + + DE-9IM matrices (such as "212FF1FF2") + specify the topological relationship between two s. + This class can also represent matrix patterns (such as "T*T******") + which are used for matching instances of DE-9IM matrices. + + + Methods are provided to: + + Set and query the elements of the matrix in a convenient fashion. + Convert to and from the standard string representation (specified in SFS Section 2.1.13.2). + Test to see if a matrix matches a given pattern string. + + + For a description of the DE-9IM and the spatial predicates derived from it, see the + OGC 99-049 OpenGIS Simple Features Specification for SQL. as well as + OGC 06-103r4 OpenGIS + Implementation Standard for Geographic information - + Simple feature access - Part 1: Common architecture + (which provides some further details on certain predicate specifications). + + The entries of the matrix are defined by the constants in the enum. + The indices of the matrix represent the topological locations + that occur in a geometry (Interior, Boundary, Exterior). + These are provided as constants in the enum. + + + + + + Internal representation of this . + + + + + Creates an with null location values. + + + + + Creates an with the given dimension + symbols. + + A string of nine dimension symbols in row major order. + + + + Creates an with the same elements as + other. + + An to copy. + + + + Adds one matrix to another. + Addition is defined by taking the maximum dimension value of each position + in the summand matrices. + + The matrix to add. + + + + Tests if the dimension value matches TRUE + (i.e. has value 0, 1, 2 or TRUE). + + A number that can be stored in the IntersectionMatrix. + Possible values are {, , , , , } + true if the dimension value matches + + + + Tests if the dimension value satisfies the dimension symbol. + + + a number that can be stored in the IntersectionMatrix. + Possible values are {True, False, Dontcare, 0, 1, 2}. + + + A character used in the string + representation of an . + Possible values are T, F, * , 0, 1, 2. + + + true if the dimension symbol encompasses the dimension value. + + + + + Tests if each of the actual dimension symbols in a matrix string satisfies the + corresponding required dimension symbol in a pattern string. + + + Nine dimension symbols to validate. + Possible values are T, F, * , 0, 1, 2. + + + Nine dimension symbols to validate + against. Possible values are T, F, * , 0, 1, 2. + + + true if each of the required dimension + symbols encompass the corresponding actual dimension symbol. + + + + + Changes the value of one of this elements. + + + The row of this , + indicating the interior, boundary or exterior of the first + + + The column of this , + indicating the interior, boundary or exterior of the second + + The new value of the element + + + + Changes the elements of this to the + dimension symbols in dimensionSymbols. + + + Nine dimension symbols to which to set this + s elements. Possible values are {T, F, * , 0, 1, 2} + + + + + Changes the specified element to minimumDimensionValue if the element is less. + + + The row of this , + indicating the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + + The dimension value with which to compare the + element. The order of dimension values from least to greatest is + True, False, Dontcare, 0, 1, 2. + + + + + If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue + if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0. + + + + + + + + For each element in this , changes the + element to the corresponding minimum dimension symbol if the element is + less. + + + Nine dimension symbols with which to + compare the elements of this . The + order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2. + + + + + Changes the elements of this to dimensionValue. + + + The dimension value to which to set this + s elements. Possible values True, False, Dontcare, 0, 1, 2}. + + + + + Returns the value of one of this s + elements. + + + The row of this , indicating + the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + The dimension value at the given matrix position. + + + + Returns true if this is FF*FF****. + + + true if the two 's related by + this are disjoint. + + + + + Returns true if isDisjoint returns false. + + + true if the two 's related by + this intersect. + + + + + Returns true if this is + FT*******, F**T***** or F***T****. + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this touch; Returns false + if both s are points. + + + + + Returns true if this is + T*T****** (for a point and a curve, a point and an area or a line + and an area) 0******** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this cross. For this + function to return true, the s must + be a point and a curve; a point and a surface; two curves; or a curve + and a surface. + + + + + Returns true if this is + T*F**F***. + + true if the first is within the second. + + + + Returns true if this is + T*****FF*. + + true if the first contains the second. + + + + Returns true if this is T*****FF* + or *T****FF* or ***T**FF* or ****T*FF*. + + true if the first covers the second + + + + Returns true if this is T*F**F*** + or *TF**F*** or **FT*F*** or **F*TF*** + + true if the first is covered by the second + + + + Tests whether the argument dimensions are equal and + this IntersectionMatrix matches + the pattern T*F**FFF*. + + Note: This pattern differs from the one stated in + Simple feature access - Part 1: Common architecture. + That document states the pattern as TFFFTFFFT. This would + specify that + two identical POINTs are not equal, which is not desirable behaviour. + The pattern used here has been corrected to compute equality in this situation. + + The dimension of the first . + The dimension of the second . + + true if the two s + related by this are equal; the + s must have the same dimension to be equal. + + + + + Returns true if this is + T*T***T** (for two points or two surfaces) + 1*T***T** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this overlap. For this + function to return true, the s must + be two points, two curves or two surfaces. + + + + + Returns whether the elements of this + satisfies the required dimension symbols. + + + Nine dimension symbols with which to + compare the elements of this . Possible + values are {T, F, * , 0, 1, 2}. + + + true if this + matches the required dimension symbols. + + + + + Transposes this IntersectionMatrix. + + This as a convenience, + + + + Returns a nine-character String representation of this . + + + The nine dimension symbols of this + in row-major order. + + + + + See methods Get(int, int) and Set(int, int, int value) + + + + + The location of a relative to a + + + + + DE-9IM row index of the interior of the first point and column index of + the interior of the second point. Location value for the interior of a + point. + + int value = 0; + + + + DE-9IM row index of the boundary of the first point and column index of + the boundary of the second point. Location value for the boundary of a + point. + + int value = 1; + + + + DE-9IM row index of the exterior of the first point and column index of + the exterior of the second point. Location value for the exterior of a + point. + + int value = 2; + + + + Used for uninitialized location values. + + int value = 1; + + + + Utility class for enumeration + + + + + Converts the location value to a location symbol, for example, EXTERIOR => 'e'. + + + Either 'e', 'b', 'i' or '-'. + + + + Standard ordinate index values. + + + + + X Ordinate = 0. + + + + + Y Ordinate = 1. + + + + + Z Ordinate = 2. + + + + + M Ordinate = 3 + + + + + Ordinate at index 2 + + + + + Ordinate at index 3 + + + + + Ordinate at index 4 + + + + + Ordinate at index 5 + + + + + Ordinate at index 6 + + + + + Ordinate at index 7 + + + + + Ordinate at index 8 + + + + + Ordinate at index 9 + + + + + Ordinate at index 10 + + + + + Ordinate at index 11 + + + + + Ordinate at index 12 + + + + + Ordinate at index 13 + + + + + Ordinate at index 14 + + + + + Ordinate at index 15 + + + + + Ordinate at index 16 + + + + + Ordinate at index 17 + + + + + Ordinate at index 18 + + + + + Ordinate at index 19 + + + + + Ordinate at index 20 + + + + + Ordinate at index 21 + + + + + Ordinate at index 22 + + + + + Ordinate at index 23 + + + + + Ordinate at index 24 + + + + + Ordinate at index 25 + + + + + Ordinate at index 26 + + + + + Ordinate at index 27 + + + + + Ordinate at index 28 + + + + + Ordinate at index 29 + + + + + Ordinate at index 30 + + + + + Ordinate at index 31 + + + + + Ordinate at index 32 + + + + + Flags for Ordinate values + + + + + No ordinates + + + + + Flag for the x-ordinate + + + + + Flag for the y-ordinate + + + + + Flag for both x- and y-ordinate + + + + + Flag for the z-ordinate + + + + + Flag for x-, y- and z-ordinate + + + + + Flag for the m-ordinate + + + + + Flag for x-, y- and m-ordinate + + + + + Flag for x-, y-, z- and m-ordinate + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 10 + + + + + Flag for ordinate at index 11 + + + + + Flag for ordinate at index 12 + + + + + Flag for ordinate at index 13 + + + + + Flag for ordinate at index 14 + + + + + Flag for ordinate at index 15 + + + + + Flag for ordinate at index 16 + + + + + Flag for ordinate at index 17 + + + + + Flag for ordinate at index 18 + + + + + Flag for ordinate at index 19 + + + + + Flag for ordinate at index 20 + + + + + Flag for ordinate at index 21 + + + + + Flag for ordinate at index 22 + + + + + Flag for ordinate at index 23 + + + + + Flag for ordinate at index 24 + + + + + Flag for ordinate at index 25 + + + + + Flag for ordinate at index 26 + + + + + Flag for ordinate at index 27 + + + + + Flag for ordinate at index 28 + + + + + Flag for ordinate at index 29 + + + + + Flag for ordinate at index 30 + + + + + Flag for ordinate at index 31 + + + + + Flag for ordinate at index 32 + + + + + An interface for classes which prepare s + in order to optimize the performance of repeated calls to specific geometric operations. + + + + A given implementation may provide optimized implementations + for only some of the specified methods, and delegate the remaining + methods to the original operations. + + + An implementation may also only optimize certain situations, and delegate others. + See the implementing classes for documentation about which methods and situations + they optimize. + + Subclasses are intended to be thread-safe, to allow IPreparedGeometry + to be used in a multi-threaded context + (which allows extracting maximum benefit from the prepared state). + + + Martin Davis + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + + + + Tests whether the base contains a given geometry. + + + + The ContainsProperly predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry's interior. + The DE-9IM Intersection Matrix for the two geometries matches >[T**FF*FF*] + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + + + An example use case for this predicate is computing the intersections + of a set of geometries with a large polygonal geometry. + Since intersection is a fairly slow operation, it can be more efficient + to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection + known a priori to be simply the original test geometry. + + + The geometry to test + true if this geometry properly contains the given geometry + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + + + + Tests whether the base is disjoint from given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry is disjoint from the given geometry + + + + + Tests whether the base intersects a given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry intersects the given geometry + + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + + + + Gets the original which has been prepared. + + + + + Static class that provides access to a class. + + + + + Gets or sets the instance. + + + + + Interface for classes that provide access to coordinate system and tranformation facilities. + + + + + Returns the coordinate system by identifier + + The initialization for the coordinate system + The coordinate system. + + + + Returns the coordinate system by and . + + The authority for the coordinate system + The code assigned to the coordinate system by . + The coordinate system. + + + + Method to get the identifier, by which this coordinate system can be accessed. + + The authority name + The code assigned by + The identifier or null + + + + Method to create a coordinate tranformation between two spatial reference systems, defined by their identifiers + + This is a convenience function for . + The identifier for the source spatial reference system. + The identifier for the target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Method to create a coordinate tranformation between two spatial reference systems + + The source spatial reference system. + The target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Delegate function to get a coordinate system from a given initialization string + + The initialization string + The type of the coordinate sytem. + + + + An interface for classes that offer access to geometry creating facillities. + + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Creates a new geometry factory, using , and . + + The geometry factory + + + + Creates a geometry fractory using and . + + + The geometry factory + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The spatial reference id. + The geometry factory. + + + + Creates a geometry factory using the given , + and . + + The coordinate sequence factory to use. + The spatial reference id. + The coordinate sequence factory. + The geometry factory. + + + + Reads the configuration from the configuration + + + + + Writes the current configuration to the configuration + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Byte order + + + + + BigEndian + + + + + LittleEndian + + + + + Lightweight class that handles OGC Geometry type declaration + + + + + Initializes this instance + + The value describing the + + + + Inititalizes this instance based on a geometry and an Ordinates flag. + + The geometry. + The ordinates flag. + + + + Inititalizes this instance based on an + + The OGC geometry type + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + Indicator if a SRID is supplied. + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + The ordinates flag. + Indicator if a SRID is supplied. + + + + Gets or sets the base geometry type + + + + + Gets the OGC Well-Known-Binary type code + + + + + Gets the PostGIS Enhanced Well-Known-Binary type code + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets whether SRID value is stored along with the geometry. + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Interface for a coordinate buffer + + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Sets a m-value at the provided + + The index + The value + + + + Sets a z-value at the provided + + The index + The value + + + + Converts the contents of this to a . +
Optionally you may assign a factory to create the sequence +
+ The factory to use in order to create the sequence. + A coordinate sequence +
+ + + Gets the (current) capacity of the buffer + + + + + Gets the (current) number of coordinates in the buffer + + + + + Base interface for geometry reader or writer interfaces. + + + + + Gets or sets whether the SpatialReference ID must be handled. + + + + + Gets and flag that indicate which ordinates can be handled. + + + This flag must always return at least . + + + + + Gets and sets flag that indicate which ordinates shall be handled. + + + No matter which flag you supply, are always processed, + the rest is binary and 'ed with . + + + + + Interface for binary output of instances. + + The type of the output to produce. + + + + Writes a binary representation of a given geometry. + + The geometry + The binary representation of + + + + Writes a binary representation of a given geometry. + + + + + + + Interface for binary output of instances. + + + + + Gets or sets the desired + + + + + Interface for textual output of instances. + + + + + Interface for input/parsing of instances. + + The type of the source to read from. + + + + Reads a geometry representation from a to a Geometry. + + + The source to read the geometry from + For WKT is string, + for WKB is byte[], + + + A Geometry + + + + + Reads a geometry representation from a to a Geometry. + + The stream to read from. + A Geometry + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Interface for textual input of instances. + + + + + Interface for binary input of instances. + + + + + Enumeration of OGC Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + CircularString + + + + + CompoundCurve + + + + + CurvePolygon + + + + + MultiCurve + + + + + MultiSurface + + + + + Curve + + + + + Surface + + + + + PolyhedralSurface + + + + + TIN + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Creates a ParseException with s detail message + + + The inner exception + + + + Buffer style. + + + + + Specifies a round line buffer end cap endCapStyle (Default). + / + + + + Specifies a butt (or flat) line buffer end cap endCapStyle. + + + + + Specifies a square line buffer end cap endCapStyle. + + + + + End cap style constants + + + + + Specifies a round line buffer end cap style. + + + + + Specifies a flat line buffer end cap style. + + + + + Specifies a square line buffer end cap style. + + + + + An interface for classes that control the parameters for the buffer building process + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + + + + Gets/Sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + qs >>= 1joins are round, and qs indicates the number of segments to use to approximate a quarter-circle. + qs = 0joins are beveled + qs < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |qs| + + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , , and . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Gets or sets the factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + Join style constants + + + + + Specifies a round join style. + + + + + Specifies a mitre join style. + + + + + Specifies a bevel join style. + + + + + Static utility functions for dealing with and dimension + + + + + Translates the -flag to a number of dimensions. + + The ordinates flag + The number of dimensions + + + + Translates a dimension value to an -flag. + + The flag for is set first. + The dimension. + The ordinates-flag + + + + Converts an encoded flag to an array of indices. + + The ordinate flags + The maximum oridinate flag that is to be checked + The ordinate indices + + + + Converts an array of values to an flag. + + An array of values + An flag. + +
+
Index: packages/GeoAPI.1.7.4/lib/net35-client/GeoAPI.dll =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/net35-client/GeoAPI.xml =================================================================== diff -u --- packages/GeoAPI.1.7.4/lib/net35-client/GeoAPI.xml (revision 0) +++ packages/GeoAPI.1.7.4/lib/net35-client/GeoAPI.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,5702 @@ + + + + GeoAPI + + + + + Details of axis. This is used to label axes, and indicate the orientation. + + + + + Initializes a new instance of an AxisInfo. + + Name of axis + Axis orientation + + + + Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string. + + + + + Gets enumerated value for orientation. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Orientation of axis. Some coordinate systems use non-standard orientations. + For example, the first axis in South African grids usually points West, + instead of East. This information is obviously relevant for algorithms + converting South African grid coordinates into Lat/Long. + + + + + Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems. + + + + + Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude. + + + + + Increasing ordinates values go South. This is rarely used. + + + + + Increasing ordinates values go East. This is rarely used. + + + + + Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude. + + + + + Increasing ordinates values go up. This is used for vertical coordinate systems. + + + + + Increasing ordinates values go down. This is used for vertical coordinate systems. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) through + the equation: H=h-N. + + + + + Lowest possible value for horizontal datum types + + + + + Unspecified horizontal datum type. Horizontal datums with this type should never + supply a conversion to WGS84 using Bursa Wolf parameters. + + + + + These datums, such as ED50, NAD27 and NAD83, have been designed to support + horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent. + + + + + A geocentric datum is a "satellite age" modern geodetic datum mainly of global + extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These + datums were designed to support both a horizontal component of position and + a vertical component of position (through ellipsoidal heights). The regional + realizations of ITRF, such as ETRF, are also included in this category. + + + + + Highest possible value for horizontal datum types. + + + + + Lowest possible value for vertical datum types. + + + + + Unspecified vertical datum type. + + + + + A vertical datum for orthometric heights that are measured along the plumb line. + + + + + A vertical datum for ellipsoidal heights that are measured along the normal to + the ellipsoid used in the definition of horizontal datum. + + + + + The vertical datum of altitudes or heights in the atmosphere. These are + approximations of orthometric heights obtained with the help of a barometer or + a barometric altimeter. These values are usually expressed in one of the + following units: meters, feet, millibars (used to measure pressure levels), or + theta value (units used to measure geopotential height). + + + + + A normal height system. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) + through the equation: H=h-N. + + + + + This attribute is used to support the set of datums generated for hydrographic + engineering projects where depth measurements below sea level are needed. It is + often called a hydrographic or a marine datum. Depths are measured in the + direction perpendicular (approximately) to the actual equipotential surfaces of + the earth's gravity field, using such procedures as echo-sounding. + + + + + Highest possible value for vertical datum types. + + + + + Lowest possible value for local datum types. + + + + + Highest possible value for local datum types. + + + + + The IAngularUnit interface defines methods on angular units. + + + + + The IUnit interface abstracts different kinds of units, it has no methods. + + + + + The ISpatialReferenceInfo interface defines the standard + information stored with spatial reference objects. This + interface is reused for many of the spatial reference + objects in the system. + + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Gets or sets the name of the object. + + + + + Gets or sets the authority name for this object, e.g., “POSC”, + is this is a standard object with an authority specific + identity code. Returns “CUSTOM” if this is a custom object. + + + + + Gets or sets the authority specific identification code of the object + + + + + Gets or sets the alias of the object. + + + + + Gets or sets the abbreviation of the object. + + + + + Gets or sets the provider-supplied remarks for the object. + + + + + Returns the Well-known text for this spatial reference object + as defined in the simple features specification. + + + + + Gets an XML representation of this object. + + + + + Gets or sets the number of radians per angular unit. + + + + + An aggregate of two coordinate systems (CRS). One of these is usually a + CRS based on a two dimensional coordinate system such as a geographic or + a projected coordinate system with a horizontal datum. The other is a + vertical CRS which is a one-dimensional coordinate system with a vertical + datum. + + + + + Base interface for all coordinate systems + + + A coordinate system is a mathematical space, where the elements of the space are called + positions. Each position is described by a list of numbers. The length of the list corresponds + to the dimension of the coordinate system. So in a 2D coordinate system each position is + described by a list containing 2 numbers. + + However, in a coordinate system, not all lists of numbers correspond to a position - + some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon + coordinate system, the list (91,91) does not correspond to a position. + + Some coordinate systems also have a mapping from the mathematical space into locations + in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) + corresponds to a location on the surface of the Earth. This mapping from the mathematical + space into real-world locations is called a Datum. + + + + + Gets axis details for dimension within coordinate system. + + Dimension + Axis info + + + + Gets units for dimension within coordinate system. + + + + + Dimension of the coordinate system. + + + + + Gets default envelope of coordinate system. + + + Gets default envelope of coordinate system. Coordinate systems + which are bounded should return the minimum bounding box of their + domain. Unbounded coordinate systems should return a box which is + as large as is likely to be used. For example, a (lon,lat) + geographic coordinate system in degrees should return a box from + (-180,-90) to (180,90), and a geocentric coordinate system could + return a box from (-r,-r,-r) to (+r,+r,+r) where r is the + approximate radius of the Earth. + + + + + Gets first sub-coordinate system. + + + + + Gets second sub-coordinate system. + + + + + Creates spatial reference objects using codes. + + + The codes are maintained by an external authority. A commonly used authority is EPSG, which is also used in the GeoTIFF standard and in SharpMap. + + + + + Returns a projected coordinate system object corresponding to the given code. + + The identification code. + The projected coordinate system object with the given code. + + + + Returns a geographic coordinate system object corresponding to the given code. + + The identification code. + The geographic coordinate system object with the given code. + + + + Returns a horizontal datum object corresponding to the given code. + + The identification code. + The horizontal datum object with the given code. + + + + Returns an ellipsoid object corresponding to the given code. + + The identification code. + The ellipsoid object with the given code. + + + + Returns a prime meridian object corresponding to the given code. + + The identification code. + The prime meridian object with the given code. + + + + Returns a linear unit object corresponding to the given code. + + The identification code. + The linear unit object with the given code. + + + + Returns an angular unit object corresponding to the given code. + + The identification code. + The angular unit object for the given code. + + + + Creates a from a code. + + Authority code + Vertical datum for the given code + + + + Create a vertical coordinate system from a code. + + Authority code + + + + + Creates a 3D coordinate system from a code. + + Authority code + Compound coordinate system for the given code + + + + Creates a horizontal co-ordinate system from a code. + The horizontal coordinate system could be geographic or projected. + + Authority code + Horizontal coordinate system for the given code + + + + Gets the Geoid code from a WKT name. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced + by a quoted string, which is used as a key value. This method converts + the key value string into a code recognized by this authority. + + + + + + + Gets the WKT name of a Geoid. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced by + a quoted string, which is used as a key value. This method gets the OGC WKT + key value from a geoid code. + + + + + + + Returns the authority name for this factory (e.g., "EPSG" or "POSC"). + + + + + Gets a description of the object corresponding to a code. + + + + + Builds up complex objects from simpler objects or values. + + + ICoordinateSystemFactory allows applications to make coordinate systems that + cannot be created by a . This factory is very + flexible, whereas the authority factory is easier to use. + So can be used to make 'standard' coordinate + systems, and can be used to make 'special' + coordinate systems. + For example, the EPSG authority has codes for USA state plane coordinate systems + using the NAD83 datum, but these coordinate systems always use meters. EPSG does not + have codes for NAD83 state plane coordinate systems that use feet units. This factory + lets an application create such a hybrid coordinate system. + + + + + Creates a . + + Name of compound coordinate system. + Head coordinate system + Tail coordinate system + Compound coordinate system + + + + Creates an from radius values. + + + Name of ellipsoid + + + + Ellipsoid + + + + Creates a . + + The units of the axes in the fitted coordinate system will be + inferred from the units of the base coordinate system. If the affine map + performs a rotation, then any mixed axes must have identical units. For + example, a (lat_deg,lon_deg,height_feet) system can be rotated in the + (lat,lon) plane, since both affected axes are in degrees. But you + should not rotate this coordinate system in any other plane. + Name of coordinate system + Base coordinate system + + + Fitted coordinate system + + + + Creates an from an major radius, and inverse flattening. + + + Name of ellipsoid + Semi major-axis + Inverse flattening + Linear unit + Ellipsoid + + + + Creates a coordinate system object from an XML string. + + XML representation for the spatial reference + The resulting spatial reference object + + + + Creates a spatial reference object given its Well-known text representation. + The output object may be either a or + a . + + The Well-known text representation for the spatial reference + The resulting spatial reference object + + + + Creates a , which could be Lat/Lon or Lon/Lat. + + Name of geographical coordinate system + Angular units + Horizontal datum + Prime meridian + First axis + Second axis + Geographic coordinate system + + + + Creates from ellipsoid and Bursa-World parameters. + + + Since this method contains a set of Bursa-Wolf parameters, the created + datum will always have a relationship to WGS84. If you wish to create a + horizontal datum that has no relationship with WGS84, then you can + either specify a horizontalDatumType of , or create it via WKT. + + Name of ellipsoid + Type of datum + Ellipsoid + Wgs84 conversion parameters + Horizontal datum + + + + Creates a local coordinate system. + + + The dimension of the local coordinate system is determined by the size of + the axis array. All the axes will have the same units. If you want to make + a coordinate system with mixed units, then you can make a compound + coordinate system from different local coordinate systems. + + Name of local coordinate system + Local datum + Units + Axis info + Local coordinate system + + + + Creates a . + + Name of datum + Datum type + + + + + Creates a , relative to Greenwich. + + Name of prime meridian + Angular unit + Longitude + Prime meridian + + + + Creates a using a projection object. + + Name of projected coordinate system + Geographic coordinate system + Projection + Linear unit + Primary axis + Secondary axis + Projected coordinate system + + + + Creates a . + + Name of projection + Projection class + Projection parameters + Projection + + + + Creates a from a datum and linear units. + + Name of vertical coordinate system + Vertical datum + Unit + Axis info + Vertical coordinate system + + + + Creates a from an enumerated type value. + + Name of datum + Type of datum + Vertical datum + + + + A set of quantities from which other quantities are calculated. + + + For the OGC abstract model, it can be defined as a set of real points on the earth + that have coordinates. EG. A datum can be thought of as a set of parameters + defining completely the origin and orientation of a coordinate system with respect + to the earth. A textual description and/or a set of parameters describing the + relationship of a coordinate system to some predefined physical locations (such + as center of mass) and physical directions (such as axis of spin). The definition + of the datum may also include the temporal behavior (such as the rate of change of + the orientation of the coordinate axes). + + + + + Gets or sets the type of the datum as an enumerated code. + + + + + The IEllipsoid interface defines the standard information stored with ellipsoid objects. + + + + + Gets or sets the value of the semi-major axis. + + + + + Gets or sets the value of the semi-minor axis. + + + + + Gets or sets the value of the inverse of the flattening constant of the ellipsoid. + + + + + Gets or sets the value of the axis unit. + + + + + Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the + IVF as the defining value, and calculate the polar radius whenever asked. Other + ellipsoids use the polar radius to calculate the IVF whenever asked. This + distinction can be important to avoid floating-point rounding errors. + + + + + A coordinate system which sits inside another coordinate system. The fitted + coordinate system can be rotated and shifted, or use any other math transform + to inject itself into the base coordinate system. + + + + + Gets Well-Known Text of a math transform to the base coordinate system. + The dimension of this fitted coordinate system is determined by the source + dimension of the math transform. The transform should be one-to-one within + this coordinate system's domain, and the base coordinate system dimension + must be at least as big as the dimension of this coordinate system. + + + + + + Gets underlying coordinate system. + + + + + A 3D coordinate system, with its origin at the center of the Earth. + + + + + Returns the HorizontalDatum. The horizontal datum is used to determine where + the centre of the Earth is considered to be. All coordinate points will be + measured from the centre of the Earth, and not the surface. + + + + + Gets the units used along all the axes. + + + + + Returns the PrimeMeridian. + + + + + The IGeodeticSpatialReference interface defines a root interface for all types of geodetic + spatial references, it is a subclass of ICoordinateSystem. + + + + + The IGeographicCoordinateSystem interface is a subclass of IGeodeticSpatialReference and + defines the standard information stored with geographic coordinate system objects. + + + + + A 2D coordinate system suitable for positions on the Earth's surface. + + + + + Returns the HorizontalDatum. + + + + + Gets details on a conversion to WGS84. + + + + + Gets or sets the angular units of the geographic coordinate system. + + + + + Gets or sets the prime meridian of the geographic coordinate system. + + + + + Gets the number of available conversions to WGS84 coordinates. + + + + + The IGeographicTransform interface is implemented on geographic transformation + objects and implements datum transformations between geographic coordinate systems. + + + + + Transforms an array of points from the source geographic coordinate system + to the target geographic coordinate system. + + Points in the source geographic coordinate system + Points in the target geographic coordinate system + + + + Transforms an array of points from the target geographic coordinate system + to the source geographic coordinate system. + + Points in the target geographic coordinate system + Points in the source geographic coordinate system + + + + Gets or sets source geographic coordinate system for the transformation. + + + + + Gets or sets the target geographic coordinate system for the transformation. + + + + + Returns an accessor interface to the parameters for this geographic transformation. + + + + + Procedure used to measure positions on the surface of the Earth. + + + + + Gets or sets the ellipsoid of the datum. + + + + + Gets preferred parameters for a Bursa Wolf transformation into WGS84. The 7 returned values + correspond to (dx,dy,dz) in meters, (ex,ey,ez) in arc-seconds, and scaling in parts-per-million. + + + + + The ILinearUnit interface defines methods on linear units. + + + + + Gets or sets the number of meters per . + + + + + A local coordinate system, with uncertain relationship to the world. + + In general, a local coordinate system cannot be related to other coordinate + systems. However, if two objects supporting this interface have the same dimension, + axes, units and datum then client code is permitted to assume that the two coordinate + systems are identical. This allows several datasets from a common source (e.g. a CAD + system) to be overlaid. In addition, some implementations of the Coordinate + Transformation (CT) package may have a mechanism for correlating local datums. (E.g. + from a database of transformations, which is created and maintained from real-world + measurements.) + + + + + Gets or sets the local datum + + + + + Local datum. If two local datum objects have the same datum type and name, + then they can be considered equal. This means that coordinates can be + transformed between two different local coordinate systems, as long as + they are based on the same local datum. + + + + + The IParameterInfo interface provides an interface through which clients of a + Projected Coordinate System or of a Projection can set the parameters of the + projection. It provides a generic interface for discovering the names and default + values of parameters, and for setting and getting parameter values. Subclasses of + this interface may provide projection specific parameter access methods. + + + + + Returns the default parameters for this projection. + + + + + + Gets the parameter by its name + + + + + + + Gets the number of parameters expected. + + + + + Gets or sets the parameters set for this projection. + + + + + The IPrimeMeridian interface defines the standard information stored with prime + meridian objects. Any prime meridian object must implement this interface as + well as the ISpatialReferenceInfo interface. + + + + + Gets or sets the longitude of the prime meridian (relative to the Greenwich prime meridian). + + + + + Gets or sets the AngularUnits. + + + + + The IProjectedCoordinateSystem interface defines the standard information stored with + projected coordinate system objects. A projected coordinate system is defined using a + geographic coordinate system object and a projection object that defines the + coordinate transformation from the geographic coordinate system to the projected + coordinate systems. The instances of a single ProjectedCoordinateSystem COM class can + be used to model different projected coordinate systems (e.g., UTM Zone 10, Albers) + by associating the ProjectedCoordinateSystem instances with Projection instances + belonging to different Projection COM classes (Transverse Mercator and Albers, + respectively). + + + + + Gets or sets the geographic coordinate system associated with the projected + coordinate system. + + + + + Gets or sets the linear (projected) units of the projected coordinate system. + + + + + Gets or sets the projection for the projected coordinate system. + + + + + The IProjection interface defines the standard information stored with projection + objects. A projection object implements a coordinate transformation from a geographic + coordinate system to a projected coordinate system, given the ellipsoid for the + geographic coordinate system. It is expected that each coordinate transformation of + interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of + coType Projection, supporting the IProjection interface. + + + + + Gets an indexed parameter of the projection. + + Index of parameter + n'th parameter + + + + Gets an named parameter of the projection. + + The parameter name is case insensitive + Name of parameter + parameter or null if not found + + + + Gets number of parameters of the projection. + + + + + Gets the projection classification name (e.g. 'Transverse_Mercator'). + + + + + A one-dimensional coordinate system suitable for vertical measurements. + + + + + Gets the vertical datum, which indicates the measurement method + + + + + Gets the units used along the vertical axis. + + + + + Procedure used to measure vertical distances. + + + + + A named parameter value. + + + + + Creates an instance of a parameter + + Units are always either meters or degrees. + Name of parameter + Value + + + + Parameter name + + + + + Parameter value + + + + + A named projection parameter value. + + + The linear units of parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. (Notice that this is different from , + where the units are always meters and degrees.) + + + + + Initializes an instance of a ProjectionParameter + + Name of parameter + Parameter value + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Parameter name. + + + + + Parameter value. + The linear units of a parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Flags indicating parts of domain covered by a convex hull. + + + These flags can be combined. For example, the value 3 + corresponds to a combination of and , + which means that some parts of the convex hull are inside the + domain, and some parts of the convex hull are outside the domain. + + + + + At least one point in a convex hull is inside the transform's domain. + + + + + At least one point in a convex hull is outside the transform's domain. + + + + + At least one point in a convex hull is not transformed continuously. + + + As an example, consider a "Longitude_Rotation" transform which adjusts + longitude coordinates to take account of a change in Prime Meridian. If + the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not + transformed continuously, since it is on the meridian line which will + be split at +180/-180 degrees. + + + + + Describes a coordinate transformation. This interface only describes a + coordinate transformation, it does not actually perform the transform + operation on points. To transform points you must use a math transform. + + + + + Human readable description of domain in source coordinate system. + + + + + Authority which defined transformation and parameter values. + + + An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is ‘4326’ + + + + + Code used by authority to identify transformation. An empty string is used for no code. + + The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is ‘4326’. + + + + Gets math transform. + + + + + Name of transformation. + + + + + Gets the provider-supplied remarks. + + + + + Source coordinate system. + + + + + Target coordinate system. + + + + + Semantic type of transform. For example, a datum transformation or a coordinate conversion. + + + + + Creates coordinate transformations. + + + + + Creates a transformation between two coordinate systems. + + + This method will examine the coordinate systems in order to construct + a transformation between them. This method may fail if no path between + the coordinate systems is found, using the normal failing behavior of + the DCP (e.g. throwing an exception). + Source coordinate system + Target coordinate system + + + + + Transforms muti-dimensional coordinate points. + + + If a client application wishes to query the source and target coordinate + systems of a transformation, then it should keep hold of the + interface, and use the contained + math transform object whenever it wishes to perform a transform. + + + + + Tests whether this transform does not move any points. + + + + + + Gets the derivative of this transform at a point. If the transform does + not have a well-defined derivative at the point, then this function should + fail in the usual way for the DCP. The derivative is the matrix of the + non-translating portion of the approximate affine map at the point. The + matrix will have dimensions corresponding to the source and target + coordinate systems. If the input dimension is M, and the output dimension + is N, then the matrix will have size [M][N]. The elements of the matrix + {elt[n][m] : n=0..(N-1)} form a vector in the output space which is + parallel to the displacement caused by a small change in the m'th ordinate + in the input space. + + + + + + + Gets transformed convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which generates a convex + hull in the source space. The returned sequence of ordinates represents a convex hull in the + output space. The number of output points will often be different from the number of input + points. Each of the input points should be inside the valid domain (this can be checked by + testing the points' domain flags individually). However, the convex hull of the input points + may go outside the valid domain. The returned convex hull should contain the transformed image + of the intersection of the source convex hull and the source domain. + A convex hull is a shape in a coordinate system, where if two positions A and B are + inside the shape, then all positions in the straight line between A and B are also inside + the shape. So in 3D a cube and a sphere are both convex hulls. Other less obvious examples + of convex hulls are straight lines, and single points. (A single point is a convex hull, + because the positions A and B must both be the same - i.e. the point itself. So the straight + line between A and B has zero length.) + Some examples of shapes that are NOT convex hulls are donuts, and horseshoes. + + + + + + + Gets flags classifying domain points within a convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which + generates a convex hull in the source space. Conceptually, each of the + (usually infinite) points inside the convex hull is then tested against + the source domain. The flags of all these tests are then combined. In + practice, implementations of different transforms will use different + short-cuts to avoid doing an infinite number of tests. + + + + + + + Creates the inverse transform of this object. + + This method may fail if the transform is not one to one. However, all cartographic projections should succeed. + + + + + Transforms a coordinate point. The passed parameter point should not be modified. + + + + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a list of coordinate point ordinal values. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Transforms a list of coordinates. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Reverses the transformation + + + + + Transforms a coordinate sequence. The input coordinate sequence remains unchanged. + + The coordinate sequence to transform. + The transformed coordinate sequence. + + + + Gets the dimension of input points. + + + + + Gets the dimension of output points. + + + + + Gets a Well-Known text representation of this object. + + + + + Gets an XML representation of this object. + + + + + Creates math transforms. + + + CT_MathTransformFactory is a low level factory that is used to create CT_MathTransform objects. Many high level GIS applications will never need to use a CT_MathTransformFactory directly; they can use a CT_CoordinateTransformationFactory instead. However, the CT_MathTransformFactory interface is specified here, since it can be used directly by applications that wish to transform other types of coordinates (e.g. color coordinates, or image pixel coordinates). + The following comments assume that the same vendor implements the math transform factory interfaces and math transform interfaces. + A math transform is an object that actually does the work of applying formulae to coordinate values. The math transform does not know or care how the coordinates relate to positions in the real world. This lack of semantics makes implementing CT_MathTransformFactory significantly easier than it would be otherwise. + For example CT_MathTransformFactory can create affine math transforms. The affine transform applies a matrix to the coordinates without knowing how what it is doing relates to the real world. So if the matrix scales Z values by a factor of 1000, then it could be converting meters into millimeters, or it could be converting kilometers into meters. + Because math transforms have low semantic value (but high mathematical value), programmers who do not have much knowledge of how GIS applications use coordinate systems, or how those coordinate systems relate to the real world can implement CT_MathTransformFactory. + The low semantic content of math transforms also means that they will be useful in applications that have nothing to do with GIS coordinates. For example, a math transform could be used to map color coordinates between different color spaces, such as converting (red, green, blue) colors into (hue, light, saturation) colors. + Since a math transform does not know what its source and target coordinate systems mean, it is not necessary or desirable for a math transform object to keep information on its source and target coordinate systems. + + + + + Creates an affine transform from a matrix. + + If the transform's input dimension is M, and output dimension is N, then the matrix will have size [N+1][M+1]. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will be the j'th ordinate of the moved origin. The [i][N] element of the matrix will be 0 for i less than M, and 1 for i equals M. + + + + + + Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other. + + The dimension of the output space of the first transform must match the dimension of the input space in the second transform. If you wish to concatenate more than two transforms, then you can repeatedly use this method. + + + + + + + Creates a math transform from a Well-Known Text string. + + + + + + + Creates a math transform from XML. + + + + + + + Creates a transform from a classification name and parameters. + + + The client must ensure that all the linear parameters are expressed in meters, and all the angular parameters are expressed in degrees. Also, they must supply "semi_major" and "semi_minor" parameters for cartographic projection transforms. + + + + + + + + Creates a transform which passes through a subset of ordinates to another transform. + + + This allows transforms to operate on a subset of ordinates. For example, if you have (Lat,Lon,Height) coordinates, then you may wish to convert the height values from meters to feet without affecting the (Lat,Lon) values. If you wanted to affect the (Lat,Lon) values and leave the Height values alone, then you would have to swap the ordinates around to (Height,Lat,Lon). You can do this with an affine map. + + + + + + + + Tests whether parameter is angular. Clients must ensure that all angular parameter values are in degrees. + + + + + + + Tests whether parameter is linear. Clients must ensure that all linear parameter values are in meters. + + + + + + + Semantic type of transform used in coordinate transformation. + + + + + Unknown or unspecified type of transform. + + + + + Transform depends only on defined parameters. For example, a cartographic projection. + + + + + Transform depends only on empirically derived parameters. For example a datum transformation. + + + + + Transform depends on both defined and empirical parameters. + + + + + Parameters for a geographic transformation into WGS84. The Bursa Wolf parameters should be applied + to geocentric coordinates, where the X axis points towards the Greenwich Prime Meridian, the Y axis + points East, and the Z axis points North. + + + These parameters can be used to approximate a transformation from the horizontal datum to the + WGS84 datum using a Bursa Wolf transformation. However, it must be remembered that this transformation + is only an approximation. For a given horizontal datum, different Bursa Wolf transformations can be + used to minimize the errors over different regions. + If the DATUM clause contains a TOWGS84 clause, then this should be its “preferred” transformation, + which will often be the transformation which gives a broad approximation over the whole area of interest + (e.g. the area of interest in the containing geographic coordinate system). + Sometimes, only the first three or six parameters are defined. In this case the remaining + parameters must be zero. If only three parameters are defined, then they can still be plugged into the + Bursa Wolf formulas, or you can take a short cut. The Bursa Wolf transformation works on geocentric + coordinates, so you cannot apply it onto geographic coordinates directly. If there are only three + parameters then you can use the Molodenski or abridged Molodenski formulas. + If a datums ToWgs84Parameters parameter values are zero, then the receiving + application can assume that the writing application believed that the datum is approximately equal to + WGS84. + + + + + Initializes an instance of Wgs84ConversionInfo with default parameters (all values = 0) + + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + Area of use for this transformation + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf scaling in parts per million. + + + + + Human readable text describing intended region of transformation. + + + + + Affine Bursa-Wolf matrix transformation + + + Transformation of coordinates from one geographic coordinate system into another + (also colloquially known as a "datum transformation") is usually carried out as an + implicit concatenation of three transformations: + [geographical to geocentric >> geocentric to geocentric >> geocentric to geographic + + The middle part of the concatenated transformation, from geocentric to geocentric, is usually + described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 + parameters, in what is known as the "Bursa-Wolf" formula:
+ + S = 1 + Ppm/1000000 + [ Xt ] [ S -Ez*S +Ey*S Dx ] [ Xs ] + [ Yt ] = [ +Ez*S S -Ex*S Dy ] [ Ys ] + [ Zt ] [ -Ey*S +Ex*S S Dz ] [ Zs ] + [ 1 ] [ 0 0 0 1 ] [ 1 ] +
+ The parameters are commonly referred to defining the transformation "from source coordinate system + to target coordinate system", whereby (XS, YS, ZS) are the coordinates of the point in the source + geocentric coordinate system and (XT, YT, ZT) are the coordinates of the point in the target + geocentric coordinate system. But that does not define the parameters uniquely; neither is the + definition of the parameters implied in the formula, as is often believed. However, the + following definition, which is consistent with the "Position Vector Transformation" convention, + is common E&P survey practice: +
+ (dX, dY, dZ): Translation vector, to be added to the point's position vector in the source + coordinate system in order to transform from source system to target system; also: the coordinates + of the origin of source coordinate system in the target coordinate system + (RX, RY, RZ): Rotations to be applied to the point's vector. The sign convention is such that + a positive rotation about an axis is defined as a clockwise rotation of the position vector when + viewed from the origin of the Cartesian coordinate system in the positive direction of that axis; + e.g. a positive rotation about the Z-axis only from source system to target system will result in a + larger longitude value for the point in the target system. Although rotation angles may be quoted in + any angular unit of measure, the formula as given here requires the angles to be provided in radians. + : The scale correction to be made to the position vector in the source coordinate system in order + to obtain the correct scale in the target coordinate system. M = (1 + dS*10-6), whereby dS is the scale + correction expressed in parts per million. + for an explanation of the Bursa-Wolf transformation +
+ +
+ + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Indicates whether the current object is equal to another object of the same type. + + + + + + + Returns a hash code for the specified object + + A hash code for the specified object + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Gets an XML representation of this object + + + + + Returns true of all 7 parameter values are 0.0 + + + + + + A lightweight class used to store coordinates on the 2-dimensional Cartesian plane. + + It is distinct from , which is a subclass of . + Unlike objects of type (which contain additional + information such as an envelope, a precision model, and spatial reference + system information), a Coordinate only contains ordinate values + and propertied. + + + Coordinates are two-dimensional points, with an additional Z-ordinate. + If an Z-ordinate value is not specified or not defined, + constructed coordinates have a Z-ordinate of NaN + (which is also the value of ). + + + + Apart from the basic accessor functions, NTS supports + only specific operations involving the Z-ordinate. + + + + + Interface for lightweight classes used to store coordinates on the 2-dimensional Cartesian plane. + + + + + Computes the 2-dimensional distance to the coordiante. + + The other coordinate + The 2-dimensional distance to other + + + + Compares equality for x- and y-ordinates + + The other coordinate + true if x- and y-ordinates of coordinate and coordiante are equal. + + + + Compares equality for x-, y- and z-ordinates + + The other coordinate + true if x-, y- and z-ordinates of coordinate and coordiante are equal. + + + + The x-ordinate value + + + + + The y-ordinate value + + + + + The z-ordinate value + + + + + The measure value + + + + + Gets or sets all ordinate values + + + + + Gets or sets the value of this + + The index + + + + The value used to indicate a null or missing ordinate value. + In particular, used for the value of ordinates for dimensions + greater than the defined dimension of a coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + Constructs a Coordinate at (x,y,z). + + X value. + Y value. + Z value. + + + + Constructs a Coordinate at (0,0,NaN). + + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate at (x,y,NaN). + + X value. + Y value. + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + Tests if another coordinate has the same value for X and Y, within a tolerance. + + A . + The tolerance value. + true if the X and Y ordinates are within the given tolerance. + The Z ordinate is ignored. + + + + Returns true if other has the same values for the x and y ordinates. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + + Coordinate with which to do the comparison. + true if other is a Coordinate with the same values for the x and y ordinates. + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if + has the same values for X, Y and Z. + + A with which to do the 3D comparison. + + true if is a + with the same values for X, Y and Z. + + + + + Tests if another coordinate has the same value for Z, within a tolerance. + + A . + The tolerance value. + true if the Z ordinates are within the given tolerance. + + + + Returns a string of the form (x,y,z) . + + string of the form (x,y,z) + + + + Create a new object as copy of this instance. + + + + + + Computes the 2-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations. + The Z-ordinate is ignored. + + + + Computes the 3-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 3-dimensional Euclidean distance between the locations. + + + + Gets a hashcode for this coordinate. + + A hashcode for this coordinate. + + + + Computes a hash code for a double value, using the algorithm from + Joshua Bloch's book Effective Java" + + A hashcode for the double value + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if other has the same values for x, y and z. + + Coordinate with which to do the 3D comparison. + true if other is a Coordinate with the same values for x, y and z. + + + + Computes the 2-dimensional Euclidean distance to another location. + The Z-ordinate is ignored. + + Coordinate with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations + + + + Gets or sets the ordinate value for the given index. + The supported values for the index are + , and . + + The ordinate index + The ordinate value + Thrown if is not in the valid range. + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + X coordinate. + + + + + Y coordinate. + + + + + Z coordinate. + + + + + The measure value + + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + Gets/Sets the ordinate value for a given index + + The index of the ordinate + The ordinate value + + + + Defines a rectangular region of the 2D coordinate plane. + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + Defines a rectangular region of the 2D coordinate plane. + + + + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + + + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + + + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + + Returns if the point specified by and is contained by the envelope. + + The x-ordinate + The y-ordinate + True if the point is contained by the envlope + + + + Returns if the point specified by is contained by the envelope. + + The point + True if the point is contained by the envlope + + + + Returns if the envelope specified by is contained by this envelope. + + The envelope to test + True if the other envelope is contained by this envlope + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Method to initialize the envelope. Calling this function will result in returning true + + + + + Method to initialize the envelope with a . Calling this function will result in an envelope having no extent but a location. + + The point + + + + Method to initialize the envelope. Calling this function will result in an envelope having the same extent as . + + The envelope + + + + Method to initialize the envelope with two s. + + The first point + The second point + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Makes this Envelope a "null" envelope.. + + + + + Gets the area of the envelope + + + + + Gets the width of the envelope + + + + + Gets the height of the envelope + + + + + Gets the maximum x-ordinate of the envelope + + + + + Gets the maximum y-ordinate of the envelope + + + + + Gets the minimum x-ordinate of the envelope + + + + + Gets the mimimum y-ordinate of the envelope + + + + + Gets the or the center of the envelope + + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Interface describing objects that can perform an intersects predicate with objects. + + The type of the component that can intersect + + + + Predicate function to test if intersects with this object. + + The object to test + true if this objects intersects with + + + + Interface describing objects that can expand themselves by objects of type . + + The type of objects that can expand clients + + + + Method to expand this object by + + The object to expand with + + + + Function to expand compute a new object that is this object by expanded by . + + The object to expand with + The expanded object + + + + Test the point q to see whether it intersects the Envelope + defined by p1-p2. + + One extremal point of the envelope. + Another extremal point of the envelope. + Point to test for intersection. + true if q intersects the envelope p1-p2. + + + + Tests whether the envelope defined by p1-p2 + and the envelope defined by q1-q2 + intersect. + + One extremal point of the envelope Point. + Another extremal point of the envelope Point. + One extremal point of the envelope Q. + Another extremal point of the envelope Q. + true if Q intersects Point + + + + Creates a null Envelope. + + + + + Creates an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Creates an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Creates an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Create an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Makes this Envelope a "null" envelope.. + + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Use Intersects instead. + + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + + + + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Creates a new object that is a copy of the current instance. + + A new object that is a copy of this instance. + + + + Creates a deep copy of the current envelope. + + + + + + Calculates the union of the current box and the given point. + + + + + Calculates the union of the current box and the given coordinate. + + + + + Calculates the union of the current box and the given box. + + + + + Moves the envelope to the indicated coordinate. + + The new centre coordinate. + + + + Moves the envelope to the indicated point. + + The new centre point. + + + + Resizes the envelope to the indicated point. + + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre point. + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre coordinate. + The new width. + The new height. + + + + Zoom the box. + Possible values are e.g. 50 (to zoom in a 50%) or -50 (to zoom out a 50%). + + + Negative do Envelope smaller. + Positive do Envelope bigger. + + + perCent = -50 compact the envelope a 50% (make it smaller). + perCent = 200 enlarge envelope by 2. + + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Method to parse an envelope from its value + + The envelope string + The envelope + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Returns the difference between the maximum and minimum x values. + + max x - min x, or 0 if this is a null Envelope. + + + + Returns the difference between the maximum and minimum y values. + + max y - min y, or 0 if this is a null Envelope. + + + + Returns the Envelopes minimum x-value. min x > max x + indicates that this is a null Envelope. + + The minimum x-coordinate. + + + + Returns the Envelopes maximum x-value. min x > max x + indicates that this is a null Envelope. + + The maximum x-coordinate. + + + + Returns the Envelopes minimum y-value. min y > max y + indicates that this is a null Envelope. + + The minimum y-coordinate. + + + + Returns the Envelopes maximum y-value. min y > max y + indicates that this is a null Envelope. + + The maximum y-coordinate. + + + + Gets the area of this envelope. + + The area of the envelope, or 0.0 if envelope is null + + + + Gets the minimum extent of this envelope across both dimensions. + + + + + + Gets the maximum extent of this envelope across both dimensions. + + + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Gets the item that is bounded + + + + + An interface for classes which use the values of the coordinates in a . + Coordinate filters can be used to implement centroid and + envelope computation, and many other functions. + ICoordinateFilter is + an example of the Gang-of-Four Visitor pattern. + + Note: it is not recommended to use these filters to mutate the coordinates. + There is no guarantee that the coordinate is the actual object stored in the geometry. + In particular, modified values may not be preserved if the target Geometry uses a non-default . + If in-place mutation is required, use . + + + + + + + Performs an operation with or on coord. + + Coordinate to which the filter is applied. + + + + The internal representation of a list of coordinates inside a Geometry. + + This allows Geometries to store their + points using something other than the NTS class. + For example, a storage-efficient implementation + might store coordinate sequences as an array of x's + and an array of y's. + Or a custom coordinate class might support extra attributes like M-values. + + + Implementing a custom coordinate storage structure + requires implementing the and + interfaces. + To use the custom CoordinateSequence, create a + new parameterized by the CoordinateSequenceFactory + The can then be used to create new s. + The new Geometries will use the custom CoordinateSequence implementation. + + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + A copy of the i'th coordinate in the sequence + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + At least the first two dimensions must be copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + The value of the X ordinate in the index'th coordinate. + + + + Returns ordinate Y (1) of the specified coordinate. + + + The value of the Y ordinate in the index'th coordinate. + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + + If the sequence does not provide value for the required ordinate, the implementation must not throw an exception, it should return . + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The ordinate value, or if the sequence does not provide values for "/> + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + + If the sequence can't store the ordinate value, the implementation must not throw an exception, it should simply ignore the call. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. Note that + if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + Returns the kind of ordinates this sequence supplys. . + + + + + Returns the number of coordinates in this sequence. + + + + + An object that knows how to build a particular implementation of + ICoordinateSequence from an array of Coordinates. + + + + + + Returns a based on the given array; + whether or not the array is copied is implementation-dependent. + + A coordinates array, which may not be null nor contain null elements + A coordinate sequence. + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + If the requested dimension is larger than the CoordinateSequence implementation + can provide, then a sequence of maximum possible dimension should be created. + An error should not be thrown. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, and can be set. + + A coordinate sequence. + + + + Gets the Ordinate flags that sequences created by this factory can maximal cope with. + + + + + An interface for classes which process the coordinates in a . + A filter can either record information about each coordinate, + or change the value of the coordinate. + Filters can be + used to implement operations such as coordinate transformations, centroid and + envelope computation, and many other functions. + classes support the concept of applying a + CoordinateSequenceFilter to each + s they contain. + + For maximum efficiency, the execution of filters can be short-circuited by using the property. + + + + CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern. + Note: In general, it is preferable to treat Geometrys as immutable. + Mutation should be performed by creating a new Geometry object (see + and for convenient ways to do this). + An exception to this rule is when a new Geometry has been created via . + In this case mutating the Geometry will not cause aliasing issues, + and a filter is a convenient way to implement coordinate transformation. + + + Martin Davis + + + + + + + Performs an operation on a coordinate in a . + + the CoordinateSequence to which the filter is applied + i the index of the coordinate to apply the filter to + + + + Reports whether the application of this filter can be terminated. + + + Once this method returns false, it should + continue to return false on every subsequent call. + + + + + Reports whether the execution of this filter has modified the coordinates of the geometry. + If so, will be executed + after this filter has finished being executed. + + Most filters can simply return a constant value reflecting whether they are able to change the coordinates. + + + + Geometry classes support the concept of applying + an IGeometryComponentFilter filter to the Geometry. + + + The filter is applied to every component of the Geometry + which is itself a Geometry + and which does not itself contain any components. + (For instance, all the LinearRings in Polygons are visited, + but in a MultiPolygon the Polygons themselves are not visited.) + Thus the only classes of Geometry which must be + handled as arguments to + are s, s and s. + An IGeometryComponentFilter filter can either + record information about the Geometry + or change the Geometry in some way. + IGeometryComponentFilter is an example of the Gang-of-Four Visitor pattern. + > + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned. + If geomList contains several Polygons, a + MultiPolygon is returned. + If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned. + If geomList is empty, an empty GeometryCollection + is returned. + + The Geometry to combine. + + A Geometry of the "smallest", "most type-specific" + class that can contain the elements of geomList. + + + + + Returns a clone of g based on a CoordinateSequence created by this + GeometryFactory's CoordinateSequenceFactory. + + + + + Creates a Point using the given Coordinate; a null Coordinate will create + an empty Geometry. + + The coordinate + A Point + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + The coordiante sequence. + A Point + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LinearRing using the given Coordinates; a null or empty array will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence possibly empty, or null. + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + Geometries, each of which may be empty but not null. + + + + Creates a with the same extent as the given envelope. + + + + + Gets the coordinate sequence factory to use when creating geometries. + + + + + Gets the spatial reference id to assign when creating geometries + + + + + Gets the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + GeometryCollection classes support the concept of + applying a IGeometryFilter to the Geometry. + The filter is applied to every element Geometry. + A IGeometryFilter can either record information about the Geometry + or change the Geometry in some way. + IGeometryFilter is an example of the Gang-of-Four Visitor pattern. + + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components which are s. + + Martin Davis + + + + + + Interface for basic implementation of Geometry. + + + + + Gets an array of ordinate values. + + + + + Gets the geometry at the given index + + A method moved in IGeometry + The index of the geometry to get + A geometry that is part of the + + + + Normalizes this geometry + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Gets the Well-Known-Binary representation of this geometry + + A byte array describing this geometry + + + + Gets the Well-Known-Text representation of this geometry + + A text describing this geometry + + + + Computes the convex hull for this geometry + + The convex hull + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS equals predicate. + + A geometry + true if this geometry is topologically equal to + + + + Tests whether two geometries are exactly equal + in their normalized forms. + > + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + + + + + + Returns the minimum distance between this Geometry + and the Geometry g. + + The Geometry from which to compute the distance. + + + + Performs an operation with or on this Geometry's + coordinates. If you are using this method to modify the point, be sure + to call afterwards. + Note that you cannot use this method to modify this Geometry + if its underlying 's Get method + returns a copy of the , rather than the actual + Coordinate stored (if it even stores Coordinates at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + If this method modifies any coordinate values, must be called to update the geometry state. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + Notifies this geometry that its coordinates have been changed by an external + party (using a CoordinateFilter, for example). The Geometry will flush + and/or update any information it has cached (such as its ). + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When is called, this method will be called for + this Geometry and its component geometries. + + + + + The used to create this geometry + + + + + The the used to create this. + + + + + Gets the spatial reference id + + + + + Gets the geometry type + + + + + Gets the OGC geometry type + + + + + Gets the area of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the length of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the number of geometries that make up this geometry + + + A method moved in IGeometry + + + + + Get the number of coordinates, that make up this geometry + + A method moved to IGeometry + + + + Gets the boundary geometry + + + + + Gets the of the boundary + + + + + Gets the centroid of the geometry + + A property moved in IGeometry + + + + Gets a that is guaranteed to be part of the geometry, usually the first. + + + + + Gets an array of s that make up this geometry. + + + + + Gets the of this geometry + + + + + Gets the envelope this would fit into. + + + + + Gets the envelope this would fit into. + + + + + Gets a point that is ensured to lie inside this geometry. + + + + + A ISurface method moved in IGeometry + + + + + Gets or sets the user data associated with this geometry + + + + + Structure for a closed 1-dimensional ℝ-interval + + + + + The lower bound of the interval + + + + + The upper bound of the interval + + + + + Initializes this structure with = = + + The value for min and max + + + + Initializes this structure with and values + + The minimum interval values + The maximum interval values + + + + Method to expand + + + + + + + + + + + + + + + + + + + Function to compute an interval that contains this and + + The interval + An interval + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval ℝ[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval ℝ[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval ℝ[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Function to test if this intersects the interval . + + + + true if this interval intersects + + + + Function to test if this intersects the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval intersects the interval ℝ[, ]. + + + + Creates an empty or uninitialzed Interval + + An empty or uninitialized + + + + Creates an interval with the range ℝ[,] + + The value + An + + + + Creates an interval with the range ℝ[,].
+ If necessary, val1 and val2 are exchanged. +
+ The minimum value + The maximum value + An +
+ + + Creates an interval with the range ℝ[,]. + + The template interval + An + + + + Equality operator for s + + The left-hand-side + The right-hand-side + true if the s are equal. + + + + Inequality operator for s + + The left-hand-side + The right-hand-side + true if the s are not equal. + + + + Gets a value if this interval is empty/undefined + + + + + Gets a value indicating the width of the + + + + + Gets a value indicating the centre of the interval (Min + Width * 0.5) + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that are s. + + Martin Davis + + + + + + + + + + + Floating precision corresponds to the standard + double-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Floating single precision corresponds to the standard + single-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Fixed Precision indicates that coordinates have a fixed number of decimal places. + The number of decimal places is determined by the log10 of the scale factor. + + + + + Interface for classes specifying the precision model of the Coordinates in a IGeometry. + In other words, specifies the grid of allowable points for all IGeometrys. + + + + + Function to compute a precised value of + + The value to precise + The precised value + + + + Method to precise . + + The coordinate to precise + + + + Gets a value indicating the precision model type + + + + + Gets a value indicating if this precision model has floating precision + + + + + Gets a value indicating the maximum precision digits + + + + + Gets a value indicating the scale factor of a fixed precision model + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that ar s. + + Martin Davis + + + + + + Interface for surfaces + + + + + Interface for a curve + + + + + Gets a value indicating the sequence of coordinates that make up curve + + + + + Gets a value indicating the start point of the curve + + + + + Gets a value indicating the end point of the curve + + + + + Gets a value indicating that the curve is closed. + In this case an are equal. + + + + + Gets a value indicating that the curve is a ring. + + + + + Gets a value indicating whether this ring is oriented counter-clockwise. + + + + + Provides constants representing the dimensions of a point, a curve and a surface. + + + Also provides constants representing the dimensions of the empty geometry and + non-empty geometries, and the wildcard constant meaning "any dimension". + These constants are used as the entries in s. + + + + + Dimension value of a point (0). + + + + + Dimension value of a curve (1). + + + + + Dimension value of a surface (2). + + + + + Dimension value of a empty point (-1). + + + + + Dimension value of non-empty geometries (= {Point,Curve,A}). + + + + + Dimension value for any dimension (= {False, True}). + + + + + Class containing static methods for conversions + between dimension values and characters. + + + + + Symbol for the FALSE pattern matrix entry + + + + + Symbol for the TRUE pattern matrix entry + + + + + Symbol for the DONTCARE pattern matrix entry + + + + + Symbol for the P (dimension 0) pattern matrix entry + + + + + Symbol for the L (dimension 1) pattern matrix entry + + + + + Symbol for the A (dimension 2) pattern matrix entry + + + + + Converts the dimension value to a dimension symbol, + for example, True => 'T' + + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + + + + Converts the dimension symbol to a dimension value, + for example, '*' => Dontcare + + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + + + + Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. + + + + DE-9IM matrices (such as "212FF1FF2") + specify the topological relationship between two s. + This class can also represent matrix patterns (such as "T*T******") + which are used for matching instances of DE-9IM matrices. + + + Methods are provided to: + + Set and query the elements of the matrix in a convenient fashion. + Convert to and from the standard string representation (specified in SFS Section 2.1.13.2). + Test to see if a matrix matches a given pattern string. + + + For a description of the DE-9IM and the spatial predicates derived from it, see the + OGC 99-049 OpenGIS Simple Features Specification for SQL. as well as + OGC 06-103r4 OpenGIS + Implementation Standard for Geographic information - + Simple feature access - Part 1: Common architecture + (which provides some further details on certain predicate specifications). + + The entries of the matrix are defined by the constants in the enum. + The indices of the matrix represent the topological locations + that occur in a geometry (Interior, Boundary, Exterior). + These are provided as constants in the enum. + + + + + + Internal representation of this . + + + + + Creates an with null location values. + + + + + Creates an with the given dimension + symbols. + + A string of nine dimension symbols in row major order. + + + + Creates an with the same elements as + other. + + An to copy. + + + + Adds one matrix to another. + Addition is defined by taking the maximum dimension value of each position + in the summand matrices. + + The matrix to add. + + + + Tests if the dimension value matches TRUE + (i.e. has value 0, 1, 2 or TRUE). + + A number that can be stored in the IntersectionMatrix. + Possible values are {, , , , , } + true if the dimension value matches + + + + Tests if the dimension value satisfies the dimension symbol. + + + a number that can be stored in the IntersectionMatrix. + Possible values are {True, False, Dontcare, 0, 1, 2}. + + + A character used in the string + representation of an . + Possible values are T, F, * , 0, 1, 2. + + + true if the dimension symbol encompasses the dimension value. + + + + + Tests if each of the actual dimension symbols in a matrix string satisfies the + corresponding required dimension symbol in a pattern string. + + + Nine dimension symbols to validate. + Possible values are T, F, * , 0, 1, 2. + + + Nine dimension symbols to validate + against. Possible values are T, F, * , 0, 1, 2. + + + true if each of the required dimension + symbols encompass the corresponding actual dimension symbol. + + + + + Changes the value of one of this elements. + + + The row of this , + indicating the interior, boundary or exterior of the first + + + The column of this , + indicating the interior, boundary or exterior of the second + + The new value of the element + + + + Changes the elements of this to the + dimension symbols in dimensionSymbols. + + + Nine dimension symbols to which to set this + s elements. Possible values are {T, F, * , 0, 1, 2} + + + + + Changes the specified element to minimumDimensionValue if the element is less. + + + The row of this , + indicating the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + + The dimension value with which to compare the + element. The order of dimension values from least to greatest is + True, False, Dontcare, 0, 1, 2. + + + + + If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue + if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0. + + + + + + + + For each element in this , changes the + element to the corresponding minimum dimension symbol if the element is + less. + + + Nine dimension symbols with which to + compare the elements of this . The + order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2. + + + + + Changes the elements of this to dimensionValue. + + + The dimension value to which to set this + s elements. Possible values True, False, Dontcare, 0, 1, 2}. + + + + + Returns the value of one of this s + elements. + + + The row of this , indicating + the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + The dimension value at the given matrix position. + + + + Returns true if this is FF*FF****. + + + true if the two 's related by + this are disjoint. + + + + + Returns true if isDisjoint returns false. + + + true if the two 's related by + this intersect. + + + + + Returns true if this is + FT*******, F**T***** or F***T****. + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this touch; Returns false + if both s are points. + + + + + Returns true if this is + T*T****** (for a point and a curve, a point and an area or a line + and an area) 0******** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this cross. For this + function to return true, the s must + be a point and a curve; a point and a surface; two curves; or a curve + and a surface. + + + + + Returns true if this is + T*F**F***. + + true if the first is within the second. + + + + Returns true if this is + T*****FF*. + + true if the first contains the second. + + + + Returns true if this is T*****FF* + or *T****FF* or ***T**FF* or ****T*FF*. + + true if the first covers the second + + + + Returns true if this is T*F**F*** + or *TF**F*** or **FT*F*** or **F*TF*** + + true if the first is covered by the second + + + + Tests whether the argument dimensions are equal and + this IntersectionMatrix matches + the pattern T*F**FFF*. + + Note: This pattern differs from the one stated in + Simple feature access - Part 1: Common architecture. + That document states the pattern as TFFFTFFFT. This would + specify that + two identical POINTs are not equal, which is not desirable behaviour. + The pattern used here has been corrected to compute equality in this situation. + + The dimension of the first . + The dimension of the second . + + true if the two s + related by this are equal; the + s must have the same dimension to be equal. + + + + + Returns true if this is + T*T***T** (for two points or two surfaces) + 1*T***T** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this overlap. For this + function to return true, the s must + be two points, two curves or two surfaces. + + + + + Returns whether the elements of this + satisfies the required dimension symbols. + + + Nine dimension symbols with which to + compare the elements of this . Possible + values are {T, F, * , 0, 1, 2}. + + + true if this + matches the required dimension symbols. + + + + + Transposes this IntersectionMatrix. + + This as a convenience, + + + + Returns a nine-character String representation of this . + + + The nine dimension symbols of this + in row-major order. + + + + + See methods Get(int, int) and Set(int, int, int value) + + + + + The location of a relative to a + + + + + DE-9IM row index of the interior of the first point and column index of + the interior of the second point. Location value for the interior of a + point. + + int value = 0; + + + + DE-9IM row index of the boundary of the first point and column index of + the boundary of the second point. Location value for the boundary of a + point. + + int value = 1; + + + + DE-9IM row index of the exterior of the first point and column index of + the exterior of the second point. Location value for the exterior of a + point. + + int value = 2; + + + + Used for uninitialized location values. + + int value = 1; + + + + Utility class for enumeration + + + + + Converts the location value to a location symbol, for example, EXTERIOR => 'e'. + + + Either 'e', 'b', 'i' or '-'. + + + + Standard ordinate index values. + + + + + X Ordinate = 0. + + + + + Y Ordinate = 1. + + + + + Z Ordinate = 2. + + + + + M Ordinate = 3 + + + + + Ordinate at index 2 + + + + + Ordinate at index 3 + + + + + Ordinate at index 4 + + + + + Ordinate at index 5 + + + + + Ordinate at index 6 + + + + + Ordinate at index 7 + + + + + Ordinate at index 8 + + + + + Ordinate at index 9 + + + + + Ordinate at index 10 + + + + + Ordinate at index 11 + + + + + Ordinate at index 12 + + + + + Ordinate at index 13 + + + + + Ordinate at index 14 + + + + + Ordinate at index 15 + + + + + Ordinate at index 16 + + + + + Ordinate at index 17 + + + + + Ordinate at index 18 + + + + + Ordinate at index 19 + + + + + Ordinate at index 20 + + + + + Ordinate at index 21 + + + + + Ordinate at index 22 + + + + + Ordinate at index 23 + + + + + Ordinate at index 24 + + + + + Ordinate at index 25 + + + + + Ordinate at index 26 + + + + + Ordinate at index 27 + + + + + Ordinate at index 28 + + + + + Ordinate at index 29 + + + + + Ordinate at index 30 + + + + + Ordinate at index 31 + + + + + Ordinate at index 32 + + + + + Flags for Ordinate values + + + + + No ordinates + + + + + Flag for the x-ordinate + + + + + Flag for the y-ordinate + + + + + Flag for both x- and y-ordinate + + + + + Flag for the z-ordinate + + + + + Flag for x-, y- and z-ordinate + + + + + Flag for the m-ordinate + + + + + Flag for x-, y- and m-ordinate + + + + + Flag for x-, y-, z- and m-ordinate + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 10 + + + + + Flag for ordinate at index 11 + + + + + Flag for ordinate at index 12 + + + + + Flag for ordinate at index 13 + + + + + Flag for ordinate at index 14 + + + + + Flag for ordinate at index 15 + + + + + Flag for ordinate at index 16 + + + + + Flag for ordinate at index 17 + + + + + Flag for ordinate at index 18 + + + + + Flag for ordinate at index 19 + + + + + Flag for ordinate at index 20 + + + + + Flag for ordinate at index 21 + + + + + Flag for ordinate at index 22 + + + + + Flag for ordinate at index 23 + + + + + Flag for ordinate at index 24 + + + + + Flag for ordinate at index 25 + + + + + Flag for ordinate at index 26 + + + + + Flag for ordinate at index 27 + + + + + Flag for ordinate at index 28 + + + + + Flag for ordinate at index 29 + + + + + Flag for ordinate at index 30 + + + + + Flag for ordinate at index 31 + + + + + Flag for ordinate at index 32 + + + + + An interface for classes which prepare s + in order to optimize the performance of repeated calls to specific geometric operations. + + + + A given implementation may provide optimized implementations + for only some of the specified methods, and delegate the remaining + methods to the original operations. + + + An implementation may also only optimize certain situations, and delegate others. + See the implementing classes for documentation about which methods and situations + they optimize. + + Subclasses are intended to be thread-safe, to allow IPreparedGeometry + to be used in a multi-threaded context + (which allows extracting maximum benefit from the prepared state). + + + Martin Davis + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + + + + Tests whether the base contains a given geometry. + + + + The ContainsProperly predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry's interior. + The DE-9IM Intersection Matrix for the two geometries matches >[T**FF*FF*] + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + + + An example use case for this predicate is computing the intersections + of a set of geometries with a large polygonal geometry. + Since intersection is a fairly slow operation, it can be more efficient + to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection + known a priori to be simply the original test geometry. + + + The geometry to test + true if this geometry properly contains the given geometry + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + + + + Tests whether the base is disjoint from given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry is disjoint from the given geometry + + + + + Tests whether the base intersects a given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry intersects the given geometry + + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + + + + Gets the original which has been prepared. + + + + + Static class that provides access to a class. + + + + + Gets or sets the instance. + + + + + Interface for classes that provide access to coordinate system and tranformation facilities. + + + + + Returns the coordinate system by identifier + + The initialization for the coordinate system + The coordinate system. + + + + Returns the coordinate system by and . + + The authority for the coordinate system + The code assigned to the coordinate system by . + The coordinate system. + + + + Method to get the identifier, by which this coordinate system can be accessed. + + The authority name + The code assigned by + The identifier or null + + + + Method to create a coordinate tranformation between two spatial reference systems, defined by their identifiers + + This is a convenience function for . + The identifier for the source spatial reference system. + The identifier for the target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Method to create a coordinate tranformation between two spatial reference systems + + The source spatial reference system. + The target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Delegate function to get a coordinate system from a given initialization string + + The initialization string + The type of the coordinate sytem. + + + + An interface for classes that offer access to geometry creating facillities. + + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Creates a new geometry factory, using , and . + + The geometry factory + + + + Creates a geometry fractory using and . + + + The geometry factory + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The spatial reference id. + The geometry factory. + + + + Creates a geometry factory using the given , + and . + + The coordinate sequence factory to use. + The spatial reference id. + The coordinate sequence factory. + The geometry factory. + + + + Reads the configuration from the configuration + + + + + Writes the current configuration to the configuration + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Byte order + + + + + BigEndian + + + + + LittleEndian + + + + + Lightweight class that handles OGC Geometry type declaration + + + + + Initializes this instance + + The value describing the + + + + Inititalizes this instance based on a geometry and an Ordinates flag. + + The geometry. + The ordinates flag. + + + + Inititalizes this instance based on an + + The OGC geometry type + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + Indicator if a SRID is supplied. + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + The ordinates flag. + Indicator if a SRID is supplied. + + + + Gets or sets the base geometry type + + + + + Gets the OGC Well-Known-Binary type code + + + + + Gets the PostGIS Enhanced Well-Known-Binary type code + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets whether SRID value is stored along with the geometry. + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Interface for a coordinate buffer + + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Sets a m-value at the provided + + The index + The value + + + + Sets a z-value at the provided + + The index + The value + + + + Converts the contents of this to a . +
Optionally you may assign a factory to create the sequence +
+ The factory to use in order to create the sequence. + A coordinate sequence +
+ + + Gets the (current) capacity of the buffer + + + + + Gets the (current) number of coordinates in the buffer + + + + + Base interface for geometry reader or writer interfaces. + + + + + Gets or sets whether the SpatialReference ID must be handled. + + + + + Gets and flag that indicate which ordinates can be handled. + + + This flag must always return at least . + + + + + Gets and sets flag that indicate which ordinates shall be handled. + + + No matter which flag you supply, are always processed, + the rest is binary and 'ed with . + + + + + Interface for binary output of instances. + + The type of the output to produce. + + + + Writes a binary representation of a given geometry. + + The geometry + The binary representation of + + + + Writes a binary representation of a given geometry. + + + + + + + Interface for binary output of instances. + + + + + Gets or sets the desired + + + + + Interface for textual output of instances. + + + + + Interface for input/parsing of instances. + + The type of the source to read from. + + + + Reads a geometry representation from a to a Geometry. + + + The source to read the geometry from + For WKT is string, + for WKB is byte[], + + + A Geometry + + + + + Reads a geometry representation from a to a Geometry. + + The stream to read from. + A Geometry + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Interface for textual input of instances. + + + + + Interface for binary input of instances. + + + + + Enumeration of OGC Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + CircularString + + + + + CompoundCurve + + + + + CurvePolygon + + + + + MultiCurve + + + + + MultiSurface + + + + + Curve + + + + + Surface + + + + + PolyhedralSurface + + + + + TIN + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Creates a ParseException with s detail message + + + The inner exception + + + + Buffer style. + + + + + Specifies a round line buffer end cap endCapStyle (Default). + / + + + + Specifies a butt (or flat) line buffer end cap endCapStyle. + + + + + Specifies a square line buffer end cap endCapStyle. + + + + + End cap style constants + + + + + Specifies a round line buffer end cap style. + + + + + Specifies a flat line buffer end cap style. + + + + + Specifies a square line buffer end cap style. + + + + + An interface for classes that control the parameters for the buffer building process + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + + + + Gets/Sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + qs >>= 1joins are round, and qs indicates the number of segments to use to approximate a quarter-circle. + qs = 0joins are beveled + qs < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |qs| + + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , , and . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Gets or sets the factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + Join style constants + + + + + Specifies a round join style. + + + + + Specifies a mitre join style. + + + + + Specifies a bevel join style. + + + + + Static utility functions for dealing with and dimension + + + + + Translates the -flag to a number of dimensions. + + The ordinates flag + The number of dimensions + + + + Translates a dimension value to an -flag. + + The flag for is set first. + The dimension. + The ordinates-flag + + + + Converts an encoded flag to an array of indices. + + The ordinate flags + The maximum oridinate flag that is to be checked + The ordinate indices + + + + Converts an array of values to an flag. + + An array of values + An flag. + +
+
Index: packages/GeoAPI.1.7.4/lib/net40-client/GeoAPI.dll =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/net40-client/GeoAPI.xml =================================================================== diff -u --- packages/GeoAPI.1.7.4/lib/net40-client/GeoAPI.xml (revision 0) +++ packages/GeoAPI.1.7.4/lib/net40-client/GeoAPI.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,5702 @@ + + + + GeoAPI + + + + + Details of axis. This is used to label axes, and indicate the orientation. + + + + + Initializes a new instance of an AxisInfo. + + Name of axis + Axis orientation + + + + Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string. + + + + + Gets enumerated value for orientation. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Orientation of axis. Some coordinate systems use non-standard orientations. + For example, the first axis in South African grids usually points West, + instead of East. This information is obviously relevant for algorithms + converting South African grid coordinates into Lat/Long. + + + + + Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems. + + + + + Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude. + + + + + Increasing ordinates values go South. This is rarely used. + + + + + Increasing ordinates values go East. This is rarely used. + + + + + Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude. + + + + + Increasing ordinates values go up. This is used for vertical coordinate systems. + + + + + Increasing ordinates values go down. This is used for vertical coordinate systems. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) through + the equation: H=h-N. + + + + + Lowest possible value for horizontal datum types + + + + + Unspecified horizontal datum type. Horizontal datums with this type should never + supply a conversion to WGS84 using Bursa Wolf parameters. + + + + + These datums, such as ED50, NAD27 and NAD83, have been designed to support + horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent. + + + + + A geocentric datum is a "satellite age" modern geodetic datum mainly of global + extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These + datums were designed to support both a horizontal component of position and + a vertical component of position (through ellipsoidal heights). The regional + realizations of ITRF, such as ETRF, are also included in this category. + + + + + Highest possible value for horizontal datum types. + + + + + Lowest possible value for vertical datum types. + + + + + Unspecified vertical datum type. + + + + + A vertical datum for orthometric heights that are measured along the plumb line. + + + + + A vertical datum for ellipsoidal heights that are measured along the normal to + the ellipsoid used in the definition of horizontal datum. + + + + + The vertical datum of altitudes or heights in the atmosphere. These are + approximations of orthometric heights obtained with the help of a barometer or + a barometric altimeter. These values are usually expressed in one of the + following units: meters, feet, millibars (used to measure pressure levels), or + theta value (units used to measure geopotential height). + + + + + A normal height system. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) + through the equation: H=h-N. + + + + + This attribute is used to support the set of datums generated for hydrographic + engineering projects where depth measurements below sea level are needed. It is + often called a hydrographic or a marine datum. Depths are measured in the + direction perpendicular (approximately) to the actual equipotential surfaces of + the earth's gravity field, using such procedures as echo-sounding. + + + + + Highest possible value for vertical datum types. + + + + + Lowest possible value for local datum types. + + + + + Highest possible value for local datum types. + + + + + The IAngularUnit interface defines methods on angular units. + + + + + The IUnit interface abstracts different kinds of units, it has no methods. + + + + + The ISpatialReferenceInfo interface defines the standard + information stored with spatial reference objects. This + interface is reused for many of the spatial reference + objects in the system. + + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Gets or sets the name of the object. + + + + + Gets or sets the authority name for this object, e.g., “POSC”, + is this is a standard object with an authority specific + identity code. Returns “CUSTOM” if this is a custom object. + + + + + Gets or sets the authority specific identification code of the object + + + + + Gets or sets the alias of the object. + + + + + Gets or sets the abbreviation of the object. + + + + + Gets or sets the provider-supplied remarks for the object. + + + + + Returns the Well-known text for this spatial reference object + as defined in the simple features specification. + + + + + Gets an XML representation of this object. + + + + + Gets or sets the number of radians per angular unit. + + + + + An aggregate of two coordinate systems (CRS). One of these is usually a + CRS based on a two dimensional coordinate system such as a geographic or + a projected coordinate system with a horizontal datum. The other is a + vertical CRS which is a one-dimensional coordinate system with a vertical + datum. + + + + + Base interface for all coordinate systems + + + A coordinate system is a mathematical space, where the elements of the space are called + positions. Each position is described by a list of numbers. The length of the list corresponds + to the dimension of the coordinate system. So in a 2D coordinate system each position is + described by a list containing 2 numbers. + + However, in a coordinate system, not all lists of numbers correspond to a position - + some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon + coordinate system, the list (91,91) does not correspond to a position. + + Some coordinate systems also have a mapping from the mathematical space into locations + in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) + corresponds to a location on the surface of the Earth. This mapping from the mathematical + space into real-world locations is called a Datum. + + + + + Gets axis details for dimension within coordinate system. + + Dimension + Axis info + + + + Gets units for dimension within coordinate system. + + + + + Dimension of the coordinate system. + + + + + Gets default envelope of coordinate system. + + + Gets default envelope of coordinate system. Coordinate systems + which are bounded should return the minimum bounding box of their + domain. Unbounded coordinate systems should return a box which is + as large as is likely to be used. For example, a (lon,lat) + geographic coordinate system in degrees should return a box from + (-180,-90) to (180,90), and a geocentric coordinate system could + return a box from (-r,-r,-r) to (+r,+r,+r) where r is the + approximate radius of the Earth. + + + + + Gets first sub-coordinate system. + + + + + Gets second sub-coordinate system. + + + + + Creates spatial reference objects using codes. + + + The codes are maintained by an external authority. A commonly used authority is EPSG, which is also used in the GeoTIFF standard and in SharpMap. + + + + + Returns a projected coordinate system object corresponding to the given code. + + The identification code. + The projected coordinate system object with the given code. + + + + Returns a geographic coordinate system object corresponding to the given code. + + The identification code. + The geographic coordinate system object with the given code. + + + + Returns a horizontal datum object corresponding to the given code. + + The identification code. + The horizontal datum object with the given code. + + + + Returns an ellipsoid object corresponding to the given code. + + The identification code. + The ellipsoid object with the given code. + + + + Returns a prime meridian object corresponding to the given code. + + The identification code. + The prime meridian object with the given code. + + + + Returns a linear unit object corresponding to the given code. + + The identification code. + The linear unit object with the given code. + + + + Returns an angular unit object corresponding to the given code. + + The identification code. + The angular unit object for the given code. + + + + Creates a from a code. + + Authority code + Vertical datum for the given code + + + + Create a vertical coordinate system from a code. + + Authority code + + + + + Creates a 3D coordinate system from a code. + + Authority code + Compound coordinate system for the given code + + + + Creates a horizontal co-ordinate system from a code. + The horizontal coordinate system could be geographic or projected. + + Authority code + Horizontal coordinate system for the given code + + + + Gets the Geoid code from a WKT name. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced + by a quoted string, which is used as a key value. This method converts + the key value string into a code recognized by this authority. + + + + + + + Gets the WKT name of a Geoid. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced by + a quoted string, which is used as a key value. This method gets the OGC WKT + key value from a geoid code. + + + + + + + Returns the authority name for this factory (e.g., "EPSG" or "POSC"). + + + + + Gets a description of the object corresponding to a code. + + + + + Builds up complex objects from simpler objects or values. + + + ICoordinateSystemFactory allows applications to make coordinate systems that + cannot be created by a . This factory is very + flexible, whereas the authority factory is easier to use. + So can be used to make 'standard' coordinate + systems, and can be used to make 'special' + coordinate systems. + For example, the EPSG authority has codes for USA state plane coordinate systems + using the NAD83 datum, but these coordinate systems always use meters. EPSG does not + have codes for NAD83 state plane coordinate systems that use feet units. This factory + lets an application create such a hybrid coordinate system. + + + + + Creates a . + + Name of compound coordinate system. + Head coordinate system + Tail coordinate system + Compound coordinate system + + + + Creates an from radius values. + + + Name of ellipsoid + + + + Ellipsoid + + + + Creates a . + + The units of the axes in the fitted coordinate system will be + inferred from the units of the base coordinate system. If the affine map + performs a rotation, then any mixed axes must have identical units. For + example, a (lat_deg,lon_deg,height_feet) system can be rotated in the + (lat,lon) plane, since both affected axes are in degrees. But you + should not rotate this coordinate system in any other plane. + Name of coordinate system + Base coordinate system + + + Fitted coordinate system + + + + Creates an from an major radius, and inverse flattening. + + + Name of ellipsoid + Semi major-axis + Inverse flattening + Linear unit + Ellipsoid + + + + Creates a coordinate system object from an XML string. + + XML representation for the spatial reference + The resulting spatial reference object + + + + Creates a spatial reference object given its Well-known text representation. + The output object may be either a or + a . + + The Well-known text representation for the spatial reference + The resulting spatial reference object + + + + Creates a , which could be Lat/Lon or Lon/Lat. + + Name of geographical coordinate system + Angular units + Horizontal datum + Prime meridian + First axis + Second axis + Geographic coordinate system + + + + Creates from ellipsoid and Bursa-World parameters. + + + Since this method contains a set of Bursa-Wolf parameters, the created + datum will always have a relationship to WGS84. If you wish to create a + horizontal datum that has no relationship with WGS84, then you can + either specify a horizontalDatumType of , or create it via WKT. + + Name of ellipsoid + Type of datum + Ellipsoid + Wgs84 conversion parameters + Horizontal datum + + + + Creates a local coordinate system. + + + The dimension of the local coordinate system is determined by the size of + the axis array. All the axes will have the same units. If you want to make + a coordinate system with mixed units, then you can make a compound + coordinate system from different local coordinate systems. + + Name of local coordinate system + Local datum + Units + Axis info + Local coordinate system + + + + Creates a . + + Name of datum + Datum type + + + + + Creates a , relative to Greenwich. + + Name of prime meridian + Angular unit + Longitude + Prime meridian + + + + Creates a using a projection object. + + Name of projected coordinate system + Geographic coordinate system + Projection + Linear unit + Primary axis + Secondary axis + Projected coordinate system + + + + Creates a . + + Name of projection + Projection class + Projection parameters + Projection + + + + Creates a from a datum and linear units. + + Name of vertical coordinate system + Vertical datum + Unit + Axis info + Vertical coordinate system + + + + Creates a from an enumerated type value. + + Name of datum + Type of datum + Vertical datum + + + + A set of quantities from which other quantities are calculated. + + + For the OGC abstract model, it can be defined as a set of real points on the earth + that have coordinates. EG. A datum can be thought of as a set of parameters + defining completely the origin and orientation of a coordinate system with respect + to the earth. A textual description and/or a set of parameters describing the + relationship of a coordinate system to some predefined physical locations (such + as center of mass) and physical directions (such as axis of spin). The definition + of the datum may also include the temporal behavior (such as the rate of change of + the orientation of the coordinate axes). + + + + + Gets or sets the type of the datum as an enumerated code. + + + + + The IEllipsoid interface defines the standard information stored with ellipsoid objects. + + + + + Gets or sets the value of the semi-major axis. + + + + + Gets or sets the value of the semi-minor axis. + + + + + Gets or sets the value of the inverse of the flattening constant of the ellipsoid. + + + + + Gets or sets the value of the axis unit. + + + + + Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the + IVF as the defining value, and calculate the polar radius whenever asked. Other + ellipsoids use the polar radius to calculate the IVF whenever asked. This + distinction can be important to avoid floating-point rounding errors. + + + + + A coordinate system which sits inside another coordinate system. The fitted + coordinate system can be rotated and shifted, or use any other math transform + to inject itself into the base coordinate system. + + + + + Gets Well-Known Text of a math transform to the base coordinate system. + The dimension of this fitted coordinate system is determined by the source + dimension of the math transform. The transform should be one-to-one within + this coordinate system's domain, and the base coordinate system dimension + must be at least as big as the dimension of this coordinate system. + + + + + + Gets underlying coordinate system. + + + + + A 3D coordinate system, with its origin at the center of the Earth. + + + + + Returns the HorizontalDatum. The horizontal datum is used to determine where + the centre of the Earth is considered to be. All coordinate points will be + measured from the centre of the Earth, and not the surface. + + + + + Gets the units used along all the axes. + + + + + Returns the PrimeMeridian. + + + + + The IGeodeticSpatialReference interface defines a root interface for all types of geodetic + spatial references, it is a subclass of ICoordinateSystem. + + + + + The IGeographicCoordinateSystem interface is a subclass of IGeodeticSpatialReference and + defines the standard information stored with geographic coordinate system objects. + + + + + A 2D coordinate system suitable for positions on the Earth's surface. + + + + + Returns the HorizontalDatum. + + + + + Gets details on a conversion to WGS84. + + + + + Gets or sets the angular units of the geographic coordinate system. + + + + + Gets or sets the prime meridian of the geographic coordinate system. + + + + + Gets the number of available conversions to WGS84 coordinates. + + + + + The IGeographicTransform interface is implemented on geographic transformation + objects and implements datum transformations between geographic coordinate systems. + + + + + Transforms an array of points from the source geographic coordinate system + to the target geographic coordinate system. + + Points in the source geographic coordinate system + Points in the target geographic coordinate system + + + + Transforms an array of points from the target geographic coordinate system + to the source geographic coordinate system. + + Points in the target geographic coordinate system + Points in the source geographic coordinate system + + + + Gets or sets source geographic coordinate system for the transformation. + + + + + Gets or sets the target geographic coordinate system for the transformation. + + + + + Returns an accessor interface to the parameters for this geographic transformation. + + + + + Procedure used to measure positions on the surface of the Earth. + + + + + Gets or sets the ellipsoid of the datum. + + + + + Gets preferred parameters for a Bursa Wolf transformation into WGS84. The 7 returned values + correspond to (dx,dy,dz) in meters, (ex,ey,ez) in arc-seconds, and scaling in parts-per-million. + + + + + The ILinearUnit interface defines methods on linear units. + + + + + Gets or sets the number of meters per . + + + + + A local coordinate system, with uncertain relationship to the world. + + In general, a local coordinate system cannot be related to other coordinate + systems. However, if two objects supporting this interface have the same dimension, + axes, units and datum then client code is permitted to assume that the two coordinate + systems are identical. This allows several datasets from a common source (e.g. a CAD + system) to be overlaid. In addition, some implementations of the Coordinate + Transformation (CT) package may have a mechanism for correlating local datums. (E.g. + from a database of transformations, which is created and maintained from real-world + measurements.) + + + + + Gets or sets the local datum + + + + + Local datum. If two local datum objects have the same datum type and name, + then they can be considered equal. This means that coordinates can be + transformed between two different local coordinate systems, as long as + they are based on the same local datum. + + + + + The IParameterInfo interface provides an interface through which clients of a + Projected Coordinate System or of a Projection can set the parameters of the + projection. It provides a generic interface for discovering the names and default + values of parameters, and for setting and getting parameter values. Subclasses of + this interface may provide projection specific parameter access methods. + + + + + Returns the default parameters for this projection. + + + + + + Gets the parameter by its name + + + + + + + Gets the number of parameters expected. + + + + + Gets or sets the parameters set for this projection. + + + + + The IPrimeMeridian interface defines the standard information stored with prime + meridian objects. Any prime meridian object must implement this interface as + well as the ISpatialReferenceInfo interface. + + + + + Gets or sets the longitude of the prime meridian (relative to the Greenwich prime meridian). + + + + + Gets or sets the AngularUnits. + + + + + The IProjectedCoordinateSystem interface defines the standard information stored with + projected coordinate system objects. A projected coordinate system is defined using a + geographic coordinate system object and a projection object that defines the + coordinate transformation from the geographic coordinate system to the projected + coordinate systems. The instances of a single ProjectedCoordinateSystem COM class can + be used to model different projected coordinate systems (e.g., UTM Zone 10, Albers) + by associating the ProjectedCoordinateSystem instances with Projection instances + belonging to different Projection COM classes (Transverse Mercator and Albers, + respectively). + + + + + Gets or sets the geographic coordinate system associated with the projected + coordinate system. + + + + + Gets or sets the linear (projected) units of the projected coordinate system. + + + + + Gets or sets the projection for the projected coordinate system. + + + + + The IProjection interface defines the standard information stored with projection + objects. A projection object implements a coordinate transformation from a geographic + coordinate system to a projected coordinate system, given the ellipsoid for the + geographic coordinate system. It is expected that each coordinate transformation of + interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of + coType Projection, supporting the IProjection interface. + + + + + Gets an indexed parameter of the projection. + + Index of parameter + n'th parameter + + + + Gets an named parameter of the projection. + + The parameter name is case insensitive + Name of parameter + parameter or null if not found + + + + Gets number of parameters of the projection. + + + + + Gets the projection classification name (e.g. 'Transverse_Mercator'). + + + + + A one-dimensional coordinate system suitable for vertical measurements. + + + + + Gets the vertical datum, which indicates the measurement method + + + + + Gets the units used along the vertical axis. + + + + + Procedure used to measure vertical distances. + + + + + A named parameter value. + + + + + Creates an instance of a parameter + + Units are always either meters or degrees. + Name of parameter + Value + + + + Parameter name + + + + + Parameter value + + + + + A named projection parameter value. + + + The linear units of parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. (Notice that this is different from , + where the units are always meters and degrees.) + + + + + Initializes an instance of a ProjectionParameter + + Name of parameter + Parameter value + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Parameter name. + + + + + Parameter value. + The linear units of a parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Flags indicating parts of domain covered by a convex hull. + + + These flags can be combined. For example, the value 3 + corresponds to a combination of and , + which means that some parts of the convex hull are inside the + domain, and some parts of the convex hull are outside the domain. + + + + + At least one point in a convex hull is inside the transform's domain. + + + + + At least one point in a convex hull is outside the transform's domain. + + + + + At least one point in a convex hull is not transformed continuously. + + + As an example, consider a "Longitude_Rotation" transform which adjusts + longitude coordinates to take account of a change in Prime Meridian. If + the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not + transformed continuously, since it is on the meridian line which will + be split at +180/-180 degrees. + + + + + Describes a coordinate transformation. This interface only describes a + coordinate transformation, it does not actually perform the transform + operation on points. To transform points you must use a math transform. + + + + + Human readable description of domain in source coordinate system. + + + + + Authority which defined transformation and parameter values. + + + An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is ‘4326’ + + + + + Code used by authority to identify transformation. An empty string is used for no code. + + The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is ‘4326’. + + + + Gets math transform. + + + + + Name of transformation. + + + + + Gets the provider-supplied remarks. + + + + + Source coordinate system. + + + + + Target coordinate system. + + + + + Semantic type of transform. For example, a datum transformation or a coordinate conversion. + + + + + Creates coordinate transformations. + + + + + Creates a transformation between two coordinate systems. + + + This method will examine the coordinate systems in order to construct + a transformation between them. This method may fail if no path between + the coordinate systems is found, using the normal failing behavior of + the DCP (e.g. throwing an exception). + Source coordinate system + Target coordinate system + + + + + Transforms muti-dimensional coordinate points. + + + If a client application wishes to query the source and target coordinate + systems of a transformation, then it should keep hold of the + interface, and use the contained + math transform object whenever it wishes to perform a transform. + + + + + Tests whether this transform does not move any points. + + + + + + Gets the derivative of this transform at a point. If the transform does + not have a well-defined derivative at the point, then this function should + fail in the usual way for the DCP. The derivative is the matrix of the + non-translating portion of the approximate affine map at the point. The + matrix will have dimensions corresponding to the source and target + coordinate systems. If the input dimension is M, and the output dimension + is N, then the matrix will have size [M][N]. The elements of the matrix + {elt[n][m] : n=0..(N-1)} form a vector in the output space which is + parallel to the displacement caused by a small change in the m'th ordinate + in the input space. + + + + + + + Gets transformed convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which generates a convex + hull in the source space. The returned sequence of ordinates represents a convex hull in the + output space. The number of output points will often be different from the number of input + points. Each of the input points should be inside the valid domain (this can be checked by + testing the points' domain flags individually). However, the convex hull of the input points + may go outside the valid domain. The returned convex hull should contain the transformed image + of the intersection of the source convex hull and the source domain. + A convex hull is a shape in a coordinate system, where if two positions A and B are + inside the shape, then all positions in the straight line between A and B are also inside + the shape. So in 3D a cube and a sphere are both convex hulls. Other less obvious examples + of convex hulls are straight lines, and single points. (A single point is a convex hull, + because the positions A and B must both be the same - i.e. the point itself. So the straight + line between A and B has zero length.) + Some examples of shapes that are NOT convex hulls are donuts, and horseshoes. + + + + + + + Gets flags classifying domain points within a convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which + generates a convex hull in the source space. Conceptually, each of the + (usually infinite) points inside the convex hull is then tested against + the source domain. The flags of all these tests are then combined. In + practice, implementations of different transforms will use different + short-cuts to avoid doing an infinite number of tests. + + + + + + + Creates the inverse transform of this object. + + This method may fail if the transform is not one to one. However, all cartographic projections should succeed. + + + + + Transforms a coordinate point. The passed parameter point should not be modified. + + + + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a list of coordinate point ordinal values. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Transforms a list of coordinates. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Reverses the transformation + + + + + Transforms a coordinate sequence. The input coordinate sequence remains unchanged. + + The coordinate sequence to transform. + The transformed coordinate sequence. + + + + Gets the dimension of input points. + + + + + Gets the dimension of output points. + + + + + Gets a Well-Known text representation of this object. + + + + + Gets an XML representation of this object. + + + + + Creates math transforms. + + + CT_MathTransformFactory is a low level factory that is used to create CT_MathTransform objects. Many high level GIS applications will never need to use a CT_MathTransformFactory directly; they can use a CT_CoordinateTransformationFactory instead. However, the CT_MathTransformFactory interface is specified here, since it can be used directly by applications that wish to transform other types of coordinates (e.g. color coordinates, or image pixel coordinates). + The following comments assume that the same vendor implements the math transform factory interfaces and math transform interfaces. + A math transform is an object that actually does the work of applying formulae to coordinate values. The math transform does not know or care how the coordinates relate to positions in the real world. This lack of semantics makes implementing CT_MathTransformFactory significantly easier than it would be otherwise. + For example CT_MathTransformFactory can create affine math transforms. The affine transform applies a matrix to the coordinates without knowing how what it is doing relates to the real world. So if the matrix scales Z values by a factor of 1000, then it could be converting meters into millimeters, or it could be converting kilometers into meters. + Because math transforms have low semantic value (but high mathematical value), programmers who do not have much knowledge of how GIS applications use coordinate systems, or how those coordinate systems relate to the real world can implement CT_MathTransformFactory. + The low semantic content of math transforms also means that they will be useful in applications that have nothing to do with GIS coordinates. For example, a math transform could be used to map color coordinates between different color spaces, such as converting (red, green, blue) colors into (hue, light, saturation) colors. + Since a math transform does not know what its source and target coordinate systems mean, it is not necessary or desirable for a math transform object to keep information on its source and target coordinate systems. + + + + + Creates an affine transform from a matrix. + + If the transform's input dimension is M, and output dimension is N, then the matrix will have size [N+1][M+1]. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will be the j'th ordinate of the moved origin. The [i][N] element of the matrix will be 0 for i less than M, and 1 for i equals M. + + + + + + Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other. + + The dimension of the output space of the first transform must match the dimension of the input space in the second transform. If you wish to concatenate more than two transforms, then you can repeatedly use this method. + + + + + + + Creates a math transform from a Well-Known Text string. + + + + + + + Creates a math transform from XML. + + + + + + + Creates a transform from a classification name and parameters. + + + The client must ensure that all the linear parameters are expressed in meters, and all the angular parameters are expressed in degrees. Also, they must supply "semi_major" and "semi_minor" parameters for cartographic projection transforms. + + + + + + + + Creates a transform which passes through a subset of ordinates to another transform. + + + This allows transforms to operate on a subset of ordinates. For example, if you have (Lat,Lon,Height) coordinates, then you may wish to convert the height values from meters to feet without affecting the (Lat,Lon) values. If you wanted to affect the (Lat,Lon) values and leave the Height values alone, then you would have to swap the ordinates around to (Height,Lat,Lon). You can do this with an affine map. + + + + + + + + Tests whether parameter is angular. Clients must ensure that all angular parameter values are in degrees. + + + + + + + Tests whether parameter is linear. Clients must ensure that all linear parameter values are in meters. + + + + + + + Semantic type of transform used in coordinate transformation. + + + + + Unknown or unspecified type of transform. + + + + + Transform depends only on defined parameters. For example, a cartographic projection. + + + + + Transform depends only on empirically derived parameters. For example a datum transformation. + + + + + Transform depends on both defined and empirical parameters. + + + + + Parameters for a geographic transformation into WGS84. The Bursa Wolf parameters should be applied + to geocentric coordinates, where the X axis points towards the Greenwich Prime Meridian, the Y axis + points East, and the Z axis points North. + + + These parameters can be used to approximate a transformation from the horizontal datum to the + WGS84 datum using a Bursa Wolf transformation. However, it must be remembered that this transformation + is only an approximation. For a given horizontal datum, different Bursa Wolf transformations can be + used to minimize the errors over different regions. + If the DATUM clause contains a TOWGS84 clause, then this should be its “preferred” transformation, + which will often be the transformation which gives a broad approximation over the whole area of interest + (e.g. the area of interest in the containing geographic coordinate system). + Sometimes, only the first three or six parameters are defined. In this case the remaining + parameters must be zero. If only three parameters are defined, then they can still be plugged into the + Bursa Wolf formulas, or you can take a short cut. The Bursa Wolf transformation works on geocentric + coordinates, so you cannot apply it onto geographic coordinates directly. If there are only three + parameters then you can use the Molodenski or abridged Molodenski formulas. + If a datums ToWgs84Parameters parameter values are zero, then the receiving + application can assume that the writing application believed that the datum is approximately equal to + WGS84. + + + + + Initializes an instance of Wgs84ConversionInfo with default parameters (all values = 0) + + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + Area of use for this transformation + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf scaling in parts per million. + + + + + Human readable text describing intended region of transformation. + + + + + Affine Bursa-Wolf matrix transformation + + + Transformation of coordinates from one geographic coordinate system into another + (also colloquially known as a "datum transformation") is usually carried out as an + implicit concatenation of three transformations: + [geographical to geocentric >> geocentric to geocentric >> geocentric to geographic + + The middle part of the concatenated transformation, from geocentric to geocentric, is usually + described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 + parameters, in what is known as the "Bursa-Wolf" formula:
+ + S = 1 + Ppm/1000000 + [ Xt ] [ S -Ez*S +Ey*S Dx ] [ Xs ] + [ Yt ] = [ +Ez*S S -Ex*S Dy ] [ Ys ] + [ Zt ] [ -Ey*S +Ex*S S Dz ] [ Zs ] + [ 1 ] [ 0 0 0 1 ] [ 1 ] +
+ The parameters are commonly referred to defining the transformation "from source coordinate system + to target coordinate system", whereby (XS, YS, ZS) are the coordinates of the point in the source + geocentric coordinate system and (XT, YT, ZT) are the coordinates of the point in the target + geocentric coordinate system. But that does not define the parameters uniquely; neither is the + definition of the parameters implied in the formula, as is often believed. However, the + following definition, which is consistent with the "Position Vector Transformation" convention, + is common E&P survey practice: +
+ (dX, dY, dZ): Translation vector, to be added to the point's position vector in the source + coordinate system in order to transform from source system to target system; also: the coordinates + of the origin of source coordinate system in the target coordinate system + (RX, RY, RZ): Rotations to be applied to the point's vector. The sign convention is such that + a positive rotation about an axis is defined as a clockwise rotation of the position vector when + viewed from the origin of the Cartesian coordinate system in the positive direction of that axis; + e.g. a positive rotation about the Z-axis only from source system to target system will result in a + larger longitude value for the point in the target system. Although rotation angles may be quoted in + any angular unit of measure, the formula as given here requires the angles to be provided in radians. + : The scale correction to be made to the position vector in the source coordinate system in order + to obtain the correct scale in the target coordinate system. M = (1 + dS*10-6), whereby dS is the scale + correction expressed in parts per million. + for an explanation of the Bursa-Wolf transformation +
+ +
+ + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Indicates whether the current object is equal to another object of the same type. + + + + + + + Returns a hash code for the specified object + + A hash code for the specified object + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Gets an XML representation of this object + + + + + Returns true of all 7 parameter values are 0.0 + + + + + + A lightweight class used to store coordinates on the 2-dimensional Cartesian plane. + + It is distinct from , which is a subclass of . + Unlike objects of type (which contain additional + information such as an envelope, a precision model, and spatial reference + system information), a Coordinate only contains ordinate values + and propertied. + + + Coordinates are two-dimensional points, with an additional Z-ordinate. + If an Z-ordinate value is not specified or not defined, + constructed coordinates have a Z-ordinate of NaN + (which is also the value of ). + + + + Apart from the basic accessor functions, NTS supports + only specific operations involving the Z-ordinate. + + + + + Interface for lightweight classes used to store coordinates on the 2-dimensional Cartesian plane. + + + + + Computes the 2-dimensional distance to the coordiante. + + The other coordinate + The 2-dimensional distance to other + + + + Compares equality for x- and y-ordinates + + The other coordinate + true if x- and y-ordinates of coordinate and coordiante are equal. + + + + Compares equality for x-, y- and z-ordinates + + The other coordinate + true if x-, y- and z-ordinates of coordinate and coordiante are equal. + + + + The x-ordinate value + + + + + The y-ordinate value + + + + + The z-ordinate value + + + + + The measure value + + + + + Gets or sets all ordinate values + + + + + Gets or sets the value of this + + The index + + + + The value used to indicate a null or missing ordinate value. + In particular, used for the value of ordinates for dimensions + greater than the defined dimension of a coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + Constructs a Coordinate at (x,y,z). + + X value. + Y value. + Z value. + + + + Constructs a Coordinate at (0,0,NaN). + + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate at (x,y,NaN). + + X value. + Y value. + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + Tests if another coordinate has the same value for X and Y, within a tolerance. + + A . + The tolerance value. + true if the X and Y ordinates are within the given tolerance. + The Z ordinate is ignored. + + + + Returns true if other has the same values for the x and y ordinates. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + + Coordinate with which to do the comparison. + true if other is a Coordinate with the same values for the x and y ordinates. + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if + has the same values for X, Y and Z. + + A with which to do the 3D comparison. + + true if is a + with the same values for X, Y and Z. + + + + + Tests if another coordinate has the same value for Z, within a tolerance. + + A . + The tolerance value. + true if the Z ordinates are within the given tolerance. + + + + Returns a string of the form (x,y,z) . + + string of the form (x,y,z) + + + + Create a new object as copy of this instance. + + + + + + Computes the 2-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations. + The Z-ordinate is ignored. + + + + Computes the 3-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 3-dimensional Euclidean distance between the locations. + + + + Gets a hashcode for this coordinate. + + A hashcode for this coordinate. + + + + Computes a hash code for a double value, using the algorithm from + Joshua Bloch's book Effective Java" + + A hashcode for the double value + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if other has the same values for x, y and z. + + Coordinate with which to do the 3D comparison. + true if other is a Coordinate with the same values for x, y and z. + + + + Computes the 2-dimensional Euclidean distance to another location. + The Z-ordinate is ignored. + + Coordinate with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations + + + + Gets or sets the ordinate value for the given index. + The supported values for the index are + , and . + + The ordinate index + The ordinate value + Thrown if is not in the valid range. + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + X coordinate. + + + + + Y coordinate. + + + + + Z coordinate. + + + + + The measure value + + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + Gets/Sets the ordinate value for a given index + + The index of the ordinate + The ordinate value + + + + Defines a rectangular region of the 2D coordinate plane. + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + Defines a rectangular region of the 2D coordinate plane. + + + + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + + + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + + + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + + Returns if the point specified by and is contained by the envelope. + + The x-ordinate + The y-ordinate + True if the point is contained by the envlope + + + + Returns if the point specified by is contained by the envelope. + + The point + True if the point is contained by the envlope + + + + Returns if the envelope specified by is contained by this envelope. + + The envelope to test + True if the other envelope is contained by this envlope + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Method to initialize the envelope. Calling this function will result in returning true + + + + + Method to initialize the envelope with a . Calling this function will result in an envelope having no extent but a location. + + The point + + + + Method to initialize the envelope. Calling this function will result in an envelope having the same extent as . + + The envelope + + + + Method to initialize the envelope with two s. + + The first point + The second point + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Makes this Envelope a "null" envelope.. + + + + + Gets the area of the envelope + + + + + Gets the width of the envelope + + + + + Gets the height of the envelope + + + + + Gets the maximum x-ordinate of the envelope + + + + + Gets the maximum y-ordinate of the envelope + + + + + Gets the minimum x-ordinate of the envelope + + + + + Gets the mimimum y-ordinate of the envelope + + + + + Gets the or the center of the envelope + + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Interface describing objects that can perform an intersects predicate with objects. + + The type of the component that can intersect + + + + Predicate function to test if intersects with this object. + + The object to test + true if this objects intersects with + + + + Interface describing objects that can expand themselves by objects of type . + + The type of objects that can expand clients + + + + Method to expand this object by + + The object to expand with + + + + Function to expand compute a new object that is this object by expanded by . + + The object to expand with + The expanded object + + + + Test the point q to see whether it intersects the Envelope + defined by p1-p2. + + One extremal point of the envelope. + Another extremal point of the envelope. + Point to test for intersection. + true if q intersects the envelope p1-p2. + + + + Tests whether the envelope defined by p1-p2 + and the envelope defined by q1-q2 + intersect. + + One extremal point of the envelope Point. + Another extremal point of the envelope Point. + One extremal point of the envelope Q. + Another extremal point of the envelope Q. + true if Q intersects Point + + + + Creates a null Envelope. + + + + + Creates an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Creates an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Creates an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Create an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Makes this Envelope a "null" envelope.. + + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Use Intersects instead. + + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + + + + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Creates a new object that is a copy of the current instance. + + A new object that is a copy of this instance. + + + + Creates a deep copy of the current envelope. + + + + + + Calculates the union of the current box and the given point. + + + + + Calculates the union of the current box and the given coordinate. + + + + + Calculates the union of the current box and the given box. + + + + + Moves the envelope to the indicated coordinate. + + The new centre coordinate. + + + + Moves the envelope to the indicated point. + + The new centre point. + + + + Resizes the envelope to the indicated point. + + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre point. + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre coordinate. + The new width. + The new height. + + + + Zoom the box. + Possible values are e.g. 50 (to zoom in a 50%) or -50 (to zoom out a 50%). + + + Negative do Envelope smaller. + Positive do Envelope bigger. + + + perCent = -50 compact the envelope a 50% (make it smaller). + perCent = 200 enlarge envelope by 2. + + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Method to parse an envelope from its value + + The envelope string + The envelope + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Returns the difference between the maximum and minimum x values. + + max x - min x, or 0 if this is a null Envelope. + + + + Returns the difference between the maximum and minimum y values. + + max y - min y, or 0 if this is a null Envelope. + + + + Returns the Envelopes minimum x-value. min x > max x + indicates that this is a null Envelope. + + The minimum x-coordinate. + + + + Returns the Envelopes maximum x-value. min x > max x + indicates that this is a null Envelope. + + The maximum x-coordinate. + + + + Returns the Envelopes minimum y-value. min y > max y + indicates that this is a null Envelope. + + The minimum y-coordinate. + + + + Returns the Envelopes maximum y-value. min y > max y + indicates that this is a null Envelope. + + The maximum y-coordinate. + + + + Gets the area of this envelope. + + The area of the envelope, or 0.0 if envelope is null + + + + Gets the minimum extent of this envelope across both dimensions. + + + + + + Gets the maximum extent of this envelope across both dimensions. + + + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Gets the item that is bounded + + + + + An interface for classes which use the values of the coordinates in a . + Coordinate filters can be used to implement centroid and + envelope computation, and many other functions. + ICoordinateFilter is + an example of the Gang-of-Four Visitor pattern. + + Note: it is not recommended to use these filters to mutate the coordinates. + There is no guarantee that the coordinate is the actual object stored in the geometry. + In particular, modified values may not be preserved if the target Geometry uses a non-default . + If in-place mutation is required, use . + + + + + + + Performs an operation with or on coord. + + Coordinate to which the filter is applied. + + + + The internal representation of a list of coordinates inside a Geometry. + + This allows Geometries to store their + points using something other than the NTS class. + For example, a storage-efficient implementation + might store coordinate sequences as an array of x's + and an array of y's. + Or a custom coordinate class might support extra attributes like M-values. + + + Implementing a custom coordinate storage structure + requires implementing the and + interfaces. + To use the custom CoordinateSequence, create a + new parameterized by the CoordinateSequenceFactory + The can then be used to create new s. + The new Geometries will use the custom CoordinateSequence implementation. + + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + A copy of the i'th coordinate in the sequence + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + At least the first two dimensions must be copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + The value of the X ordinate in the index'th coordinate. + + + + Returns ordinate Y (1) of the specified coordinate. + + + The value of the Y ordinate in the index'th coordinate. + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + + If the sequence does not provide value for the required ordinate, the implementation must not throw an exception, it should return . + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The ordinate value, or if the sequence does not provide values for "/> + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + + If the sequence can't store the ordinate value, the implementation must not throw an exception, it should simply ignore the call. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. Note that + if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + Returns the kind of ordinates this sequence supplys. . + + + + + Returns the number of coordinates in this sequence. + + + + + An object that knows how to build a particular implementation of + ICoordinateSequence from an array of Coordinates. + + + + + + Returns a based on the given array; + whether or not the array is copied is implementation-dependent. + + A coordinates array, which may not be null nor contain null elements + A coordinate sequence. + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + If the requested dimension is larger than the CoordinateSequence implementation + can provide, then a sequence of maximum possible dimension should be created. + An error should not be thrown. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, and can be set. + + A coordinate sequence. + + + + Gets the Ordinate flags that sequences created by this factory can maximal cope with. + + + + + An interface for classes which process the coordinates in a . + A filter can either record information about each coordinate, + or change the value of the coordinate. + Filters can be + used to implement operations such as coordinate transformations, centroid and + envelope computation, and many other functions. + classes support the concept of applying a + CoordinateSequenceFilter to each + s they contain. + + For maximum efficiency, the execution of filters can be short-circuited by using the property. + + + + CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern. + Note: In general, it is preferable to treat Geometrys as immutable. + Mutation should be performed by creating a new Geometry object (see + and for convenient ways to do this). + An exception to this rule is when a new Geometry has been created via . + In this case mutating the Geometry will not cause aliasing issues, + and a filter is a convenient way to implement coordinate transformation. + + + Martin Davis + + + + + + + Performs an operation on a coordinate in a . + + the CoordinateSequence to which the filter is applied + i the index of the coordinate to apply the filter to + + + + Reports whether the application of this filter can be terminated. + + + Once this method returns false, it should + continue to return false on every subsequent call. + + + + + Reports whether the execution of this filter has modified the coordinates of the geometry. + If so, will be executed + after this filter has finished being executed. + + Most filters can simply return a constant value reflecting whether they are able to change the coordinates. + + + + Geometry classes support the concept of applying + an IGeometryComponentFilter filter to the Geometry. + + + The filter is applied to every component of the Geometry + which is itself a Geometry + and which does not itself contain any components. + (For instance, all the LinearRings in Polygons are visited, + but in a MultiPolygon the Polygons themselves are not visited.) + Thus the only classes of Geometry which must be + handled as arguments to + are s, s and s. + An IGeometryComponentFilter filter can either + record information about the Geometry + or change the Geometry in some way. + IGeometryComponentFilter is an example of the Gang-of-Four Visitor pattern. + > + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned. + If geomList contains several Polygons, a + MultiPolygon is returned. + If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned. + If geomList is empty, an empty GeometryCollection + is returned. + + The Geometry to combine. + + A Geometry of the "smallest", "most type-specific" + class that can contain the elements of geomList. + + + + + Returns a clone of g based on a CoordinateSequence created by this + GeometryFactory's CoordinateSequenceFactory. + + + + + Creates a Point using the given Coordinate; a null Coordinate will create + an empty Geometry. + + The coordinate + A Point + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + The coordiante sequence. + A Point + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LinearRing using the given Coordinates; a null or empty array will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence possibly empty, or null. + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + Geometries, each of which may be empty but not null. + + + + Creates a with the same extent as the given envelope. + + + + + Gets the coordinate sequence factory to use when creating geometries. + + + + + Gets the spatial reference id to assign when creating geometries + + + + + Gets the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + GeometryCollection classes support the concept of + applying a IGeometryFilter to the Geometry. + The filter is applied to every element Geometry. + A IGeometryFilter can either record information about the Geometry + or change the Geometry in some way. + IGeometryFilter is an example of the Gang-of-Four Visitor pattern. + + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components which are s. + + Martin Davis + + + + + + Interface for basic implementation of Geometry. + + + + + Gets an array of ordinate values. + + + + + Gets the geometry at the given index + + A method moved in IGeometry + The index of the geometry to get + A geometry that is part of the + + + + Normalizes this geometry + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Gets the Well-Known-Binary representation of this geometry + + A byte array describing this geometry + + + + Gets the Well-Known-Text representation of this geometry + + A text describing this geometry + + + + Computes the convex hull for this geometry + + The convex hull + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS equals predicate. + + A geometry + true if this geometry is topologically equal to + + + + Tests whether two geometries are exactly equal + in their normalized forms. + > + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + + + + + + Returns the minimum distance between this Geometry + and the Geometry g. + + The Geometry from which to compute the distance. + + + + Performs an operation with or on this Geometry's + coordinates. If you are using this method to modify the point, be sure + to call afterwards. + Note that you cannot use this method to modify this Geometry + if its underlying 's Get method + returns a copy of the , rather than the actual + Coordinate stored (if it even stores Coordinates at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + If this method modifies any coordinate values, must be called to update the geometry state. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + Notifies this geometry that its coordinates have been changed by an external + party (using a CoordinateFilter, for example). The Geometry will flush + and/or update any information it has cached (such as its ). + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When is called, this method will be called for + this Geometry and its component geometries. + + + + + The used to create this geometry + + + + + The the used to create this. + + + + + Gets the spatial reference id + + + + + Gets the geometry type + + + + + Gets the OGC geometry type + + + + + Gets the area of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the length of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the number of geometries that make up this geometry + + + A method moved in IGeometry + + + + + Get the number of coordinates, that make up this geometry + + A method moved to IGeometry + + + + Gets the boundary geometry + + + + + Gets the of the boundary + + + + + Gets the centroid of the geometry + + A property moved in IGeometry + + + + Gets a that is guaranteed to be part of the geometry, usually the first. + + + + + Gets an array of s that make up this geometry. + + + + + Gets the of this geometry + + + + + Gets the envelope this would fit into. + + + + + Gets the envelope this would fit into. + + + + + Gets a point that is ensured to lie inside this geometry. + + + + + A ISurface method moved in IGeometry + + + + + Gets or sets the user data associated with this geometry + + + + + Structure for a closed 1-dimensional ℝ-interval + + + + + The lower bound of the interval + + + + + The upper bound of the interval + + + + + Initializes this structure with = = + + The value for min and max + + + + Initializes this structure with and values + + The minimum interval values + The maximum interval values + + + + Method to expand + + + + + + + + + + + + + + + + + + + Function to compute an interval that contains this and + + The interval + An interval + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval ℝ[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval ℝ[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval ℝ[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Function to test if this intersects the interval . + + + + true if this interval intersects + + + + Function to test if this intersects the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval intersects the interval ℝ[, ]. + + + + Creates an empty or uninitialzed Interval + + An empty or uninitialized + + + + Creates an interval with the range ℝ[,] + + The value + An + + + + Creates an interval with the range ℝ[,].
+ If necessary, val1 and val2 are exchanged. +
+ The minimum value + The maximum value + An +
+ + + Creates an interval with the range ℝ[,]. + + The template interval + An + + + + Equality operator for s + + The left-hand-side + The right-hand-side + true if the s are equal. + + + + Inequality operator for s + + The left-hand-side + The right-hand-side + true if the s are not equal. + + + + Gets a value if this interval is empty/undefined + + + + + Gets a value indicating the width of the + + + + + Gets a value indicating the centre of the interval (Min + Width * 0.5) + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that are s. + + Martin Davis + + + + + + + + + + + Floating precision corresponds to the standard + double-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Floating single precision corresponds to the standard + single-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Fixed Precision indicates that coordinates have a fixed number of decimal places. + The number of decimal places is determined by the log10 of the scale factor. + + + + + Interface for classes specifying the precision model of the Coordinates in a IGeometry. + In other words, specifies the grid of allowable points for all IGeometrys. + + + + + Function to compute a precised value of + + The value to precise + The precised value + + + + Method to precise . + + The coordinate to precise + + + + Gets a value indicating the precision model type + + + + + Gets a value indicating if this precision model has floating precision + + + + + Gets a value indicating the maximum precision digits + + + + + Gets a value indicating the scale factor of a fixed precision model + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that ar s. + + Martin Davis + + + + + + Interface for surfaces + + + + + Interface for a curve + + + + + Gets a value indicating the sequence of coordinates that make up curve + + + + + Gets a value indicating the start point of the curve + + + + + Gets a value indicating the end point of the curve + + + + + Gets a value indicating that the curve is closed. + In this case an are equal. + + + + + Gets a value indicating that the curve is a ring. + + + + + Gets a value indicating whether this ring is oriented counter-clockwise. + + + + + Provides constants representing the dimensions of a point, a curve and a surface. + + + Also provides constants representing the dimensions of the empty geometry and + non-empty geometries, and the wildcard constant meaning "any dimension". + These constants are used as the entries in s. + + + + + Dimension value of a point (0). + + + + + Dimension value of a curve (1). + + + + + Dimension value of a surface (2). + + + + + Dimension value of a empty point (-1). + + + + + Dimension value of non-empty geometries (= {Point,Curve,A}). + + + + + Dimension value for any dimension (= {False, True}). + + + + + Class containing static methods for conversions + between dimension values and characters. + + + + + Symbol for the FALSE pattern matrix entry + + + + + Symbol for the TRUE pattern matrix entry + + + + + Symbol for the DONTCARE pattern matrix entry + + + + + Symbol for the P (dimension 0) pattern matrix entry + + + + + Symbol for the L (dimension 1) pattern matrix entry + + + + + Symbol for the A (dimension 2) pattern matrix entry + + + + + Converts the dimension value to a dimension symbol, + for example, True => 'T' + + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + + + + Converts the dimension symbol to a dimension value, + for example, '*' => Dontcare + + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + + + + Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. + + + + DE-9IM matrices (such as "212FF1FF2") + specify the topological relationship between two s. + This class can also represent matrix patterns (such as "T*T******") + which are used for matching instances of DE-9IM matrices. + + + Methods are provided to: + + Set and query the elements of the matrix in a convenient fashion. + Convert to and from the standard string representation (specified in SFS Section 2.1.13.2). + Test to see if a matrix matches a given pattern string. + + + For a description of the DE-9IM and the spatial predicates derived from it, see the + OGC 99-049 OpenGIS Simple Features Specification for SQL. as well as + OGC 06-103r4 OpenGIS + Implementation Standard for Geographic information - + Simple feature access - Part 1: Common architecture + (which provides some further details on certain predicate specifications). + + The entries of the matrix are defined by the constants in the enum. + The indices of the matrix represent the topological locations + that occur in a geometry (Interior, Boundary, Exterior). + These are provided as constants in the enum. + + + + + + Internal representation of this . + + + + + Creates an with null location values. + + + + + Creates an with the given dimension + symbols. + + A string of nine dimension symbols in row major order. + + + + Creates an with the same elements as + other. + + An to copy. + + + + Adds one matrix to another. + Addition is defined by taking the maximum dimension value of each position + in the summand matrices. + + The matrix to add. + + + + Tests if the dimension value matches TRUE + (i.e. has value 0, 1, 2 or TRUE). + + A number that can be stored in the IntersectionMatrix. + Possible values are {, , , , , } + true if the dimension value matches + + + + Tests if the dimension value satisfies the dimension symbol. + + + a number that can be stored in the IntersectionMatrix. + Possible values are {True, False, Dontcare, 0, 1, 2}. + + + A character used in the string + representation of an . + Possible values are T, F, * , 0, 1, 2. + + + true if the dimension symbol encompasses the dimension value. + + + + + Tests if each of the actual dimension symbols in a matrix string satisfies the + corresponding required dimension symbol in a pattern string. + + + Nine dimension symbols to validate. + Possible values are T, F, * , 0, 1, 2. + + + Nine dimension symbols to validate + against. Possible values are T, F, * , 0, 1, 2. + + + true if each of the required dimension + symbols encompass the corresponding actual dimension symbol. + + + + + Changes the value of one of this elements. + + + The row of this , + indicating the interior, boundary or exterior of the first + + + The column of this , + indicating the interior, boundary or exterior of the second + + The new value of the element + + + + Changes the elements of this to the + dimension symbols in dimensionSymbols. + + + Nine dimension symbols to which to set this + s elements. Possible values are {T, F, * , 0, 1, 2} + + + + + Changes the specified element to minimumDimensionValue if the element is less. + + + The row of this , + indicating the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + + The dimension value with which to compare the + element. The order of dimension values from least to greatest is + True, False, Dontcare, 0, 1, 2. + + + + + If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue + if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0. + + + + + + + + For each element in this , changes the + element to the corresponding minimum dimension symbol if the element is + less. + + + Nine dimension symbols with which to + compare the elements of this . The + order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2. + + + + + Changes the elements of this to dimensionValue. + + + The dimension value to which to set this + s elements. Possible values True, False, Dontcare, 0, 1, 2}. + + + + + Returns the value of one of this s + elements. + + + The row of this , indicating + the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + The dimension value at the given matrix position. + + + + Returns true if this is FF*FF****. + + + true if the two 's related by + this are disjoint. + + + + + Returns true if isDisjoint returns false. + + + true if the two 's related by + this intersect. + + + + + Returns true if this is + FT*******, F**T***** or F***T****. + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this touch; Returns false + if both s are points. + + + + + Returns true if this is + T*T****** (for a point and a curve, a point and an area or a line + and an area) 0******** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this cross. For this + function to return true, the s must + be a point and a curve; a point and a surface; two curves; or a curve + and a surface. + + + + + Returns true if this is + T*F**F***. + + true if the first is within the second. + + + + Returns true if this is + T*****FF*. + + true if the first contains the second. + + + + Returns true if this is T*****FF* + or *T****FF* or ***T**FF* or ****T*FF*. + + true if the first covers the second + + + + Returns true if this is T*F**F*** + or *TF**F*** or **FT*F*** or **F*TF*** + + true if the first is covered by the second + + + + Tests whether the argument dimensions are equal and + this IntersectionMatrix matches + the pattern T*F**FFF*. + + Note: This pattern differs from the one stated in + Simple feature access - Part 1: Common architecture. + That document states the pattern as TFFFTFFFT. This would + specify that + two identical POINTs are not equal, which is not desirable behaviour. + The pattern used here has been corrected to compute equality in this situation. + + The dimension of the first . + The dimension of the second . + + true if the two s + related by this are equal; the + s must have the same dimension to be equal. + + + + + Returns true if this is + T*T***T** (for two points or two surfaces) + 1*T***T** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this overlap. For this + function to return true, the s must + be two points, two curves or two surfaces. + + + + + Returns whether the elements of this + satisfies the required dimension symbols. + + + Nine dimension symbols with which to + compare the elements of this . Possible + values are {T, F, * , 0, 1, 2}. + + + true if this + matches the required dimension symbols. + + + + + Transposes this IntersectionMatrix. + + This as a convenience, + + + + Returns a nine-character String representation of this . + + + The nine dimension symbols of this + in row-major order. + + + + + See methods Get(int, int) and Set(int, int, int value) + + + + + The location of a relative to a + + + + + DE-9IM row index of the interior of the first point and column index of + the interior of the second point. Location value for the interior of a + point. + + int value = 0; + + + + DE-9IM row index of the boundary of the first point and column index of + the boundary of the second point. Location value for the boundary of a + point. + + int value = 1; + + + + DE-9IM row index of the exterior of the first point and column index of + the exterior of the second point. Location value for the exterior of a + point. + + int value = 2; + + + + Used for uninitialized location values. + + int value = 1; + + + + Utility class for enumeration + + + + + Converts the location value to a location symbol, for example, EXTERIOR => 'e'. + + + Either 'e', 'b', 'i' or '-'. + + + + Standard ordinate index values. + + + + + X Ordinate = 0. + + + + + Y Ordinate = 1. + + + + + Z Ordinate = 2. + + + + + M Ordinate = 3 + + + + + Ordinate at index 2 + + + + + Ordinate at index 3 + + + + + Ordinate at index 4 + + + + + Ordinate at index 5 + + + + + Ordinate at index 6 + + + + + Ordinate at index 7 + + + + + Ordinate at index 8 + + + + + Ordinate at index 9 + + + + + Ordinate at index 10 + + + + + Ordinate at index 11 + + + + + Ordinate at index 12 + + + + + Ordinate at index 13 + + + + + Ordinate at index 14 + + + + + Ordinate at index 15 + + + + + Ordinate at index 16 + + + + + Ordinate at index 17 + + + + + Ordinate at index 18 + + + + + Ordinate at index 19 + + + + + Ordinate at index 20 + + + + + Ordinate at index 21 + + + + + Ordinate at index 22 + + + + + Ordinate at index 23 + + + + + Ordinate at index 24 + + + + + Ordinate at index 25 + + + + + Ordinate at index 26 + + + + + Ordinate at index 27 + + + + + Ordinate at index 28 + + + + + Ordinate at index 29 + + + + + Ordinate at index 30 + + + + + Ordinate at index 31 + + + + + Ordinate at index 32 + + + + + Flags for Ordinate values + + + + + No ordinates + + + + + Flag for the x-ordinate + + + + + Flag for the y-ordinate + + + + + Flag for both x- and y-ordinate + + + + + Flag for the z-ordinate + + + + + Flag for x-, y- and z-ordinate + + + + + Flag for the m-ordinate + + + + + Flag for x-, y- and m-ordinate + + + + + Flag for x-, y-, z- and m-ordinate + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 10 + + + + + Flag for ordinate at index 11 + + + + + Flag for ordinate at index 12 + + + + + Flag for ordinate at index 13 + + + + + Flag for ordinate at index 14 + + + + + Flag for ordinate at index 15 + + + + + Flag for ordinate at index 16 + + + + + Flag for ordinate at index 17 + + + + + Flag for ordinate at index 18 + + + + + Flag for ordinate at index 19 + + + + + Flag for ordinate at index 20 + + + + + Flag for ordinate at index 21 + + + + + Flag for ordinate at index 22 + + + + + Flag for ordinate at index 23 + + + + + Flag for ordinate at index 24 + + + + + Flag for ordinate at index 25 + + + + + Flag for ordinate at index 26 + + + + + Flag for ordinate at index 27 + + + + + Flag for ordinate at index 28 + + + + + Flag for ordinate at index 29 + + + + + Flag for ordinate at index 30 + + + + + Flag for ordinate at index 31 + + + + + Flag for ordinate at index 32 + + + + + An interface for classes which prepare s + in order to optimize the performance of repeated calls to specific geometric operations. + + + + A given implementation may provide optimized implementations + for only some of the specified methods, and delegate the remaining + methods to the original operations. + + + An implementation may also only optimize certain situations, and delegate others. + See the implementing classes for documentation about which methods and situations + they optimize. + + Subclasses are intended to be thread-safe, to allow IPreparedGeometry + to be used in a multi-threaded context + (which allows extracting maximum benefit from the prepared state). + + + Martin Davis + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + + + + Tests whether the base contains a given geometry. + + + + The ContainsProperly predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry's interior. + The DE-9IM Intersection Matrix for the two geometries matches >[T**FF*FF*] + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + + + An example use case for this predicate is computing the intersections + of a set of geometries with a large polygonal geometry. + Since intersection is a fairly slow operation, it can be more efficient + to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection + known a priori to be simply the original test geometry. + + + The geometry to test + true if this geometry properly contains the given geometry + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + + + + Tests whether the base is disjoint from given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry is disjoint from the given geometry + + + + + Tests whether the base intersects a given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry intersects the given geometry + + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + + + + Gets the original which has been prepared. + + + + + Static class that provides access to a class. + + + + + Gets or sets the instance. + + + + + Interface for classes that provide access to coordinate system and tranformation facilities. + + + + + Returns the coordinate system by identifier + + The initialization for the coordinate system + The coordinate system. + + + + Returns the coordinate system by and . + + The authority for the coordinate system + The code assigned to the coordinate system by . + The coordinate system. + + + + Method to get the identifier, by which this coordinate system can be accessed. + + The authority name + The code assigned by + The identifier or null + + + + Method to create a coordinate tranformation between two spatial reference systems, defined by their identifiers + + This is a convenience function for . + The identifier for the source spatial reference system. + The identifier for the target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Method to create a coordinate tranformation between two spatial reference systems + + The source spatial reference system. + The target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Delegate function to get a coordinate system from a given initialization string + + The initialization string + The type of the coordinate sytem. + + + + An interface for classes that offer access to geometry creating facillities. + + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Creates a new geometry factory, using , and . + + The geometry factory + + + + Creates a geometry fractory using and . + + + The geometry factory + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The spatial reference id. + The geometry factory. + + + + Creates a geometry factory using the given , + and . + + The coordinate sequence factory to use. + The spatial reference id. + The coordinate sequence factory. + The geometry factory. + + + + Reads the configuration from the configuration + + + + + Writes the current configuration to the configuration + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Byte order + + + + + BigEndian + + + + + LittleEndian + + + + + Lightweight class that handles OGC Geometry type declaration + + + + + Initializes this instance + + The value describing the + + + + Inititalizes this instance based on a geometry and an Ordinates flag. + + The geometry. + The ordinates flag. + + + + Inititalizes this instance based on an + + The OGC geometry type + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + Indicator if a SRID is supplied. + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + The ordinates flag. + Indicator if a SRID is supplied. + + + + Gets or sets the base geometry type + + + + + Gets the OGC Well-Known-Binary type code + + + + + Gets the PostGIS Enhanced Well-Known-Binary type code + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets whether SRID value is stored along with the geometry. + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Interface for a coordinate buffer + + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Sets a m-value at the provided + + The index + The value + + + + Sets a z-value at the provided + + The index + The value + + + + Converts the contents of this to a . +
Optionally you may assign a factory to create the sequence +
+ The factory to use in order to create the sequence. + A coordinate sequence +
+ + + Gets the (current) capacity of the buffer + + + + + Gets the (current) number of coordinates in the buffer + + + + + Base interface for geometry reader or writer interfaces. + + + + + Gets or sets whether the SpatialReference ID must be handled. + + + + + Gets and flag that indicate which ordinates can be handled. + + + This flag must always return at least . + + + + + Gets and sets flag that indicate which ordinates shall be handled. + + + No matter which flag you supply, are always processed, + the rest is binary and 'ed with . + + + + + Interface for binary output of instances. + + The type of the output to produce. + + + + Writes a binary representation of a given geometry. + + The geometry + The binary representation of + + + + Writes a binary representation of a given geometry. + + + + + + + Interface for binary output of instances. + + + + + Gets or sets the desired + + + + + Interface for textual output of instances. + + + + + Interface for input/parsing of instances. + + The type of the source to read from. + + + + Reads a geometry representation from a to a Geometry. + + + The source to read the geometry from + For WKT is string, + for WKB is byte[], + + + A Geometry + + + + + Reads a geometry representation from a to a Geometry. + + The stream to read from. + A Geometry + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Interface for textual input of instances. + + + + + Interface for binary input of instances. + + + + + Enumeration of OGC Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + CircularString + + + + + CompoundCurve + + + + + CurvePolygon + + + + + MultiCurve + + + + + MultiSurface + + + + + Curve + + + + + Surface + + + + + PolyhedralSurface + + + + + TIN + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Creates a ParseException with s detail message + + + The inner exception + + + + Buffer style. + + + + + Specifies a round line buffer end cap endCapStyle (Default). + / + + + + Specifies a butt (or flat) line buffer end cap endCapStyle. + + + + + Specifies a square line buffer end cap endCapStyle. + + + + + End cap style constants + + + + + Specifies a round line buffer end cap style. + + + + + Specifies a flat line buffer end cap style. + + + + + Specifies a square line buffer end cap style. + + + + + An interface for classes that control the parameters for the buffer building process + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + + + + Gets/Sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + qs >>= 1joins are round, and qs indicates the number of segments to use to approximate a quarter-circle. + qs = 0joins are beveled + qs < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |qs| + + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , , and . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Gets or sets the factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + Join style constants + + + + + Specifies a round join style. + + + + + Specifies a mitre join style. + + + + + Specifies a bevel join style. + + + + + Static utility functions for dealing with and dimension + + + + + Translates the -flag to a number of dimensions. + + The ordinates flag + The number of dimensions + + + + Translates a dimension value to an -flag. + + The flag for is set first. + The dimension. + The ordinates-flag + + + + Converts an encoded flag to an array of indices. + + The ordinate flags + The maximum oridinate flag that is to be checked + The ordinate indices + + + + Converts an array of values to an flag. + + An array of values + An flag. + +
+
Index: packages/GeoAPI.1.7.4/lib/net403-client/GeoAPI.dll =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/net403-client/GeoAPI.xml =================================================================== diff -u --- packages/GeoAPI.1.7.4/lib/net403-client/GeoAPI.xml (revision 0) +++ packages/GeoAPI.1.7.4/lib/net403-client/GeoAPI.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,5702 @@ + + + + GeoAPI + + + + + Details of axis. This is used to label axes, and indicate the orientation. + + + + + Initializes a new instance of an AxisInfo. + + Name of axis + Axis orientation + + + + Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string. + + + + + Gets enumerated value for orientation. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Orientation of axis. Some coordinate systems use non-standard orientations. + For example, the first axis in South African grids usually points West, + instead of East. This information is obviously relevant for algorithms + converting South African grid coordinates into Lat/Long. + + + + + Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems. + + + + + Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude. + + + + + Increasing ordinates values go South. This is rarely used. + + + + + Increasing ordinates values go East. This is rarely used. + + + + + Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude. + + + + + Increasing ordinates values go up. This is used for vertical coordinate systems. + + + + + Increasing ordinates values go down. This is used for vertical coordinate systems. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) through + the equation: H=h-N. + + + + + Lowest possible value for horizontal datum types + + + + + Unspecified horizontal datum type. Horizontal datums with this type should never + supply a conversion to WGS84 using Bursa Wolf parameters. + + + + + These datums, such as ED50, NAD27 and NAD83, have been designed to support + horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent. + + + + + A geocentric datum is a "satellite age" modern geodetic datum mainly of global + extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These + datums were designed to support both a horizontal component of position and + a vertical component of position (through ellipsoidal heights). The regional + realizations of ITRF, such as ETRF, are also included in this category. + + + + + Highest possible value for horizontal datum types. + + + + + Lowest possible value for vertical datum types. + + + + + Unspecified vertical datum type. + + + + + A vertical datum for orthometric heights that are measured along the plumb line. + + + + + A vertical datum for ellipsoidal heights that are measured along the normal to + the ellipsoid used in the definition of horizontal datum. + + + + + The vertical datum of altitudes or heights in the atmosphere. These are + approximations of orthometric heights obtained with the help of a barometer or + a barometric altimeter. These values are usually expressed in one of the + following units: meters, feet, millibars (used to measure pressure levels), or + theta value (units used to measure geopotential height). + + + + + A normal height system. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) + through the equation: H=h-N. + + + + + This attribute is used to support the set of datums generated for hydrographic + engineering projects where depth measurements below sea level are needed. It is + often called a hydrographic or a marine datum. Depths are measured in the + direction perpendicular (approximately) to the actual equipotential surfaces of + the earth's gravity field, using such procedures as echo-sounding. + + + + + Highest possible value for vertical datum types. + + + + + Lowest possible value for local datum types. + + + + + Highest possible value for local datum types. + + + + + The IAngularUnit interface defines methods on angular units. + + + + + The IUnit interface abstracts different kinds of units, it has no methods. + + + + + The ISpatialReferenceInfo interface defines the standard + information stored with spatial reference objects. This + interface is reused for many of the spatial reference + objects in the system. + + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Gets or sets the name of the object. + + + + + Gets or sets the authority name for this object, e.g., “POSC”, + is this is a standard object with an authority specific + identity code. Returns “CUSTOM” if this is a custom object. + + + + + Gets or sets the authority specific identification code of the object + + + + + Gets or sets the alias of the object. + + + + + Gets or sets the abbreviation of the object. + + + + + Gets or sets the provider-supplied remarks for the object. + + + + + Returns the Well-known text for this spatial reference object + as defined in the simple features specification. + + + + + Gets an XML representation of this object. + + + + + Gets or sets the number of radians per angular unit. + + + + + An aggregate of two coordinate systems (CRS). One of these is usually a + CRS based on a two dimensional coordinate system such as a geographic or + a projected coordinate system with a horizontal datum. The other is a + vertical CRS which is a one-dimensional coordinate system with a vertical + datum. + + + + + Base interface for all coordinate systems + + + A coordinate system is a mathematical space, where the elements of the space are called + positions. Each position is described by a list of numbers. The length of the list corresponds + to the dimension of the coordinate system. So in a 2D coordinate system each position is + described by a list containing 2 numbers. + + However, in a coordinate system, not all lists of numbers correspond to a position - + some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon + coordinate system, the list (91,91) does not correspond to a position. + + Some coordinate systems also have a mapping from the mathematical space into locations + in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) + corresponds to a location on the surface of the Earth. This mapping from the mathematical + space into real-world locations is called a Datum. + + + + + Gets axis details for dimension within coordinate system. + + Dimension + Axis info + + + + Gets units for dimension within coordinate system. + + + + + Dimension of the coordinate system. + + + + + Gets default envelope of coordinate system. + + + Gets default envelope of coordinate system. Coordinate systems + which are bounded should return the minimum bounding box of their + domain. Unbounded coordinate systems should return a box which is + as large as is likely to be used. For example, a (lon,lat) + geographic coordinate system in degrees should return a box from + (-180,-90) to (180,90), and a geocentric coordinate system could + return a box from (-r,-r,-r) to (+r,+r,+r) where r is the + approximate radius of the Earth. + + + + + Gets first sub-coordinate system. + + + + + Gets second sub-coordinate system. + + + + + Creates spatial reference objects using codes. + + + The codes are maintained by an external authority. A commonly used authority is EPSG, which is also used in the GeoTIFF standard and in SharpMap. + + + + + Returns a projected coordinate system object corresponding to the given code. + + The identification code. + The projected coordinate system object with the given code. + + + + Returns a geographic coordinate system object corresponding to the given code. + + The identification code. + The geographic coordinate system object with the given code. + + + + Returns a horizontal datum object corresponding to the given code. + + The identification code. + The horizontal datum object with the given code. + + + + Returns an ellipsoid object corresponding to the given code. + + The identification code. + The ellipsoid object with the given code. + + + + Returns a prime meridian object corresponding to the given code. + + The identification code. + The prime meridian object with the given code. + + + + Returns a linear unit object corresponding to the given code. + + The identification code. + The linear unit object with the given code. + + + + Returns an angular unit object corresponding to the given code. + + The identification code. + The angular unit object for the given code. + + + + Creates a from a code. + + Authority code + Vertical datum for the given code + + + + Create a vertical coordinate system from a code. + + Authority code + + + + + Creates a 3D coordinate system from a code. + + Authority code + Compound coordinate system for the given code + + + + Creates a horizontal co-ordinate system from a code. + The horizontal coordinate system could be geographic or projected. + + Authority code + Horizontal coordinate system for the given code + + + + Gets the Geoid code from a WKT name. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced + by a quoted string, which is used as a key value. This method converts + the key value string into a code recognized by this authority. + + + + + + + Gets the WKT name of a Geoid. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced by + a quoted string, which is used as a key value. This method gets the OGC WKT + key value from a geoid code. + + + + + + + Returns the authority name for this factory (e.g., "EPSG" or "POSC"). + + + + + Gets a description of the object corresponding to a code. + + + + + Builds up complex objects from simpler objects or values. + + + ICoordinateSystemFactory allows applications to make coordinate systems that + cannot be created by a . This factory is very + flexible, whereas the authority factory is easier to use. + So can be used to make 'standard' coordinate + systems, and can be used to make 'special' + coordinate systems. + For example, the EPSG authority has codes for USA state plane coordinate systems + using the NAD83 datum, but these coordinate systems always use meters. EPSG does not + have codes for NAD83 state plane coordinate systems that use feet units. This factory + lets an application create such a hybrid coordinate system. + + + + + Creates a . + + Name of compound coordinate system. + Head coordinate system + Tail coordinate system + Compound coordinate system + + + + Creates an from radius values. + + + Name of ellipsoid + + + + Ellipsoid + + + + Creates a . + + The units of the axes in the fitted coordinate system will be + inferred from the units of the base coordinate system. If the affine map + performs a rotation, then any mixed axes must have identical units. For + example, a (lat_deg,lon_deg,height_feet) system can be rotated in the + (lat,lon) plane, since both affected axes are in degrees. But you + should not rotate this coordinate system in any other plane. + Name of coordinate system + Base coordinate system + + + Fitted coordinate system + + + + Creates an from an major radius, and inverse flattening. + + + Name of ellipsoid + Semi major-axis + Inverse flattening + Linear unit + Ellipsoid + + + + Creates a coordinate system object from an XML string. + + XML representation for the spatial reference + The resulting spatial reference object + + + + Creates a spatial reference object given its Well-known text representation. + The output object may be either a or + a . + + The Well-known text representation for the spatial reference + The resulting spatial reference object + + + + Creates a , which could be Lat/Lon or Lon/Lat. + + Name of geographical coordinate system + Angular units + Horizontal datum + Prime meridian + First axis + Second axis + Geographic coordinate system + + + + Creates from ellipsoid and Bursa-World parameters. + + + Since this method contains a set of Bursa-Wolf parameters, the created + datum will always have a relationship to WGS84. If you wish to create a + horizontal datum that has no relationship with WGS84, then you can + either specify a horizontalDatumType of , or create it via WKT. + + Name of ellipsoid + Type of datum + Ellipsoid + Wgs84 conversion parameters + Horizontal datum + + + + Creates a local coordinate system. + + + The dimension of the local coordinate system is determined by the size of + the axis array. All the axes will have the same units. If you want to make + a coordinate system with mixed units, then you can make a compound + coordinate system from different local coordinate systems. + + Name of local coordinate system + Local datum + Units + Axis info + Local coordinate system + + + + Creates a . + + Name of datum + Datum type + + + + + Creates a , relative to Greenwich. + + Name of prime meridian + Angular unit + Longitude + Prime meridian + + + + Creates a using a projection object. + + Name of projected coordinate system + Geographic coordinate system + Projection + Linear unit + Primary axis + Secondary axis + Projected coordinate system + + + + Creates a . + + Name of projection + Projection class + Projection parameters + Projection + + + + Creates a from a datum and linear units. + + Name of vertical coordinate system + Vertical datum + Unit + Axis info + Vertical coordinate system + + + + Creates a from an enumerated type value. + + Name of datum + Type of datum + Vertical datum + + + + A set of quantities from which other quantities are calculated. + + + For the OGC abstract model, it can be defined as a set of real points on the earth + that have coordinates. EG. A datum can be thought of as a set of parameters + defining completely the origin and orientation of a coordinate system with respect + to the earth. A textual description and/or a set of parameters describing the + relationship of a coordinate system to some predefined physical locations (such + as center of mass) and physical directions (such as axis of spin). The definition + of the datum may also include the temporal behavior (such as the rate of change of + the orientation of the coordinate axes). + + + + + Gets or sets the type of the datum as an enumerated code. + + + + + The IEllipsoid interface defines the standard information stored with ellipsoid objects. + + + + + Gets or sets the value of the semi-major axis. + + + + + Gets or sets the value of the semi-minor axis. + + + + + Gets or sets the value of the inverse of the flattening constant of the ellipsoid. + + + + + Gets or sets the value of the axis unit. + + + + + Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the + IVF as the defining value, and calculate the polar radius whenever asked. Other + ellipsoids use the polar radius to calculate the IVF whenever asked. This + distinction can be important to avoid floating-point rounding errors. + + + + + A coordinate system which sits inside another coordinate system. The fitted + coordinate system can be rotated and shifted, or use any other math transform + to inject itself into the base coordinate system. + + + + + Gets Well-Known Text of a math transform to the base coordinate system. + The dimension of this fitted coordinate system is determined by the source + dimension of the math transform. The transform should be one-to-one within + this coordinate system's domain, and the base coordinate system dimension + must be at least as big as the dimension of this coordinate system. + + + + + + Gets underlying coordinate system. + + + + + A 3D coordinate system, with its origin at the center of the Earth. + + + + + Returns the HorizontalDatum. The horizontal datum is used to determine where + the centre of the Earth is considered to be. All coordinate points will be + measured from the centre of the Earth, and not the surface. + + + + + Gets the units used along all the axes. + + + + + Returns the PrimeMeridian. + + + + + The IGeodeticSpatialReference interface defines a root interface for all types of geodetic + spatial references, it is a subclass of ICoordinateSystem. + + + + + The IGeographicCoordinateSystem interface is a subclass of IGeodeticSpatialReference and + defines the standard information stored with geographic coordinate system objects. + + + + + A 2D coordinate system suitable for positions on the Earth's surface. + + + + + Returns the HorizontalDatum. + + + + + Gets details on a conversion to WGS84. + + + + + Gets or sets the angular units of the geographic coordinate system. + + + + + Gets or sets the prime meridian of the geographic coordinate system. + + + + + Gets the number of available conversions to WGS84 coordinates. + + + + + The IGeographicTransform interface is implemented on geographic transformation + objects and implements datum transformations between geographic coordinate systems. + + + + + Transforms an array of points from the source geographic coordinate system + to the target geographic coordinate system. + + Points in the source geographic coordinate system + Points in the target geographic coordinate system + + + + Transforms an array of points from the target geographic coordinate system + to the source geographic coordinate system. + + Points in the target geographic coordinate system + Points in the source geographic coordinate system + + + + Gets or sets source geographic coordinate system for the transformation. + + + + + Gets or sets the target geographic coordinate system for the transformation. + + + + + Returns an accessor interface to the parameters for this geographic transformation. + + + + + Procedure used to measure positions on the surface of the Earth. + + + + + Gets or sets the ellipsoid of the datum. + + + + + Gets preferred parameters for a Bursa Wolf transformation into WGS84. The 7 returned values + correspond to (dx,dy,dz) in meters, (ex,ey,ez) in arc-seconds, and scaling in parts-per-million. + + + + + The ILinearUnit interface defines methods on linear units. + + + + + Gets or sets the number of meters per . + + + + + A local coordinate system, with uncertain relationship to the world. + + In general, a local coordinate system cannot be related to other coordinate + systems. However, if two objects supporting this interface have the same dimension, + axes, units and datum then client code is permitted to assume that the two coordinate + systems are identical. This allows several datasets from a common source (e.g. a CAD + system) to be overlaid. In addition, some implementations of the Coordinate + Transformation (CT) package may have a mechanism for correlating local datums. (E.g. + from a database of transformations, which is created and maintained from real-world + measurements.) + + + + + Gets or sets the local datum + + + + + Local datum. If two local datum objects have the same datum type and name, + then they can be considered equal. This means that coordinates can be + transformed between two different local coordinate systems, as long as + they are based on the same local datum. + + + + + The IParameterInfo interface provides an interface through which clients of a + Projected Coordinate System or of a Projection can set the parameters of the + projection. It provides a generic interface for discovering the names and default + values of parameters, and for setting and getting parameter values. Subclasses of + this interface may provide projection specific parameter access methods. + + + + + Returns the default parameters for this projection. + + + + + + Gets the parameter by its name + + + + + + + Gets the number of parameters expected. + + + + + Gets or sets the parameters set for this projection. + + + + + The IPrimeMeridian interface defines the standard information stored with prime + meridian objects. Any prime meridian object must implement this interface as + well as the ISpatialReferenceInfo interface. + + + + + Gets or sets the longitude of the prime meridian (relative to the Greenwich prime meridian). + + + + + Gets or sets the AngularUnits. + + + + + The IProjectedCoordinateSystem interface defines the standard information stored with + projected coordinate system objects. A projected coordinate system is defined using a + geographic coordinate system object and a projection object that defines the + coordinate transformation from the geographic coordinate system to the projected + coordinate systems. The instances of a single ProjectedCoordinateSystem COM class can + be used to model different projected coordinate systems (e.g., UTM Zone 10, Albers) + by associating the ProjectedCoordinateSystem instances with Projection instances + belonging to different Projection COM classes (Transverse Mercator and Albers, + respectively). + + + + + Gets or sets the geographic coordinate system associated with the projected + coordinate system. + + + + + Gets or sets the linear (projected) units of the projected coordinate system. + + + + + Gets or sets the projection for the projected coordinate system. + + + + + The IProjection interface defines the standard information stored with projection + objects. A projection object implements a coordinate transformation from a geographic + coordinate system to a projected coordinate system, given the ellipsoid for the + geographic coordinate system. It is expected that each coordinate transformation of + interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of + coType Projection, supporting the IProjection interface. + + + + + Gets an indexed parameter of the projection. + + Index of parameter + n'th parameter + + + + Gets an named parameter of the projection. + + The parameter name is case insensitive + Name of parameter + parameter or null if not found + + + + Gets number of parameters of the projection. + + + + + Gets the projection classification name (e.g. 'Transverse_Mercator'). + + + + + A one-dimensional coordinate system suitable for vertical measurements. + + + + + Gets the vertical datum, which indicates the measurement method + + + + + Gets the units used along the vertical axis. + + + + + Procedure used to measure vertical distances. + + + + + A named parameter value. + + + + + Creates an instance of a parameter + + Units are always either meters or degrees. + Name of parameter + Value + + + + Parameter name + + + + + Parameter value + + + + + A named projection parameter value. + + + The linear units of parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. (Notice that this is different from , + where the units are always meters and degrees.) + + + + + Initializes an instance of a ProjectionParameter + + Name of parameter + Parameter value + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Parameter name. + + + + + Parameter value. + The linear units of a parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Flags indicating parts of domain covered by a convex hull. + + + These flags can be combined. For example, the value 3 + corresponds to a combination of and , + which means that some parts of the convex hull are inside the + domain, and some parts of the convex hull are outside the domain. + + + + + At least one point in a convex hull is inside the transform's domain. + + + + + At least one point in a convex hull is outside the transform's domain. + + + + + At least one point in a convex hull is not transformed continuously. + + + As an example, consider a "Longitude_Rotation" transform which adjusts + longitude coordinates to take account of a change in Prime Meridian. If + the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not + transformed continuously, since it is on the meridian line which will + be split at +180/-180 degrees. + + + + + Describes a coordinate transformation. This interface only describes a + coordinate transformation, it does not actually perform the transform + operation on points. To transform points you must use a math transform. + + + + + Human readable description of domain in source coordinate system. + + + + + Authority which defined transformation and parameter values. + + + An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is ‘4326’ + + + + + Code used by authority to identify transformation. An empty string is used for no code. + + The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is ‘4326’. + + + + Gets math transform. + + + + + Name of transformation. + + + + + Gets the provider-supplied remarks. + + + + + Source coordinate system. + + + + + Target coordinate system. + + + + + Semantic type of transform. For example, a datum transformation or a coordinate conversion. + + + + + Creates coordinate transformations. + + + + + Creates a transformation between two coordinate systems. + + + This method will examine the coordinate systems in order to construct + a transformation between them. This method may fail if no path between + the coordinate systems is found, using the normal failing behavior of + the DCP (e.g. throwing an exception). + Source coordinate system + Target coordinate system + + + + + Transforms muti-dimensional coordinate points. + + + If a client application wishes to query the source and target coordinate + systems of a transformation, then it should keep hold of the + interface, and use the contained + math transform object whenever it wishes to perform a transform. + + + + + Tests whether this transform does not move any points. + + + + + + Gets the derivative of this transform at a point. If the transform does + not have a well-defined derivative at the point, then this function should + fail in the usual way for the DCP. The derivative is the matrix of the + non-translating portion of the approximate affine map at the point. The + matrix will have dimensions corresponding to the source and target + coordinate systems. If the input dimension is M, and the output dimension + is N, then the matrix will have size [M][N]. The elements of the matrix + {elt[n][m] : n=0..(N-1)} form a vector in the output space which is + parallel to the displacement caused by a small change in the m'th ordinate + in the input space. + + + + + + + Gets transformed convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which generates a convex + hull in the source space. The returned sequence of ordinates represents a convex hull in the + output space. The number of output points will often be different from the number of input + points. Each of the input points should be inside the valid domain (this can be checked by + testing the points' domain flags individually). However, the convex hull of the input points + may go outside the valid domain. The returned convex hull should contain the transformed image + of the intersection of the source convex hull and the source domain. + A convex hull is a shape in a coordinate system, where if two positions A and B are + inside the shape, then all positions in the straight line between A and B are also inside + the shape. So in 3D a cube and a sphere are both convex hulls. Other less obvious examples + of convex hulls are straight lines, and single points. (A single point is a convex hull, + because the positions A and B must both be the same - i.e. the point itself. So the straight + line between A and B has zero length.) + Some examples of shapes that are NOT convex hulls are donuts, and horseshoes. + + + + + + + Gets flags classifying domain points within a convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which + generates a convex hull in the source space. Conceptually, each of the + (usually infinite) points inside the convex hull is then tested against + the source domain. The flags of all these tests are then combined. In + practice, implementations of different transforms will use different + short-cuts to avoid doing an infinite number of tests. + + + + + + + Creates the inverse transform of this object. + + This method may fail if the transform is not one to one. However, all cartographic projections should succeed. + + + + + Transforms a coordinate point. The passed parameter point should not be modified. + + + + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a list of coordinate point ordinal values. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Transforms a list of coordinates. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Reverses the transformation + + + + + Transforms a coordinate sequence. The input coordinate sequence remains unchanged. + + The coordinate sequence to transform. + The transformed coordinate sequence. + + + + Gets the dimension of input points. + + + + + Gets the dimension of output points. + + + + + Gets a Well-Known text representation of this object. + + + + + Gets an XML representation of this object. + + + + + Creates math transforms. + + + CT_MathTransformFactory is a low level factory that is used to create CT_MathTransform objects. Many high level GIS applications will never need to use a CT_MathTransformFactory directly; they can use a CT_CoordinateTransformationFactory instead. However, the CT_MathTransformFactory interface is specified here, since it can be used directly by applications that wish to transform other types of coordinates (e.g. color coordinates, or image pixel coordinates). + The following comments assume that the same vendor implements the math transform factory interfaces and math transform interfaces. + A math transform is an object that actually does the work of applying formulae to coordinate values. The math transform does not know or care how the coordinates relate to positions in the real world. This lack of semantics makes implementing CT_MathTransformFactory significantly easier than it would be otherwise. + For example CT_MathTransformFactory can create affine math transforms. The affine transform applies a matrix to the coordinates without knowing how what it is doing relates to the real world. So if the matrix scales Z values by a factor of 1000, then it could be converting meters into millimeters, or it could be converting kilometers into meters. + Because math transforms have low semantic value (but high mathematical value), programmers who do not have much knowledge of how GIS applications use coordinate systems, or how those coordinate systems relate to the real world can implement CT_MathTransformFactory. + The low semantic content of math transforms also means that they will be useful in applications that have nothing to do with GIS coordinates. For example, a math transform could be used to map color coordinates between different color spaces, such as converting (red, green, blue) colors into (hue, light, saturation) colors. + Since a math transform does not know what its source and target coordinate systems mean, it is not necessary or desirable for a math transform object to keep information on its source and target coordinate systems. + + + + + Creates an affine transform from a matrix. + + If the transform's input dimension is M, and output dimension is N, then the matrix will have size [N+1][M+1]. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will be the j'th ordinate of the moved origin. The [i][N] element of the matrix will be 0 for i less than M, and 1 for i equals M. + + + + + + Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other. + + The dimension of the output space of the first transform must match the dimension of the input space in the second transform. If you wish to concatenate more than two transforms, then you can repeatedly use this method. + + + + + + + Creates a math transform from a Well-Known Text string. + + + + + + + Creates a math transform from XML. + + + + + + + Creates a transform from a classification name and parameters. + + + The client must ensure that all the linear parameters are expressed in meters, and all the angular parameters are expressed in degrees. Also, they must supply "semi_major" and "semi_minor" parameters for cartographic projection transforms. + + + + + + + + Creates a transform which passes through a subset of ordinates to another transform. + + + This allows transforms to operate on a subset of ordinates. For example, if you have (Lat,Lon,Height) coordinates, then you may wish to convert the height values from meters to feet without affecting the (Lat,Lon) values. If you wanted to affect the (Lat,Lon) values and leave the Height values alone, then you would have to swap the ordinates around to (Height,Lat,Lon). You can do this with an affine map. + + + + + + + + Tests whether parameter is angular. Clients must ensure that all angular parameter values are in degrees. + + + + + + + Tests whether parameter is linear. Clients must ensure that all linear parameter values are in meters. + + + + + + + Semantic type of transform used in coordinate transformation. + + + + + Unknown or unspecified type of transform. + + + + + Transform depends only on defined parameters. For example, a cartographic projection. + + + + + Transform depends only on empirically derived parameters. For example a datum transformation. + + + + + Transform depends on both defined and empirical parameters. + + + + + Parameters for a geographic transformation into WGS84. The Bursa Wolf parameters should be applied + to geocentric coordinates, where the X axis points towards the Greenwich Prime Meridian, the Y axis + points East, and the Z axis points North. + + + These parameters can be used to approximate a transformation from the horizontal datum to the + WGS84 datum using a Bursa Wolf transformation. However, it must be remembered that this transformation + is only an approximation. For a given horizontal datum, different Bursa Wolf transformations can be + used to minimize the errors over different regions. + If the DATUM clause contains a TOWGS84 clause, then this should be its “preferred” transformation, + which will often be the transformation which gives a broad approximation over the whole area of interest + (e.g. the area of interest in the containing geographic coordinate system). + Sometimes, only the first three or six parameters are defined. In this case the remaining + parameters must be zero. If only three parameters are defined, then they can still be plugged into the + Bursa Wolf formulas, or you can take a short cut. The Bursa Wolf transformation works on geocentric + coordinates, so you cannot apply it onto geographic coordinates directly. If there are only three + parameters then you can use the Molodenski or abridged Molodenski formulas. + If a datums ToWgs84Parameters parameter values are zero, then the receiving + application can assume that the writing application believed that the datum is approximately equal to + WGS84. + + + + + Initializes an instance of Wgs84ConversionInfo with default parameters (all values = 0) + + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + Area of use for this transformation + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf scaling in parts per million. + + + + + Human readable text describing intended region of transformation. + + + + + Affine Bursa-Wolf matrix transformation + + + Transformation of coordinates from one geographic coordinate system into another + (also colloquially known as a "datum transformation") is usually carried out as an + implicit concatenation of three transformations: + [geographical to geocentric >> geocentric to geocentric >> geocentric to geographic + + The middle part of the concatenated transformation, from geocentric to geocentric, is usually + described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 + parameters, in what is known as the "Bursa-Wolf" formula:
+ + S = 1 + Ppm/1000000 + [ Xt ] [ S -Ez*S +Ey*S Dx ] [ Xs ] + [ Yt ] = [ +Ez*S S -Ex*S Dy ] [ Ys ] + [ Zt ] [ -Ey*S +Ex*S S Dz ] [ Zs ] + [ 1 ] [ 0 0 0 1 ] [ 1 ] +
+ The parameters are commonly referred to defining the transformation "from source coordinate system + to target coordinate system", whereby (XS, YS, ZS) are the coordinates of the point in the source + geocentric coordinate system and (XT, YT, ZT) are the coordinates of the point in the target + geocentric coordinate system. But that does not define the parameters uniquely; neither is the + definition of the parameters implied in the formula, as is often believed. However, the + following definition, which is consistent with the "Position Vector Transformation" convention, + is common E&P survey practice: +
+ (dX, dY, dZ): Translation vector, to be added to the point's position vector in the source + coordinate system in order to transform from source system to target system; also: the coordinates + of the origin of source coordinate system in the target coordinate system + (RX, RY, RZ): Rotations to be applied to the point's vector. The sign convention is such that + a positive rotation about an axis is defined as a clockwise rotation of the position vector when + viewed from the origin of the Cartesian coordinate system in the positive direction of that axis; + e.g. a positive rotation about the Z-axis only from source system to target system will result in a + larger longitude value for the point in the target system. Although rotation angles may be quoted in + any angular unit of measure, the formula as given here requires the angles to be provided in radians. + : The scale correction to be made to the position vector in the source coordinate system in order + to obtain the correct scale in the target coordinate system. M = (1 + dS*10-6), whereby dS is the scale + correction expressed in parts per million. + for an explanation of the Bursa-Wolf transformation +
+ +
+ + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Indicates whether the current object is equal to another object of the same type. + + + + + + + Returns a hash code for the specified object + + A hash code for the specified object + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Gets an XML representation of this object + + + + + Returns true of all 7 parameter values are 0.0 + + + + + + A lightweight class used to store coordinates on the 2-dimensional Cartesian plane. + + It is distinct from , which is a subclass of . + Unlike objects of type (which contain additional + information such as an envelope, a precision model, and spatial reference + system information), a Coordinate only contains ordinate values + and propertied. + + + Coordinates are two-dimensional points, with an additional Z-ordinate. + If an Z-ordinate value is not specified or not defined, + constructed coordinates have a Z-ordinate of NaN + (which is also the value of ). + + + + Apart from the basic accessor functions, NTS supports + only specific operations involving the Z-ordinate. + + + + + Interface for lightweight classes used to store coordinates on the 2-dimensional Cartesian plane. + + + + + Computes the 2-dimensional distance to the coordiante. + + The other coordinate + The 2-dimensional distance to other + + + + Compares equality for x- and y-ordinates + + The other coordinate + true if x- and y-ordinates of coordinate and coordiante are equal. + + + + Compares equality for x-, y- and z-ordinates + + The other coordinate + true if x-, y- and z-ordinates of coordinate and coordiante are equal. + + + + The x-ordinate value + + + + + The y-ordinate value + + + + + The z-ordinate value + + + + + The measure value + + + + + Gets or sets all ordinate values + + + + + Gets or sets the value of this + + The index + + + + The value used to indicate a null or missing ordinate value. + In particular, used for the value of ordinates for dimensions + greater than the defined dimension of a coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + Constructs a Coordinate at (x,y,z). + + X value. + Y value. + Z value. + + + + Constructs a Coordinate at (0,0,NaN). + + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate at (x,y,NaN). + + X value. + Y value. + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + Tests if another coordinate has the same value for X and Y, within a tolerance. + + A . + The tolerance value. + true if the X and Y ordinates are within the given tolerance. + The Z ordinate is ignored. + + + + Returns true if other has the same values for the x and y ordinates. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + + Coordinate with which to do the comparison. + true if other is a Coordinate with the same values for the x and y ordinates. + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if + has the same values for X, Y and Z. + + A with which to do the 3D comparison. + + true if is a + with the same values for X, Y and Z. + + + + + Tests if another coordinate has the same value for Z, within a tolerance. + + A . + The tolerance value. + true if the Z ordinates are within the given tolerance. + + + + Returns a string of the form (x,y,z) . + + string of the form (x,y,z) + + + + Create a new object as copy of this instance. + + + + + + Computes the 2-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations. + The Z-ordinate is ignored. + + + + Computes the 3-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 3-dimensional Euclidean distance between the locations. + + + + Gets a hashcode for this coordinate. + + A hashcode for this coordinate. + + + + Computes a hash code for a double value, using the algorithm from + Joshua Bloch's book Effective Java" + + A hashcode for the double value + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if other has the same values for x, y and z. + + Coordinate with which to do the 3D comparison. + true if other is a Coordinate with the same values for x, y and z. + + + + Computes the 2-dimensional Euclidean distance to another location. + The Z-ordinate is ignored. + + Coordinate with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations + + + + Gets or sets the ordinate value for the given index. + The supported values for the index are + , and . + + The ordinate index + The ordinate value + Thrown if is not in the valid range. + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + X coordinate. + + + + + Y coordinate. + + + + + Z coordinate. + + + + + The measure value + + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + Gets/Sets the ordinate value for a given index + + The index of the ordinate + The ordinate value + + + + Defines a rectangular region of the 2D coordinate plane. + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + Defines a rectangular region of the 2D coordinate plane. + + + + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + + + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + + + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + + Returns if the point specified by and is contained by the envelope. + + The x-ordinate + The y-ordinate + True if the point is contained by the envlope + + + + Returns if the point specified by is contained by the envelope. + + The point + True if the point is contained by the envlope + + + + Returns if the envelope specified by is contained by this envelope. + + The envelope to test + True if the other envelope is contained by this envlope + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Method to initialize the envelope. Calling this function will result in returning true + + + + + Method to initialize the envelope with a . Calling this function will result in an envelope having no extent but a location. + + The point + + + + Method to initialize the envelope. Calling this function will result in an envelope having the same extent as . + + The envelope + + + + Method to initialize the envelope with two s. + + The first point + The second point + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Makes this Envelope a "null" envelope.. + + + + + Gets the area of the envelope + + + + + Gets the width of the envelope + + + + + Gets the height of the envelope + + + + + Gets the maximum x-ordinate of the envelope + + + + + Gets the maximum y-ordinate of the envelope + + + + + Gets the minimum x-ordinate of the envelope + + + + + Gets the mimimum y-ordinate of the envelope + + + + + Gets the or the center of the envelope + + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Interface describing objects that can perform an intersects predicate with objects. + + The type of the component that can intersect + + + + Predicate function to test if intersects with this object. + + The object to test + true if this objects intersects with + + + + Interface describing objects that can expand themselves by objects of type . + + The type of objects that can expand clients + + + + Method to expand this object by + + The object to expand with + + + + Function to expand compute a new object that is this object by expanded by . + + The object to expand with + The expanded object + + + + Test the point q to see whether it intersects the Envelope + defined by p1-p2. + + One extremal point of the envelope. + Another extremal point of the envelope. + Point to test for intersection. + true if q intersects the envelope p1-p2. + + + + Tests whether the envelope defined by p1-p2 + and the envelope defined by q1-q2 + intersect. + + One extremal point of the envelope Point. + Another extremal point of the envelope Point. + One extremal point of the envelope Q. + Another extremal point of the envelope Q. + true if Q intersects Point + + + + Creates a null Envelope. + + + + + Creates an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Creates an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Creates an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Create an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Makes this Envelope a "null" envelope.. + + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Use Intersects instead. + + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + + + + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Creates a new object that is a copy of the current instance. + + A new object that is a copy of this instance. + + + + Creates a deep copy of the current envelope. + + + + + + Calculates the union of the current box and the given point. + + + + + Calculates the union of the current box and the given coordinate. + + + + + Calculates the union of the current box and the given box. + + + + + Moves the envelope to the indicated coordinate. + + The new centre coordinate. + + + + Moves the envelope to the indicated point. + + The new centre point. + + + + Resizes the envelope to the indicated point. + + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre point. + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre coordinate. + The new width. + The new height. + + + + Zoom the box. + Possible values are e.g. 50 (to zoom in a 50%) or -50 (to zoom out a 50%). + + + Negative do Envelope smaller. + Positive do Envelope bigger. + + + perCent = -50 compact the envelope a 50% (make it smaller). + perCent = 200 enlarge envelope by 2. + + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Method to parse an envelope from its value + + The envelope string + The envelope + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Returns the difference between the maximum and minimum x values. + + max x - min x, or 0 if this is a null Envelope. + + + + Returns the difference between the maximum and minimum y values. + + max y - min y, or 0 if this is a null Envelope. + + + + Returns the Envelopes minimum x-value. min x > max x + indicates that this is a null Envelope. + + The minimum x-coordinate. + + + + Returns the Envelopes maximum x-value. min x > max x + indicates that this is a null Envelope. + + The maximum x-coordinate. + + + + Returns the Envelopes minimum y-value. min y > max y + indicates that this is a null Envelope. + + The minimum y-coordinate. + + + + Returns the Envelopes maximum y-value. min y > max y + indicates that this is a null Envelope. + + The maximum y-coordinate. + + + + Gets the area of this envelope. + + The area of the envelope, or 0.0 if envelope is null + + + + Gets the minimum extent of this envelope across both dimensions. + + + + + + Gets the maximum extent of this envelope across both dimensions. + + + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Gets the item that is bounded + + + + + An interface for classes which use the values of the coordinates in a . + Coordinate filters can be used to implement centroid and + envelope computation, and many other functions. + ICoordinateFilter is + an example of the Gang-of-Four Visitor pattern. + + Note: it is not recommended to use these filters to mutate the coordinates. + There is no guarantee that the coordinate is the actual object stored in the geometry. + In particular, modified values may not be preserved if the target Geometry uses a non-default . + If in-place mutation is required, use . + + + + + + + Performs an operation with or on coord. + + Coordinate to which the filter is applied. + + + + The internal representation of a list of coordinates inside a Geometry. + + This allows Geometries to store their + points using something other than the NTS class. + For example, a storage-efficient implementation + might store coordinate sequences as an array of x's + and an array of y's. + Or a custom coordinate class might support extra attributes like M-values. + + + Implementing a custom coordinate storage structure + requires implementing the and + interfaces. + To use the custom CoordinateSequence, create a + new parameterized by the CoordinateSequenceFactory + The can then be used to create new s. + The new Geometries will use the custom CoordinateSequence implementation. + + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + A copy of the i'th coordinate in the sequence + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + At least the first two dimensions must be copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + The value of the X ordinate in the index'th coordinate. + + + + Returns ordinate Y (1) of the specified coordinate. + + + The value of the Y ordinate in the index'th coordinate. + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + + If the sequence does not provide value for the required ordinate, the implementation must not throw an exception, it should return . + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The ordinate value, or if the sequence does not provide values for "/> + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + + If the sequence can't store the ordinate value, the implementation must not throw an exception, it should simply ignore the call. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. Note that + if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + Returns the kind of ordinates this sequence supplys. . + + + + + Returns the number of coordinates in this sequence. + + + + + An object that knows how to build a particular implementation of + ICoordinateSequence from an array of Coordinates. + + + + + + Returns a based on the given array; + whether or not the array is copied is implementation-dependent. + + A coordinates array, which may not be null nor contain null elements + A coordinate sequence. + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + If the requested dimension is larger than the CoordinateSequence implementation + can provide, then a sequence of maximum possible dimension should be created. + An error should not be thrown. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, and can be set. + + A coordinate sequence. + + + + Gets the Ordinate flags that sequences created by this factory can maximal cope with. + + + + + An interface for classes which process the coordinates in a . + A filter can either record information about each coordinate, + or change the value of the coordinate. + Filters can be + used to implement operations such as coordinate transformations, centroid and + envelope computation, and many other functions. + classes support the concept of applying a + CoordinateSequenceFilter to each + s they contain. + + For maximum efficiency, the execution of filters can be short-circuited by using the property. + + + + CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern. + Note: In general, it is preferable to treat Geometrys as immutable. + Mutation should be performed by creating a new Geometry object (see + and for convenient ways to do this). + An exception to this rule is when a new Geometry has been created via . + In this case mutating the Geometry will not cause aliasing issues, + and a filter is a convenient way to implement coordinate transformation. + + + Martin Davis + + + + + + + Performs an operation on a coordinate in a . + + the CoordinateSequence to which the filter is applied + i the index of the coordinate to apply the filter to + + + + Reports whether the application of this filter can be terminated. + + + Once this method returns false, it should + continue to return false on every subsequent call. + + + + + Reports whether the execution of this filter has modified the coordinates of the geometry. + If so, will be executed + after this filter has finished being executed. + + Most filters can simply return a constant value reflecting whether they are able to change the coordinates. + + + + Geometry classes support the concept of applying + an IGeometryComponentFilter filter to the Geometry. + + + The filter is applied to every component of the Geometry + which is itself a Geometry + and which does not itself contain any components. + (For instance, all the LinearRings in Polygons are visited, + but in a MultiPolygon the Polygons themselves are not visited.) + Thus the only classes of Geometry which must be + handled as arguments to + are s, s and s. + An IGeometryComponentFilter filter can either + record information about the Geometry + or change the Geometry in some way. + IGeometryComponentFilter is an example of the Gang-of-Four Visitor pattern. + > + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned. + If geomList contains several Polygons, a + MultiPolygon is returned. + If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned. + If geomList is empty, an empty GeometryCollection + is returned. + + The Geometry to combine. + + A Geometry of the "smallest", "most type-specific" + class that can contain the elements of geomList. + + + + + Returns a clone of g based on a CoordinateSequence created by this + GeometryFactory's CoordinateSequenceFactory. + + + + + Creates a Point using the given Coordinate; a null Coordinate will create + an empty Geometry. + + The coordinate + A Point + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + The coordiante sequence. + A Point + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LinearRing using the given Coordinates; a null or empty array will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence possibly empty, or null. + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + Geometries, each of which may be empty but not null. + + + + Creates a with the same extent as the given envelope. + + + + + Gets the coordinate sequence factory to use when creating geometries. + + + + + Gets the spatial reference id to assign when creating geometries + + + + + Gets the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + GeometryCollection classes support the concept of + applying a IGeometryFilter to the Geometry. + The filter is applied to every element Geometry. + A IGeometryFilter can either record information about the Geometry + or change the Geometry in some way. + IGeometryFilter is an example of the Gang-of-Four Visitor pattern. + + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components which are s. + + Martin Davis + + + + + + Interface for basic implementation of Geometry. + + + + + Gets an array of ordinate values. + + + + + Gets the geometry at the given index + + A method moved in IGeometry + The index of the geometry to get + A geometry that is part of the + + + + Normalizes this geometry + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Gets the Well-Known-Binary representation of this geometry + + A byte array describing this geometry + + + + Gets the Well-Known-Text representation of this geometry + + A text describing this geometry + + + + Computes the convex hull for this geometry + + The convex hull + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS equals predicate. + + A geometry + true if this geometry is topologically equal to + + + + Tests whether two geometries are exactly equal + in their normalized forms. + > + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + + + + + + Returns the minimum distance between this Geometry + and the Geometry g. + + The Geometry from which to compute the distance. + + + + Performs an operation with or on this Geometry's + coordinates. If you are using this method to modify the point, be sure + to call afterwards. + Note that you cannot use this method to modify this Geometry + if its underlying 's Get method + returns a copy of the , rather than the actual + Coordinate stored (if it even stores Coordinates at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + If this method modifies any coordinate values, must be called to update the geometry state. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + Notifies this geometry that its coordinates have been changed by an external + party (using a CoordinateFilter, for example). The Geometry will flush + and/or update any information it has cached (such as its ). + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When is called, this method will be called for + this Geometry and its component geometries. + + + + + The used to create this geometry + + + + + The the used to create this. + + + + + Gets the spatial reference id + + + + + Gets the geometry type + + + + + Gets the OGC geometry type + + + + + Gets the area of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the length of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the number of geometries that make up this geometry + + + A method moved in IGeometry + + + + + Get the number of coordinates, that make up this geometry + + A method moved to IGeometry + + + + Gets the boundary geometry + + + + + Gets the of the boundary + + + + + Gets the centroid of the geometry + + A property moved in IGeometry + + + + Gets a that is guaranteed to be part of the geometry, usually the first. + + + + + Gets an array of s that make up this geometry. + + + + + Gets the of this geometry + + + + + Gets the envelope this would fit into. + + + + + Gets the envelope this would fit into. + + + + + Gets a point that is ensured to lie inside this geometry. + + + + + A ISurface method moved in IGeometry + + + + + Gets or sets the user data associated with this geometry + + + + + Structure for a closed 1-dimensional ℝ-interval + + + + + The lower bound of the interval + + + + + The upper bound of the interval + + + + + Initializes this structure with = = + + The value for min and max + + + + Initializes this structure with and values + + The minimum interval values + The maximum interval values + + + + Method to expand + + + + + + + + + + + + + + + + + + + Function to compute an interval that contains this and + + The interval + An interval + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval ℝ[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval ℝ[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval ℝ[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Function to test if this intersects the interval . + + + + true if this interval intersects + + + + Function to test if this intersects the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval intersects the interval ℝ[, ]. + + + + Creates an empty or uninitialzed Interval + + An empty or uninitialized + + + + Creates an interval with the range ℝ[,] + + The value + An + + + + Creates an interval with the range ℝ[,].
+ If necessary, val1 and val2 are exchanged. +
+ The minimum value + The maximum value + An +
+ + + Creates an interval with the range ℝ[,]. + + The template interval + An + + + + Equality operator for s + + The left-hand-side + The right-hand-side + true if the s are equal. + + + + Inequality operator for s + + The left-hand-side + The right-hand-side + true if the s are not equal. + + + + Gets a value if this interval is empty/undefined + + + + + Gets a value indicating the width of the + + + + + Gets a value indicating the centre of the interval (Min + Width * 0.5) + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that are s. + + Martin Davis + + + + + + + + + + + Floating precision corresponds to the standard + double-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Floating single precision corresponds to the standard + single-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Fixed Precision indicates that coordinates have a fixed number of decimal places. + The number of decimal places is determined by the log10 of the scale factor. + + + + + Interface for classes specifying the precision model of the Coordinates in a IGeometry. + In other words, specifies the grid of allowable points for all IGeometrys. + + + + + Function to compute a precised value of + + The value to precise + The precised value + + + + Method to precise . + + The coordinate to precise + + + + Gets a value indicating the precision model type + + + + + Gets a value indicating if this precision model has floating precision + + + + + Gets a value indicating the maximum precision digits + + + + + Gets a value indicating the scale factor of a fixed precision model + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that ar s. + + Martin Davis + + + + + + Interface for surfaces + + + + + Interface for a curve + + + + + Gets a value indicating the sequence of coordinates that make up curve + + + + + Gets a value indicating the start point of the curve + + + + + Gets a value indicating the end point of the curve + + + + + Gets a value indicating that the curve is closed. + In this case an are equal. + + + + + Gets a value indicating that the curve is a ring. + + + + + Gets a value indicating whether this ring is oriented counter-clockwise. + + + + + Provides constants representing the dimensions of a point, a curve and a surface. + + + Also provides constants representing the dimensions of the empty geometry and + non-empty geometries, and the wildcard constant meaning "any dimension". + These constants are used as the entries in s. + + + + + Dimension value of a point (0). + + + + + Dimension value of a curve (1). + + + + + Dimension value of a surface (2). + + + + + Dimension value of a empty point (-1). + + + + + Dimension value of non-empty geometries (= {Point,Curve,A}). + + + + + Dimension value for any dimension (= {False, True}). + + + + + Class containing static methods for conversions + between dimension values and characters. + + + + + Symbol for the FALSE pattern matrix entry + + + + + Symbol for the TRUE pattern matrix entry + + + + + Symbol for the DONTCARE pattern matrix entry + + + + + Symbol for the P (dimension 0) pattern matrix entry + + + + + Symbol for the L (dimension 1) pattern matrix entry + + + + + Symbol for the A (dimension 2) pattern matrix entry + + + + + Converts the dimension value to a dimension symbol, + for example, True => 'T' + + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + + + + Converts the dimension symbol to a dimension value, + for example, '*' => Dontcare + + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + + + + Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. + + + + DE-9IM matrices (such as "212FF1FF2") + specify the topological relationship between two s. + This class can also represent matrix patterns (such as "T*T******") + which are used for matching instances of DE-9IM matrices. + + + Methods are provided to: + + Set and query the elements of the matrix in a convenient fashion. + Convert to and from the standard string representation (specified in SFS Section 2.1.13.2). + Test to see if a matrix matches a given pattern string. + + + For a description of the DE-9IM and the spatial predicates derived from it, see the + OGC 99-049 OpenGIS Simple Features Specification for SQL. as well as + OGC 06-103r4 OpenGIS + Implementation Standard for Geographic information - + Simple feature access - Part 1: Common architecture + (which provides some further details on certain predicate specifications). + + The entries of the matrix are defined by the constants in the enum. + The indices of the matrix represent the topological locations + that occur in a geometry (Interior, Boundary, Exterior). + These are provided as constants in the enum. + + + + + + Internal representation of this . + + + + + Creates an with null location values. + + + + + Creates an with the given dimension + symbols. + + A string of nine dimension symbols in row major order. + + + + Creates an with the same elements as + other. + + An to copy. + + + + Adds one matrix to another. + Addition is defined by taking the maximum dimension value of each position + in the summand matrices. + + The matrix to add. + + + + Tests if the dimension value matches TRUE + (i.e. has value 0, 1, 2 or TRUE). + + A number that can be stored in the IntersectionMatrix. + Possible values are {, , , , , } + true if the dimension value matches + + + + Tests if the dimension value satisfies the dimension symbol. + + + a number that can be stored in the IntersectionMatrix. + Possible values are {True, False, Dontcare, 0, 1, 2}. + + + A character used in the string + representation of an . + Possible values are T, F, * , 0, 1, 2. + + + true if the dimension symbol encompasses the dimension value. + + + + + Tests if each of the actual dimension symbols in a matrix string satisfies the + corresponding required dimension symbol in a pattern string. + + + Nine dimension symbols to validate. + Possible values are T, F, * , 0, 1, 2. + + + Nine dimension symbols to validate + against. Possible values are T, F, * , 0, 1, 2. + + + true if each of the required dimension + symbols encompass the corresponding actual dimension symbol. + + + + + Changes the value of one of this elements. + + + The row of this , + indicating the interior, boundary or exterior of the first + + + The column of this , + indicating the interior, boundary or exterior of the second + + The new value of the element + + + + Changes the elements of this to the + dimension symbols in dimensionSymbols. + + + Nine dimension symbols to which to set this + s elements. Possible values are {T, F, * , 0, 1, 2} + + + + + Changes the specified element to minimumDimensionValue if the element is less. + + + The row of this , + indicating the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + + The dimension value with which to compare the + element. The order of dimension values from least to greatest is + True, False, Dontcare, 0, 1, 2. + + + + + If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue + if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0. + + + + + + + + For each element in this , changes the + element to the corresponding minimum dimension symbol if the element is + less. + + + Nine dimension symbols with which to + compare the elements of this . The + order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2. + + + + + Changes the elements of this to dimensionValue. + + + The dimension value to which to set this + s elements. Possible values True, False, Dontcare, 0, 1, 2}. + + + + + Returns the value of one of this s + elements. + + + The row of this , indicating + the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + The dimension value at the given matrix position. + + + + Returns true if this is FF*FF****. + + + true if the two 's related by + this are disjoint. + + + + + Returns true if isDisjoint returns false. + + + true if the two 's related by + this intersect. + + + + + Returns true if this is + FT*******, F**T***** or F***T****. + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this touch; Returns false + if both s are points. + + + + + Returns true if this is + T*T****** (for a point and a curve, a point and an area or a line + and an area) 0******** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this cross. For this + function to return true, the s must + be a point and a curve; a point and a surface; two curves; or a curve + and a surface. + + + + + Returns true if this is + T*F**F***. + + true if the first is within the second. + + + + Returns true if this is + T*****FF*. + + true if the first contains the second. + + + + Returns true if this is T*****FF* + or *T****FF* or ***T**FF* or ****T*FF*. + + true if the first covers the second + + + + Returns true if this is T*F**F*** + or *TF**F*** or **FT*F*** or **F*TF*** + + true if the first is covered by the second + + + + Tests whether the argument dimensions are equal and + this IntersectionMatrix matches + the pattern T*F**FFF*. + + Note: This pattern differs from the one stated in + Simple feature access - Part 1: Common architecture. + That document states the pattern as TFFFTFFFT. This would + specify that + two identical POINTs are not equal, which is not desirable behaviour. + The pattern used here has been corrected to compute equality in this situation. + + The dimension of the first . + The dimension of the second . + + true if the two s + related by this are equal; the + s must have the same dimension to be equal. + + + + + Returns true if this is + T*T***T** (for two points or two surfaces) + 1*T***T** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this overlap. For this + function to return true, the s must + be two points, two curves or two surfaces. + + + + + Returns whether the elements of this + satisfies the required dimension symbols. + + + Nine dimension symbols with which to + compare the elements of this . Possible + values are {T, F, * , 0, 1, 2}. + + + true if this + matches the required dimension symbols. + + + + + Transposes this IntersectionMatrix. + + This as a convenience, + + + + Returns a nine-character String representation of this . + + + The nine dimension symbols of this + in row-major order. + + + + + See methods Get(int, int) and Set(int, int, int value) + + + + + The location of a relative to a + + + + + DE-9IM row index of the interior of the first point and column index of + the interior of the second point. Location value for the interior of a + point. + + int value = 0; + + + + DE-9IM row index of the boundary of the first point and column index of + the boundary of the second point. Location value for the boundary of a + point. + + int value = 1; + + + + DE-9IM row index of the exterior of the first point and column index of + the exterior of the second point. Location value for the exterior of a + point. + + int value = 2; + + + + Used for uninitialized location values. + + int value = 1; + + + + Utility class for enumeration + + + + + Converts the location value to a location symbol, for example, EXTERIOR => 'e'. + + + Either 'e', 'b', 'i' or '-'. + + + + Standard ordinate index values. + + + + + X Ordinate = 0. + + + + + Y Ordinate = 1. + + + + + Z Ordinate = 2. + + + + + M Ordinate = 3 + + + + + Ordinate at index 2 + + + + + Ordinate at index 3 + + + + + Ordinate at index 4 + + + + + Ordinate at index 5 + + + + + Ordinate at index 6 + + + + + Ordinate at index 7 + + + + + Ordinate at index 8 + + + + + Ordinate at index 9 + + + + + Ordinate at index 10 + + + + + Ordinate at index 11 + + + + + Ordinate at index 12 + + + + + Ordinate at index 13 + + + + + Ordinate at index 14 + + + + + Ordinate at index 15 + + + + + Ordinate at index 16 + + + + + Ordinate at index 17 + + + + + Ordinate at index 18 + + + + + Ordinate at index 19 + + + + + Ordinate at index 20 + + + + + Ordinate at index 21 + + + + + Ordinate at index 22 + + + + + Ordinate at index 23 + + + + + Ordinate at index 24 + + + + + Ordinate at index 25 + + + + + Ordinate at index 26 + + + + + Ordinate at index 27 + + + + + Ordinate at index 28 + + + + + Ordinate at index 29 + + + + + Ordinate at index 30 + + + + + Ordinate at index 31 + + + + + Ordinate at index 32 + + + + + Flags for Ordinate values + + + + + No ordinates + + + + + Flag for the x-ordinate + + + + + Flag for the y-ordinate + + + + + Flag for both x- and y-ordinate + + + + + Flag for the z-ordinate + + + + + Flag for x-, y- and z-ordinate + + + + + Flag for the m-ordinate + + + + + Flag for x-, y- and m-ordinate + + + + + Flag for x-, y-, z- and m-ordinate + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 10 + + + + + Flag for ordinate at index 11 + + + + + Flag for ordinate at index 12 + + + + + Flag for ordinate at index 13 + + + + + Flag for ordinate at index 14 + + + + + Flag for ordinate at index 15 + + + + + Flag for ordinate at index 16 + + + + + Flag for ordinate at index 17 + + + + + Flag for ordinate at index 18 + + + + + Flag for ordinate at index 19 + + + + + Flag for ordinate at index 20 + + + + + Flag for ordinate at index 21 + + + + + Flag for ordinate at index 22 + + + + + Flag for ordinate at index 23 + + + + + Flag for ordinate at index 24 + + + + + Flag for ordinate at index 25 + + + + + Flag for ordinate at index 26 + + + + + Flag for ordinate at index 27 + + + + + Flag for ordinate at index 28 + + + + + Flag for ordinate at index 29 + + + + + Flag for ordinate at index 30 + + + + + Flag for ordinate at index 31 + + + + + Flag for ordinate at index 32 + + + + + An interface for classes which prepare s + in order to optimize the performance of repeated calls to specific geometric operations. + + + + A given implementation may provide optimized implementations + for only some of the specified methods, and delegate the remaining + methods to the original operations. + + + An implementation may also only optimize certain situations, and delegate others. + See the implementing classes for documentation about which methods and situations + they optimize. + + Subclasses are intended to be thread-safe, to allow IPreparedGeometry + to be used in a multi-threaded context + (which allows extracting maximum benefit from the prepared state). + + + Martin Davis + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + + + + Tests whether the base contains a given geometry. + + + + The ContainsProperly predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry's interior. + The DE-9IM Intersection Matrix for the two geometries matches >[T**FF*FF*] + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + + + An example use case for this predicate is computing the intersections + of a set of geometries with a large polygonal geometry. + Since intersection is a fairly slow operation, it can be more efficient + to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection + known a priori to be simply the original test geometry. + + + The geometry to test + true if this geometry properly contains the given geometry + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + + + + Tests whether the base is disjoint from given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry is disjoint from the given geometry + + + + + Tests whether the base intersects a given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry intersects the given geometry + + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + + + + Gets the original which has been prepared. + + + + + Static class that provides access to a class. + + + + + Gets or sets the instance. + + + + + Interface for classes that provide access to coordinate system and tranformation facilities. + + + + + Returns the coordinate system by identifier + + The initialization for the coordinate system + The coordinate system. + + + + Returns the coordinate system by and . + + The authority for the coordinate system + The code assigned to the coordinate system by . + The coordinate system. + + + + Method to get the identifier, by which this coordinate system can be accessed. + + The authority name + The code assigned by + The identifier or null + + + + Method to create a coordinate tranformation between two spatial reference systems, defined by their identifiers + + This is a convenience function for . + The identifier for the source spatial reference system. + The identifier for the target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Method to create a coordinate tranformation between two spatial reference systems + + The source spatial reference system. + The target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Delegate function to get a coordinate system from a given initialization string + + The initialization string + The type of the coordinate sytem. + + + + An interface for classes that offer access to geometry creating facillities. + + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Creates a new geometry factory, using , and . + + The geometry factory + + + + Creates a geometry fractory using and . + + + The geometry factory + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The spatial reference id. + The geometry factory. + + + + Creates a geometry factory using the given , + and . + + The coordinate sequence factory to use. + The spatial reference id. + The coordinate sequence factory. + The geometry factory. + + + + Reads the configuration from the configuration + + + + + Writes the current configuration to the configuration + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Byte order + + + + + BigEndian + + + + + LittleEndian + + + + + Lightweight class that handles OGC Geometry type declaration + + + + + Initializes this instance + + The value describing the + + + + Inititalizes this instance based on a geometry and an Ordinates flag. + + The geometry. + The ordinates flag. + + + + Inititalizes this instance based on an + + The OGC geometry type + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + Indicator if a SRID is supplied. + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + The ordinates flag. + Indicator if a SRID is supplied. + + + + Gets or sets the base geometry type + + + + + Gets the OGC Well-Known-Binary type code + + + + + Gets the PostGIS Enhanced Well-Known-Binary type code + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets whether SRID value is stored along with the geometry. + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Interface for a coordinate buffer + + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Sets a m-value at the provided + + The index + The value + + + + Sets a z-value at the provided + + The index + The value + + + + Converts the contents of this to a . +
Optionally you may assign a factory to create the sequence +
+ The factory to use in order to create the sequence. + A coordinate sequence +
+ + + Gets the (current) capacity of the buffer + + + + + Gets the (current) number of coordinates in the buffer + + + + + Base interface for geometry reader or writer interfaces. + + + + + Gets or sets whether the SpatialReference ID must be handled. + + + + + Gets and flag that indicate which ordinates can be handled. + + + This flag must always return at least . + + + + + Gets and sets flag that indicate which ordinates shall be handled. + + + No matter which flag you supply, are always processed, + the rest is binary and 'ed with . + + + + + Interface for binary output of instances. + + The type of the output to produce. + + + + Writes a binary representation of a given geometry. + + The geometry + The binary representation of + + + + Writes a binary representation of a given geometry. + + + + + + + Interface for binary output of instances. + + + + + Gets or sets the desired + + + + + Interface for textual output of instances. + + + + + Interface for input/parsing of instances. + + The type of the source to read from. + + + + Reads a geometry representation from a to a Geometry. + + + The source to read the geometry from + For WKT is string, + for WKB is byte[], + + + A Geometry + + + + + Reads a geometry representation from a to a Geometry. + + The stream to read from. + A Geometry + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Interface for textual input of instances. + + + + + Interface for binary input of instances. + + + + + Enumeration of OGC Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + CircularString + + + + + CompoundCurve + + + + + CurvePolygon + + + + + MultiCurve + + + + + MultiSurface + + + + + Curve + + + + + Surface + + + + + PolyhedralSurface + + + + + TIN + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Creates a ParseException with s detail message + + + The inner exception + + + + Buffer style. + + + + + Specifies a round line buffer end cap endCapStyle (Default). + / + + + + Specifies a butt (or flat) line buffer end cap endCapStyle. + + + + + Specifies a square line buffer end cap endCapStyle. + + + + + End cap style constants + + + + + Specifies a round line buffer end cap style. + + + + + Specifies a flat line buffer end cap style. + + + + + Specifies a square line buffer end cap style. + + + + + An interface for classes that control the parameters for the buffer building process + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + + + + Gets/Sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + qs >>= 1joins are round, and qs indicates the number of segments to use to approximate a quarter-circle. + qs = 0joins are beveled + qs < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |qs| + + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , , and . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Gets or sets the factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + Join style constants + + + + + Specifies a round join style. + + + + + Specifies a mitre join style. + + + + + Specifies a bevel join style. + + + + + Static utility functions for dealing with and dimension + + + + + Translates the -flag to a number of dimensions. + + The ordinates flag + The number of dimensions + + + + Translates a dimension value to an -flag. + + The flag for is set first. + The dimension. + The ordinates-flag + + + + Converts an encoded flag to an array of indices. + + The ordinate flags + The maximum oridinate flag that is to be checked + The ordinate indices + + + + Converts an array of values to an flag. + + An array of values + An flag. + +
+
Index: packages/GeoAPI.1.7.4/lib/net45/GeoAPI.dll =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/net45/GeoAPI.xml =================================================================== diff -u --- packages/GeoAPI.1.7.4/lib/net45/GeoAPI.xml (revision 0) +++ packages/GeoAPI.1.7.4/lib/net45/GeoAPI.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,5702 @@ + + + + GeoAPI + + + + + Details of axis. This is used to label axes, and indicate the orientation. + + + + + Initializes a new instance of an AxisInfo. + + Name of axis + Axis orientation + + + + Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string. + + + + + Gets enumerated value for orientation. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Orientation of axis. Some coordinate systems use non-standard orientations. + For example, the first axis in South African grids usually points West, + instead of East. This information is obviously relevant for algorithms + converting South African grid coordinates into Lat/Long. + + + + + Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems. + + + + + Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude. + + + + + Increasing ordinates values go South. This is rarely used. + + + + + Increasing ordinates values go East. This is rarely used. + + + + + Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude. + + + + + Increasing ordinates values go up. This is used for vertical coordinate systems. + + + + + Increasing ordinates values go down. This is used for vertical coordinate systems. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) through + the equation: H=h-N. + + + + + Lowest possible value for horizontal datum types + + + + + Unspecified horizontal datum type. Horizontal datums with this type should never + supply a conversion to WGS84 using Bursa Wolf parameters. + + + + + These datums, such as ED50, NAD27 and NAD83, have been designed to support + horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent. + + + + + A geocentric datum is a "satellite age" modern geodetic datum mainly of global + extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These + datums were designed to support both a horizontal component of position and + a vertical component of position (through ellipsoidal heights). The regional + realizations of ITRF, such as ETRF, are also included in this category. + + + + + Highest possible value for horizontal datum types. + + + + + Lowest possible value for vertical datum types. + + + + + Unspecified vertical datum type. + + + + + A vertical datum for orthometric heights that are measured along the plumb line. + + + + + A vertical datum for ellipsoidal heights that are measured along the normal to + the ellipsoid used in the definition of horizontal datum. + + + + + The vertical datum of altitudes or heights in the atmosphere. These are + approximations of orthometric heights obtained with the help of a barometer or + a barometric altimeter. These values are usually expressed in one of the + following units: meters, feet, millibars (used to measure pressure levels), or + theta value (units used to measure geopotential height). + + + + + A normal height system. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) + through the equation: H=h-N. + + + + + This attribute is used to support the set of datums generated for hydrographic + engineering projects where depth measurements below sea level are needed. It is + often called a hydrographic or a marine datum. Depths are measured in the + direction perpendicular (approximately) to the actual equipotential surfaces of + the earth's gravity field, using such procedures as echo-sounding. + + + + + Highest possible value for vertical datum types. + + + + + Lowest possible value for local datum types. + + + + + Highest possible value for local datum types. + + + + + The IAngularUnit interface defines methods on angular units. + + + + + The IUnit interface abstracts different kinds of units, it has no methods. + + + + + The ISpatialReferenceInfo interface defines the standard + information stored with spatial reference objects. This + interface is reused for many of the spatial reference + objects in the system. + + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Gets or sets the name of the object. + + + + + Gets or sets the authority name for this object, e.g., “POSC”, + is this is a standard object with an authority specific + identity code. Returns “CUSTOM” if this is a custom object. + + + + + Gets or sets the authority specific identification code of the object + + + + + Gets or sets the alias of the object. + + + + + Gets or sets the abbreviation of the object. + + + + + Gets or sets the provider-supplied remarks for the object. + + + + + Returns the Well-known text for this spatial reference object + as defined in the simple features specification. + + + + + Gets an XML representation of this object. + + + + + Gets or sets the number of radians per angular unit. + + + + + An aggregate of two coordinate systems (CRS). One of these is usually a + CRS based on a two dimensional coordinate system such as a geographic or + a projected coordinate system with a horizontal datum. The other is a + vertical CRS which is a one-dimensional coordinate system with a vertical + datum. + + + + + Base interface for all coordinate systems + + + A coordinate system is a mathematical space, where the elements of the space are called + positions. Each position is described by a list of numbers. The length of the list corresponds + to the dimension of the coordinate system. So in a 2D coordinate system each position is + described by a list containing 2 numbers. + + However, in a coordinate system, not all lists of numbers correspond to a position - + some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon + coordinate system, the list (91,91) does not correspond to a position. + + Some coordinate systems also have a mapping from the mathematical space into locations + in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) + corresponds to a location on the surface of the Earth. This mapping from the mathematical + space into real-world locations is called a Datum. + + + + + Gets axis details for dimension within coordinate system. + + Dimension + Axis info + + + + Gets units for dimension within coordinate system. + + + + + Dimension of the coordinate system. + + + + + Gets default envelope of coordinate system. + + + Gets default envelope of coordinate system. Coordinate systems + which are bounded should return the minimum bounding box of their + domain. Unbounded coordinate systems should return a box which is + as large as is likely to be used. For example, a (lon,lat) + geographic coordinate system in degrees should return a box from + (-180,-90) to (180,90), and a geocentric coordinate system could + return a box from (-r,-r,-r) to (+r,+r,+r) where r is the + approximate radius of the Earth. + + + + + Gets first sub-coordinate system. + + + + + Gets second sub-coordinate system. + + + + + Creates spatial reference objects using codes. + + + The codes are maintained by an external authority. A commonly used authority is EPSG, which is also used in the GeoTIFF standard and in SharpMap. + + + + + Returns a projected coordinate system object corresponding to the given code. + + The identification code. + The projected coordinate system object with the given code. + + + + Returns a geographic coordinate system object corresponding to the given code. + + The identification code. + The geographic coordinate system object with the given code. + + + + Returns a horizontal datum object corresponding to the given code. + + The identification code. + The horizontal datum object with the given code. + + + + Returns an ellipsoid object corresponding to the given code. + + The identification code. + The ellipsoid object with the given code. + + + + Returns a prime meridian object corresponding to the given code. + + The identification code. + The prime meridian object with the given code. + + + + Returns a linear unit object corresponding to the given code. + + The identification code. + The linear unit object with the given code. + + + + Returns an angular unit object corresponding to the given code. + + The identification code. + The angular unit object for the given code. + + + + Creates a from a code. + + Authority code + Vertical datum for the given code + + + + Create a vertical coordinate system from a code. + + Authority code + + + + + Creates a 3D coordinate system from a code. + + Authority code + Compound coordinate system for the given code + + + + Creates a horizontal co-ordinate system from a code. + The horizontal coordinate system could be geographic or projected. + + Authority code + Horizontal coordinate system for the given code + + + + Gets the Geoid code from a WKT name. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced + by a quoted string, which is used as a key value. This method converts + the key value string into a code recognized by this authority. + + + + + + + Gets the WKT name of a Geoid. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced by + a quoted string, which is used as a key value. This method gets the OGC WKT + key value from a geoid code. + + + + + + + Returns the authority name for this factory (e.g., "EPSG" or "POSC"). + + + + + Gets a description of the object corresponding to a code. + + + + + Builds up complex objects from simpler objects or values. + + + ICoordinateSystemFactory allows applications to make coordinate systems that + cannot be created by a . This factory is very + flexible, whereas the authority factory is easier to use. + So can be used to make 'standard' coordinate + systems, and can be used to make 'special' + coordinate systems. + For example, the EPSG authority has codes for USA state plane coordinate systems + using the NAD83 datum, but these coordinate systems always use meters. EPSG does not + have codes for NAD83 state plane coordinate systems that use feet units. This factory + lets an application create such a hybrid coordinate system. + + + + + Creates a . + + Name of compound coordinate system. + Head coordinate system + Tail coordinate system + Compound coordinate system + + + + Creates an from radius values. + + + Name of ellipsoid + + + + Ellipsoid + + + + Creates a . + + The units of the axes in the fitted coordinate system will be + inferred from the units of the base coordinate system. If the affine map + performs a rotation, then any mixed axes must have identical units. For + example, a (lat_deg,lon_deg,height_feet) system can be rotated in the + (lat,lon) plane, since both affected axes are in degrees. But you + should not rotate this coordinate system in any other plane. + Name of coordinate system + Base coordinate system + + + Fitted coordinate system + + + + Creates an from an major radius, and inverse flattening. + + + Name of ellipsoid + Semi major-axis + Inverse flattening + Linear unit + Ellipsoid + + + + Creates a coordinate system object from an XML string. + + XML representation for the spatial reference + The resulting spatial reference object + + + + Creates a spatial reference object given its Well-known text representation. + The output object may be either a or + a . + + The Well-known text representation for the spatial reference + The resulting spatial reference object + + + + Creates a , which could be Lat/Lon or Lon/Lat. + + Name of geographical coordinate system + Angular units + Horizontal datum + Prime meridian + First axis + Second axis + Geographic coordinate system + + + + Creates from ellipsoid and Bursa-World parameters. + + + Since this method contains a set of Bursa-Wolf parameters, the created + datum will always have a relationship to WGS84. If you wish to create a + horizontal datum that has no relationship with WGS84, then you can + either specify a horizontalDatumType of , or create it via WKT. + + Name of ellipsoid + Type of datum + Ellipsoid + Wgs84 conversion parameters + Horizontal datum + + + + Creates a local coordinate system. + + + The dimension of the local coordinate system is determined by the size of + the axis array. All the axes will have the same units. If you want to make + a coordinate system with mixed units, then you can make a compound + coordinate system from different local coordinate systems. + + Name of local coordinate system + Local datum + Units + Axis info + Local coordinate system + + + + Creates a . + + Name of datum + Datum type + + + + + Creates a , relative to Greenwich. + + Name of prime meridian + Angular unit + Longitude + Prime meridian + + + + Creates a using a projection object. + + Name of projected coordinate system + Geographic coordinate system + Projection + Linear unit + Primary axis + Secondary axis + Projected coordinate system + + + + Creates a . + + Name of projection + Projection class + Projection parameters + Projection + + + + Creates a from a datum and linear units. + + Name of vertical coordinate system + Vertical datum + Unit + Axis info + Vertical coordinate system + + + + Creates a from an enumerated type value. + + Name of datum + Type of datum + Vertical datum + + + + A set of quantities from which other quantities are calculated. + + + For the OGC abstract model, it can be defined as a set of real points on the earth + that have coordinates. EG. A datum can be thought of as a set of parameters + defining completely the origin and orientation of a coordinate system with respect + to the earth. A textual description and/or a set of parameters describing the + relationship of a coordinate system to some predefined physical locations (such + as center of mass) and physical directions (such as axis of spin). The definition + of the datum may also include the temporal behavior (such as the rate of change of + the orientation of the coordinate axes). + + + + + Gets or sets the type of the datum as an enumerated code. + + + + + The IEllipsoid interface defines the standard information stored with ellipsoid objects. + + + + + Gets or sets the value of the semi-major axis. + + + + + Gets or sets the value of the semi-minor axis. + + + + + Gets or sets the value of the inverse of the flattening constant of the ellipsoid. + + + + + Gets or sets the value of the axis unit. + + + + + Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the + IVF as the defining value, and calculate the polar radius whenever asked. Other + ellipsoids use the polar radius to calculate the IVF whenever asked. This + distinction can be important to avoid floating-point rounding errors. + + + + + A coordinate system which sits inside another coordinate system. The fitted + coordinate system can be rotated and shifted, or use any other math transform + to inject itself into the base coordinate system. + + + + + Gets Well-Known Text of a math transform to the base coordinate system. + The dimension of this fitted coordinate system is determined by the source + dimension of the math transform. The transform should be one-to-one within + this coordinate system's domain, and the base coordinate system dimension + must be at least as big as the dimension of this coordinate system. + + + + + + Gets underlying coordinate system. + + + + + A 3D coordinate system, with its origin at the center of the Earth. + + + + + Returns the HorizontalDatum. The horizontal datum is used to determine where + the centre of the Earth is considered to be. All coordinate points will be + measured from the centre of the Earth, and not the surface. + + + + + Gets the units used along all the axes. + + + + + Returns the PrimeMeridian. + + + + + The IGeodeticSpatialReference interface defines a root interface for all types of geodetic + spatial references, it is a subclass of ICoordinateSystem. + + + + + The IGeographicCoordinateSystem interface is a subclass of IGeodeticSpatialReference and + defines the standard information stored with geographic coordinate system objects. + + + + + A 2D coordinate system suitable for positions on the Earth's surface. + + + + + Returns the HorizontalDatum. + + + + + Gets details on a conversion to WGS84. + + + + + Gets or sets the angular units of the geographic coordinate system. + + + + + Gets or sets the prime meridian of the geographic coordinate system. + + + + + Gets the number of available conversions to WGS84 coordinates. + + + + + The IGeographicTransform interface is implemented on geographic transformation + objects and implements datum transformations between geographic coordinate systems. + + + + + Transforms an array of points from the source geographic coordinate system + to the target geographic coordinate system. + + Points in the source geographic coordinate system + Points in the target geographic coordinate system + + + + Transforms an array of points from the target geographic coordinate system + to the source geographic coordinate system. + + Points in the target geographic coordinate system + Points in the source geographic coordinate system + + + + Gets or sets source geographic coordinate system for the transformation. + + + + + Gets or sets the target geographic coordinate system for the transformation. + + + + + Returns an accessor interface to the parameters for this geographic transformation. + + + + + Procedure used to measure positions on the surface of the Earth. + + + + + Gets or sets the ellipsoid of the datum. + + + + + Gets preferred parameters for a Bursa Wolf transformation into WGS84. The 7 returned values + correspond to (dx,dy,dz) in meters, (ex,ey,ez) in arc-seconds, and scaling in parts-per-million. + + + + + The ILinearUnit interface defines methods on linear units. + + + + + Gets or sets the number of meters per . + + + + + A local coordinate system, with uncertain relationship to the world. + + In general, a local coordinate system cannot be related to other coordinate + systems. However, if two objects supporting this interface have the same dimension, + axes, units and datum then client code is permitted to assume that the two coordinate + systems are identical. This allows several datasets from a common source (e.g. a CAD + system) to be overlaid. In addition, some implementations of the Coordinate + Transformation (CT) package may have a mechanism for correlating local datums. (E.g. + from a database of transformations, which is created and maintained from real-world + measurements.) + + + + + Gets or sets the local datum + + + + + Local datum. If two local datum objects have the same datum type and name, + then they can be considered equal. This means that coordinates can be + transformed between two different local coordinate systems, as long as + they are based on the same local datum. + + + + + The IParameterInfo interface provides an interface through which clients of a + Projected Coordinate System or of a Projection can set the parameters of the + projection. It provides a generic interface for discovering the names and default + values of parameters, and for setting and getting parameter values. Subclasses of + this interface may provide projection specific parameter access methods. + + + + + Returns the default parameters for this projection. + + + + + + Gets the parameter by its name + + + + + + + Gets the number of parameters expected. + + + + + Gets or sets the parameters set for this projection. + + + + + The IPrimeMeridian interface defines the standard information stored with prime + meridian objects. Any prime meridian object must implement this interface as + well as the ISpatialReferenceInfo interface. + + + + + Gets or sets the longitude of the prime meridian (relative to the Greenwich prime meridian). + + + + + Gets or sets the AngularUnits. + + + + + The IProjectedCoordinateSystem interface defines the standard information stored with + projected coordinate system objects. A projected coordinate system is defined using a + geographic coordinate system object and a projection object that defines the + coordinate transformation from the geographic coordinate system to the projected + coordinate systems. The instances of a single ProjectedCoordinateSystem COM class can + be used to model different projected coordinate systems (e.g., UTM Zone 10, Albers) + by associating the ProjectedCoordinateSystem instances with Projection instances + belonging to different Projection COM classes (Transverse Mercator and Albers, + respectively). + + + + + Gets or sets the geographic coordinate system associated with the projected + coordinate system. + + + + + Gets or sets the linear (projected) units of the projected coordinate system. + + + + + Gets or sets the projection for the projected coordinate system. + + + + + The IProjection interface defines the standard information stored with projection + objects. A projection object implements a coordinate transformation from a geographic + coordinate system to a projected coordinate system, given the ellipsoid for the + geographic coordinate system. It is expected that each coordinate transformation of + interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of + coType Projection, supporting the IProjection interface. + + + + + Gets an indexed parameter of the projection. + + Index of parameter + n'th parameter + + + + Gets an named parameter of the projection. + + The parameter name is case insensitive + Name of parameter + parameter or null if not found + + + + Gets number of parameters of the projection. + + + + + Gets the projection classification name (e.g. 'Transverse_Mercator'). + + + + + A one-dimensional coordinate system suitable for vertical measurements. + + + + + Gets the vertical datum, which indicates the measurement method + + + + + Gets the units used along the vertical axis. + + + + + Procedure used to measure vertical distances. + + + + + A named parameter value. + + + + + Creates an instance of a parameter + + Units are always either meters or degrees. + Name of parameter + Value + + + + Parameter name + + + + + Parameter value + + + + + A named projection parameter value. + + + The linear units of parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. (Notice that this is different from , + where the units are always meters and degrees.) + + + + + Initializes an instance of a ProjectionParameter + + Name of parameter + Parameter value + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Parameter name. + + + + + Parameter value. + The linear units of a parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Flags indicating parts of domain covered by a convex hull. + + + These flags can be combined. For example, the value 3 + corresponds to a combination of and , + which means that some parts of the convex hull are inside the + domain, and some parts of the convex hull are outside the domain. + + + + + At least one point in a convex hull is inside the transform's domain. + + + + + At least one point in a convex hull is outside the transform's domain. + + + + + At least one point in a convex hull is not transformed continuously. + + + As an example, consider a "Longitude_Rotation" transform which adjusts + longitude coordinates to take account of a change in Prime Meridian. If + the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not + transformed continuously, since it is on the meridian line which will + be split at +180/-180 degrees. + + + + + Describes a coordinate transformation. This interface only describes a + coordinate transformation, it does not actually perform the transform + operation on points. To transform points you must use a math transform. + + + + + Human readable description of domain in source coordinate system. + + + + + Authority which defined transformation and parameter values. + + + An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is ‘4326’ + + + + + Code used by authority to identify transformation. An empty string is used for no code. + + The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is ‘4326’. + + + + Gets math transform. + + + + + Name of transformation. + + + + + Gets the provider-supplied remarks. + + + + + Source coordinate system. + + + + + Target coordinate system. + + + + + Semantic type of transform. For example, a datum transformation or a coordinate conversion. + + + + + Creates coordinate transformations. + + + + + Creates a transformation between two coordinate systems. + + + This method will examine the coordinate systems in order to construct + a transformation between them. This method may fail if no path between + the coordinate systems is found, using the normal failing behavior of + the DCP (e.g. throwing an exception). + Source coordinate system + Target coordinate system + + + + + Transforms muti-dimensional coordinate points. + + + If a client application wishes to query the source and target coordinate + systems of a transformation, then it should keep hold of the + interface, and use the contained + math transform object whenever it wishes to perform a transform. + + + + + Tests whether this transform does not move any points. + + + + + + Gets the derivative of this transform at a point. If the transform does + not have a well-defined derivative at the point, then this function should + fail in the usual way for the DCP. The derivative is the matrix of the + non-translating portion of the approximate affine map at the point. The + matrix will have dimensions corresponding to the source and target + coordinate systems. If the input dimension is M, and the output dimension + is N, then the matrix will have size [M][N]. The elements of the matrix + {elt[n][m] : n=0..(N-1)} form a vector in the output space which is + parallel to the displacement caused by a small change in the m'th ordinate + in the input space. + + + + + + + Gets transformed convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which generates a convex + hull in the source space. The returned sequence of ordinates represents a convex hull in the + output space. The number of output points will often be different from the number of input + points. Each of the input points should be inside the valid domain (this can be checked by + testing the points' domain flags individually). However, the convex hull of the input points + may go outside the valid domain. The returned convex hull should contain the transformed image + of the intersection of the source convex hull and the source domain. + A convex hull is a shape in a coordinate system, where if two positions A and B are + inside the shape, then all positions in the straight line between A and B are also inside + the shape. So in 3D a cube and a sphere are both convex hulls. Other less obvious examples + of convex hulls are straight lines, and single points. (A single point is a convex hull, + because the positions A and B must both be the same - i.e. the point itself. So the straight + line between A and B has zero length.) + Some examples of shapes that are NOT convex hulls are donuts, and horseshoes. + + + + + + + Gets flags classifying domain points within a convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which + generates a convex hull in the source space. Conceptually, each of the + (usually infinite) points inside the convex hull is then tested against + the source domain. The flags of all these tests are then combined. In + practice, implementations of different transforms will use different + short-cuts to avoid doing an infinite number of tests. + + + + + + + Creates the inverse transform of this object. + + This method may fail if the transform is not one to one. However, all cartographic projections should succeed. + + + + + Transforms a coordinate point. The passed parameter point should not be modified. + + + + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a list of coordinate point ordinal values. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Transforms a list of coordinates. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Reverses the transformation + + + + + Transforms a coordinate sequence. The input coordinate sequence remains unchanged. + + The coordinate sequence to transform. + The transformed coordinate sequence. + + + + Gets the dimension of input points. + + + + + Gets the dimension of output points. + + + + + Gets a Well-Known text representation of this object. + + + + + Gets an XML representation of this object. + + + + + Creates math transforms. + + + CT_MathTransformFactory is a low level factory that is used to create CT_MathTransform objects. Many high level GIS applications will never need to use a CT_MathTransformFactory directly; they can use a CT_CoordinateTransformationFactory instead. However, the CT_MathTransformFactory interface is specified here, since it can be used directly by applications that wish to transform other types of coordinates (e.g. color coordinates, or image pixel coordinates). + The following comments assume that the same vendor implements the math transform factory interfaces and math transform interfaces. + A math transform is an object that actually does the work of applying formulae to coordinate values. The math transform does not know or care how the coordinates relate to positions in the real world. This lack of semantics makes implementing CT_MathTransformFactory significantly easier than it would be otherwise. + For example CT_MathTransformFactory can create affine math transforms. The affine transform applies a matrix to the coordinates without knowing how what it is doing relates to the real world. So if the matrix scales Z values by a factor of 1000, then it could be converting meters into millimeters, or it could be converting kilometers into meters. + Because math transforms have low semantic value (but high mathematical value), programmers who do not have much knowledge of how GIS applications use coordinate systems, or how those coordinate systems relate to the real world can implement CT_MathTransformFactory. + The low semantic content of math transforms also means that they will be useful in applications that have nothing to do with GIS coordinates. For example, a math transform could be used to map color coordinates between different color spaces, such as converting (red, green, blue) colors into (hue, light, saturation) colors. + Since a math transform does not know what its source and target coordinate systems mean, it is not necessary or desirable for a math transform object to keep information on its source and target coordinate systems. + + + + + Creates an affine transform from a matrix. + + If the transform's input dimension is M, and output dimension is N, then the matrix will have size [N+1][M+1]. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will be the j'th ordinate of the moved origin. The [i][N] element of the matrix will be 0 for i less than M, and 1 for i equals M. + + + + + + Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other. + + The dimension of the output space of the first transform must match the dimension of the input space in the second transform. If you wish to concatenate more than two transforms, then you can repeatedly use this method. + + + + + + + Creates a math transform from a Well-Known Text string. + + + + + + + Creates a math transform from XML. + + + + + + + Creates a transform from a classification name and parameters. + + + The client must ensure that all the linear parameters are expressed in meters, and all the angular parameters are expressed in degrees. Also, they must supply "semi_major" and "semi_minor" parameters for cartographic projection transforms. + + + + + + + + Creates a transform which passes through a subset of ordinates to another transform. + + + This allows transforms to operate on a subset of ordinates. For example, if you have (Lat,Lon,Height) coordinates, then you may wish to convert the height values from meters to feet without affecting the (Lat,Lon) values. If you wanted to affect the (Lat,Lon) values and leave the Height values alone, then you would have to swap the ordinates around to (Height,Lat,Lon). You can do this with an affine map. + + + + + + + + Tests whether parameter is angular. Clients must ensure that all angular parameter values are in degrees. + + + + + + + Tests whether parameter is linear. Clients must ensure that all linear parameter values are in meters. + + + + + + + Semantic type of transform used in coordinate transformation. + + + + + Unknown or unspecified type of transform. + + + + + Transform depends only on defined parameters. For example, a cartographic projection. + + + + + Transform depends only on empirically derived parameters. For example a datum transformation. + + + + + Transform depends on both defined and empirical parameters. + + + + + Parameters for a geographic transformation into WGS84. The Bursa Wolf parameters should be applied + to geocentric coordinates, where the X axis points towards the Greenwich Prime Meridian, the Y axis + points East, and the Z axis points North. + + + These parameters can be used to approximate a transformation from the horizontal datum to the + WGS84 datum using a Bursa Wolf transformation. However, it must be remembered that this transformation + is only an approximation. For a given horizontal datum, different Bursa Wolf transformations can be + used to minimize the errors over different regions. + If the DATUM clause contains a TOWGS84 clause, then this should be its “preferred” transformation, + which will often be the transformation which gives a broad approximation over the whole area of interest + (e.g. the area of interest in the containing geographic coordinate system). + Sometimes, only the first three or six parameters are defined. In this case the remaining + parameters must be zero. If only three parameters are defined, then they can still be plugged into the + Bursa Wolf formulas, or you can take a short cut. The Bursa Wolf transformation works on geocentric + coordinates, so you cannot apply it onto geographic coordinates directly. If there are only three + parameters then you can use the Molodenski or abridged Molodenski formulas. + If a datums ToWgs84Parameters parameter values are zero, then the receiving + application can assume that the writing application believed that the datum is approximately equal to + WGS84. + + + + + Initializes an instance of Wgs84ConversionInfo with default parameters (all values = 0) + + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + Area of use for this transformation + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf scaling in parts per million. + + + + + Human readable text describing intended region of transformation. + + + + + Affine Bursa-Wolf matrix transformation + + + Transformation of coordinates from one geographic coordinate system into another + (also colloquially known as a "datum transformation") is usually carried out as an + implicit concatenation of three transformations: + [geographical to geocentric >> geocentric to geocentric >> geocentric to geographic + + The middle part of the concatenated transformation, from geocentric to geocentric, is usually + described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 + parameters, in what is known as the "Bursa-Wolf" formula:
+ + S = 1 + Ppm/1000000 + [ Xt ] [ S -Ez*S +Ey*S Dx ] [ Xs ] + [ Yt ] = [ +Ez*S S -Ex*S Dy ] [ Ys ] + [ Zt ] [ -Ey*S +Ex*S S Dz ] [ Zs ] + [ 1 ] [ 0 0 0 1 ] [ 1 ] +
+ The parameters are commonly referred to defining the transformation "from source coordinate system + to target coordinate system", whereby (XS, YS, ZS) are the coordinates of the point in the source + geocentric coordinate system and (XT, YT, ZT) are the coordinates of the point in the target + geocentric coordinate system. But that does not define the parameters uniquely; neither is the + definition of the parameters implied in the formula, as is often believed. However, the + following definition, which is consistent with the "Position Vector Transformation" convention, + is common E&P survey practice: +
+ (dX, dY, dZ): Translation vector, to be added to the point's position vector in the source + coordinate system in order to transform from source system to target system; also: the coordinates + of the origin of source coordinate system in the target coordinate system + (RX, RY, RZ): Rotations to be applied to the point's vector. The sign convention is such that + a positive rotation about an axis is defined as a clockwise rotation of the position vector when + viewed from the origin of the Cartesian coordinate system in the positive direction of that axis; + e.g. a positive rotation about the Z-axis only from source system to target system will result in a + larger longitude value for the point in the target system. Although rotation angles may be quoted in + any angular unit of measure, the formula as given here requires the angles to be provided in radians. + : The scale correction to be made to the position vector in the source coordinate system in order + to obtain the correct scale in the target coordinate system. M = (1 + dS*10-6), whereby dS is the scale + correction expressed in parts per million. + for an explanation of the Bursa-Wolf transformation +
+ +
+ + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Indicates whether the current object is equal to another object of the same type. + + + + + + + Returns a hash code for the specified object + + A hash code for the specified object + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Gets an XML representation of this object + + + + + Returns true of all 7 parameter values are 0.0 + + + + + + A lightweight class used to store coordinates on the 2-dimensional Cartesian plane. + + It is distinct from , which is a subclass of . + Unlike objects of type (which contain additional + information such as an envelope, a precision model, and spatial reference + system information), a Coordinate only contains ordinate values + and propertied. + + + Coordinates are two-dimensional points, with an additional Z-ordinate. + If an Z-ordinate value is not specified or not defined, + constructed coordinates have a Z-ordinate of NaN + (which is also the value of ). + + + + Apart from the basic accessor functions, NTS supports + only specific operations involving the Z-ordinate. + + + + + Interface for lightweight classes used to store coordinates on the 2-dimensional Cartesian plane. + + + + + Computes the 2-dimensional distance to the coordiante. + + The other coordinate + The 2-dimensional distance to other + + + + Compares equality for x- and y-ordinates + + The other coordinate + true if x- and y-ordinates of coordinate and coordiante are equal. + + + + Compares equality for x-, y- and z-ordinates + + The other coordinate + true if x-, y- and z-ordinates of coordinate and coordiante are equal. + + + + The x-ordinate value + + + + + The y-ordinate value + + + + + The z-ordinate value + + + + + The measure value + + + + + Gets or sets all ordinate values + + + + + Gets or sets the value of this + + The index + + + + The value used to indicate a null or missing ordinate value. + In particular, used for the value of ordinates for dimensions + greater than the defined dimension of a coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + Constructs a Coordinate at (x,y,z). + + X value. + Y value. + Z value. + + + + Constructs a Coordinate at (0,0,NaN). + + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate at (x,y,NaN). + + X value. + Y value. + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + Tests if another coordinate has the same value for X and Y, within a tolerance. + + A . + The tolerance value. + true if the X and Y ordinates are within the given tolerance. + The Z ordinate is ignored. + + + + Returns true if other has the same values for the x and y ordinates. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + + Coordinate with which to do the comparison. + true if other is a Coordinate with the same values for the x and y ordinates. + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if + has the same values for X, Y and Z. + + A with which to do the 3D comparison. + + true if is a + with the same values for X, Y and Z. + + + + + Tests if another coordinate has the same value for Z, within a tolerance. + + A . + The tolerance value. + true if the Z ordinates are within the given tolerance. + + + + Returns a string of the form (x,y,z) . + + string of the form (x,y,z) + + + + Create a new object as copy of this instance. + + + + + + Computes the 2-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations. + The Z-ordinate is ignored. + + + + Computes the 3-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 3-dimensional Euclidean distance between the locations. + + + + Gets a hashcode for this coordinate. + + A hashcode for this coordinate. + + + + Computes a hash code for a double value, using the algorithm from + Joshua Bloch's book Effective Java" + + A hashcode for the double value + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if other has the same values for x, y and z. + + Coordinate with which to do the 3D comparison. + true if other is a Coordinate with the same values for x, y and z. + + + + Computes the 2-dimensional Euclidean distance to another location. + The Z-ordinate is ignored. + + Coordinate with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations + + + + Gets or sets the ordinate value for the given index. + The supported values for the index are + , and . + + The ordinate index + The ordinate value + Thrown if is not in the valid range. + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + X coordinate. + + + + + Y coordinate. + + + + + Z coordinate. + + + + + The measure value + + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + Gets/Sets the ordinate value for a given index + + The index of the ordinate + The ordinate value + + + + Defines a rectangular region of the 2D coordinate plane. + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + Defines a rectangular region of the 2D coordinate plane. + + + + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + + + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + + + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + + Returns if the point specified by and is contained by the envelope. + + The x-ordinate + The y-ordinate + True if the point is contained by the envlope + + + + Returns if the point specified by is contained by the envelope. + + The point + True if the point is contained by the envlope + + + + Returns if the envelope specified by is contained by this envelope. + + The envelope to test + True if the other envelope is contained by this envlope + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Method to initialize the envelope. Calling this function will result in returning true + + + + + Method to initialize the envelope with a . Calling this function will result in an envelope having no extent but a location. + + The point + + + + Method to initialize the envelope. Calling this function will result in an envelope having the same extent as . + + The envelope + + + + Method to initialize the envelope with two s. + + The first point + The second point + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Makes this Envelope a "null" envelope.. + + + + + Gets the area of the envelope + + + + + Gets the width of the envelope + + + + + Gets the height of the envelope + + + + + Gets the maximum x-ordinate of the envelope + + + + + Gets the maximum y-ordinate of the envelope + + + + + Gets the minimum x-ordinate of the envelope + + + + + Gets the mimimum y-ordinate of the envelope + + + + + Gets the or the center of the envelope + + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Interface describing objects that can perform an intersects predicate with objects. + + The type of the component that can intersect + + + + Predicate function to test if intersects with this object. + + The object to test + true if this objects intersects with + + + + Interface describing objects that can expand themselves by objects of type . + + The type of objects that can expand clients + + + + Method to expand this object by + + The object to expand with + + + + Function to expand compute a new object that is this object by expanded by . + + The object to expand with + The expanded object + + + + Test the point q to see whether it intersects the Envelope + defined by p1-p2. + + One extremal point of the envelope. + Another extremal point of the envelope. + Point to test for intersection. + true if q intersects the envelope p1-p2. + + + + Tests whether the envelope defined by p1-p2 + and the envelope defined by q1-q2 + intersect. + + One extremal point of the envelope Point. + Another extremal point of the envelope Point. + One extremal point of the envelope Q. + Another extremal point of the envelope Q. + true if Q intersects Point + + + + Creates a null Envelope. + + + + + Creates an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Creates an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Creates an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Create an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Makes this Envelope a "null" envelope.. + + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Use Intersects instead. + + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + + + + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Creates a new object that is a copy of the current instance. + + A new object that is a copy of this instance. + + + + Creates a deep copy of the current envelope. + + + + + + Calculates the union of the current box and the given point. + + + + + Calculates the union of the current box and the given coordinate. + + + + + Calculates the union of the current box and the given box. + + + + + Moves the envelope to the indicated coordinate. + + The new centre coordinate. + + + + Moves the envelope to the indicated point. + + The new centre point. + + + + Resizes the envelope to the indicated point. + + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre point. + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre coordinate. + The new width. + The new height. + + + + Zoom the box. + Possible values are e.g. 50 (to zoom in a 50%) or -50 (to zoom out a 50%). + + + Negative do Envelope smaller. + Positive do Envelope bigger. + + + perCent = -50 compact the envelope a 50% (make it smaller). + perCent = 200 enlarge envelope by 2. + + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Method to parse an envelope from its value + + The envelope string + The envelope + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Returns the difference between the maximum and minimum x values. + + max x - min x, or 0 if this is a null Envelope. + + + + Returns the difference between the maximum and minimum y values. + + max y - min y, or 0 if this is a null Envelope. + + + + Returns the Envelopes minimum x-value. min x > max x + indicates that this is a null Envelope. + + The minimum x-coordinate. + + + + Returns the Envelopes maximum x-value. min x > max x + indicates that this is a null Envelope. + + The maximum x-coordinate. + + + + Returns the Envelopes minimum y-value. min y > max y + indicates that this is a null Envelope. + + The minimum y-coordinate. + + + + Returns the Envelopes maximum y-value. min y > max y + indicates that this is a null Envelope. + + The maximum y-coordinate. + + + + Gets the area of this envelope. + + The area of the envelope, or 0.0 if envelope is null + + + + Gets the minimum extent of this envelope across both dimensions. + + + + + + Gets the maximum extent of this envelope across both dimensions. + + + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Gets the item that is bounded + + + + + An interface for classes which use the values of the coordinates in a . + Coordinate filters can be used to implement centroid and + envelope computation, and many other functions. + ICoordinateFilter is + an example of the Gang-of-Four Visitor pattern. + + Note: it is not recommended to use these filters to mutate the coordinates. + There is no guarantee that the coordinate is the actual object stored in the geometry. + In particular, modified values may not be preserved if the target Geometry uses a non-default . + If in-place mutation is required, use . + + + + + + + Performs an operation with or on coord. + + Coordinate to which the filter is applied. + + + + The internal representation of a list of coordinates inside a Geometry. + + This allows Geometries to store their + points using something other than the NTS class. + For example, a storage-efficient implementation + might store coordinate sequences as an array of x's + and an array of y's. + Or a custom coordinate class might support extra attributes like M-values. + + + Implementing a custom coordinate storage structure + requires implementing the and + interfaces. + To use the custom CoordinateSequence, create a + new parameterized by the CoordinateSequenceFactory + The can then be used to create new s. + The new Geometries will use the custom CoordinateSequence implementation. + + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + A copy of the i'th coordinate in the sequence + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + At least the first two dimensions must be copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + The value of the X ordinate in the index'th coordinate. + + + + Returns ordinate Y (1) of the specified coordinate. + + + The value of the Y ordinate in the index'th coordinate. + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + + If the sequence does not provide value for the required ordinate, the implementation must not throw an exception, it should return . + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The ordinate value, or if the sequence does not provide values for "/> + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + + If the sequence can't store the ordinate value, the implementation must not throw an exception, it should simply ignore the call. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. Note that + if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + Returns the kind of ordinates this sequence supplys. . + + + + + Returns the number of coordinates in this sequence. + + + + + An object that knows how to build a particular implementation of + ICoordinateSequence from an array of Coordinates. + + + + + + Returns a based on the given array; + whether or not the array is copied is implementation-dependent. + + A coordinates array, which may not be null nor contain null elements + A coordinate sequence. + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + If the requested dimension is larger than the CoordinateSequence implementation + can provide, then a sequence of maximum possible dimension should be created. + An error should not be thrown. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, and can be set. + + A coordinate sequence. + + + + Gets the Ordinate flags that sequences created by this factory can maximal cope with. + + + + + An interface for classes which process the coordinates in a . + A filter can either record information about each coordinate, + or change the value of the coordinate. + Filters can be + used to implement operations such as coordinate transformations, centroid and + envelope computation, and many other functions. + classes support the concept of applying a + CoordinateSequenceFilter to each + s they contain. + + For maximum efficiency, the execution of filters can be short-circuited by using the property. + + + + CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern. + Note: In general, it is preferable to treat Geometrys as immutable. + Mutation should be performed by creating a new Geometry object (see + and for convenient ways to do this). + An exception to this rule is when a new Geometry has been created via . + In this case mutating the Geometry will not cause aliasing issues, + and a filter is a convenient way to implement coordinate transformation. + + + Martin Davis + + + + + + + Performs an operation on a coordinate in a . + + the CoordinateSequence to which the filter is applied + i the index of the coordinate to apply the filter to + + + + Reports whether the application of this filter can be terminated. + + + Once this method returns false, it should + continue to return false on every subsequent call. + + + + + Reports whether the execution of this filter has modified the coordinates of the geometry. + If so, will be executed + after this filter has finished being executed. + + Most filters can simply return a constant value reflecting whether they are able to change the coordinates. + + + + Geometry classes support the concept of applying + an IGeometryComponentFilter filter to the Geometry. + + + The filter is applied to every component of the Geometry + which is itself a Geometry + and which does not itself contain any components. + (For instance, all the LinearRings in Polygons are visited, + but in a MultiPolygon the Polygons themselves are not visited.) + Thus the only classes of Geometry which must be + handled as arguments to + are s, s and s. + An IGeometryComponentFilter filter can either + record information about the Geometry + or change the Geometry in some way. + IGeometryComponentFilter is an example of the Gang-of-Four Visitor pattern. + > + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned. + If geomList contains several Polygons, a + MultiPolygon is returned. + If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned. + If geomList is empty, an empty GeometryCollection + is returned. + + The Geometry to combine. + + A Geometry of the "smallest", "most type-specific" + class that can contain the elements of geomList. + + + + + Returns a clone of g based on a CoordinateSequence created by this + GeometryFactory's CoordinateSequenceFactory. + + + + + Creates a Point using the given Coordinate; a null Coordinate will create + an empty Geometry. + + The coordinate + A Point + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + The coordiante sequence. + A Point + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LinearRing using the given Coordinates; a null or empty array will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence possibly empty, or null. + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + Geometries, each of which may be empty but not null. + + + + Creates a with the same extent as the given envelope. + + + + + Gets the coordinate sequence factory to use when creating geometries. + + + + + Gets the spatial reference id to assign when creating geometries + + + + + Gets the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + GeometryCollection classes support the concept of + applying a IGeometryFilter to the Geometry. + The filter is applied to every element Geometry. + A IGeometryFilter can either record information about the Geometry + or change the Geometry in some way. + IGeometryFilter is an example of the Gang-of-Four Visitor pattern. + + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components which are s. + + Martin Davis + + + + + + Interface for basic implementation of Geometry. + + + + + Gets an array of ordinate values. + + + + + Gets the geometry at the given index + + A method moved in IGeometry + The index of the geometry to get + A geometry that is part of the + + + + Normalizes this geometry + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Gets the Well-Known-Binary representation of this geometry + + A byte array describing this geometry + + + + Gets the Well-Known-Text representation of this geometry + + A text describing this geometry + + + + Computes the convex hull for this geometry + + The convex hull + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS equals predicate. + + A geometry + true if this geometry is topologically equal to + + + + Tests whether two geometries are exactly equal + in their normalized forms. + > + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + + + + + + Returns the minimum distance between this Geometry + and the Geometry g. + + The Geometry from which to compute the distance. + + + + Performs an operation with or on this Geometry's + coordinates. If you are using this method to modify the point, be sure + to call afterwards. + Note that you cannot use this method to modify this Geometry + if its underlying 's Get method + returns a copy of the , rather than the actual + Coordinate stored (if it even stores Coordinates at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + If this method modifies any coordinate values, must be called to update the geometry state. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + Notifies this geometry that its coordinates have been changed by an external + party (using a CoordinateFilter, for example). The Geometry will flush + and/or update any information it has cached (such as its ). + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When is called, this method will be called for + this Geometry and its component geometries. + + + + + The used to create this geometry + + + + + The the used to create this. + + + + + Gets the spatial reference id + + + + + Gets the geometry type + + + + + Gets the OGC geometry type + + + + + Gets the area of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the length of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the number of geometries that make up this geometry + + + A method moved in IGeometry + + + + + Get the number of coordinates, that make up this geometry + + A method moved to IGeometry + + + + Gets the boundary geometry + + + + + Gets the of the boundary + + + + + Gets the centroid of the geometry + + A property moved in IGeometry + + + + Gets a that is guaranteed to be part of the geometry, usually the first. + + + + + Gets an array of s that make up this geometry. + + + + + Gets the of this geometry + + + + + Gets the envelope this would fit into. + + + + + Gets the envelope this would fit into. + + + + + Gets a point that is ensured to lie inside this geometry. + + + + + A ISurface method moved in IGeometry + + + + + Gets or sets the user data associated with this geometry + + + + + Structure for a closed 1-dimensional ℝ-interval + + + + + The lower bound of the interval + + + + + The upper bound of the interval + + + + + Initializes this structure with = = + + The value for min and max + + + + Initializes this structure with and values + + The minimum interval values + The maximum interval values + + + + Method to expand + + + + + + + + + + + + + + + + + + + Function to compute an interval that contains this and + + The interval + An interval + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval ℝ[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval ℝ[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval ℝ[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Function to test if this intersects the interval . + + + + true if this interval intersects + + + + Function to test if this intersects the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval intersects the interval ℝ[, ]. + + + + Creates an empty or uninitialzed Interval + + An empty or uninitialized + + + + Creates an interval with the range ℝ[,] + + The value + An + + + + Creates an interval with the range ℝ[,].
+ If necessary, val1 and val2 are exchanged. +
+ The minimum value + The maximum value + An +
+ + + Creates an interval with the range ℝ[,]. + + The template interval + An + + + + Equality operator for s + + The left-hand-side + The right-hand-side + true if the s are equal. + + + + Inequality operator for s + + The left-hand-side + The right-hand-side + true if the s are not equal. + + + + Gets a value if this interval is empty/undefined + + + + + Gets a value indicating the width of the + + + + + Gets a value indicating the centre of the interval (Min + Width * 0.5) + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that are s. + + Martin Davis + + + + + + + + + + + Floating precision corresponds to the standard + double-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Floating single precision corresponds to the standard + single-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Fixed Precision indicates that coordinates have a fixed number of decimal places. + The number of decimal places is determined by the log10 of the scale factor. + + + + + Interface for classes specifying the precision model of the Coordinates in a IGeometry. + In other words, specifies the grid of allowable points for all IGeometrys. + + + + + Function to compute a precised value of + + The value to precise + The precised value + + + + Method to precise . + + The coordinate to precise + + + + Gets a value indicating the precision model type + + + + + Gets a value indicating if this precision model has floating precision + + + + + Gets a value indicating the maximum precision digits + + + + + Gets a value indicating the scale factor of a fixed precision model + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that ar s. + + Martin Davis + + + + + + Interface for surfaces + + + + + Interface for a curve + + + + + Gets a value indicating the sequence of coordinates that make up curve + + + + + Gets a value indicating the start point of the curve + + + + + Gets a value indicating the end point of the curve + + + + + Gets a value indicating that the curve is closed. + In this case an are equal. + + + + + Gets a value indicating that the curve is a ring. + + + + + Gets a value indicating whether this ring is oriented counter-clockwise. + + + + + Provides constants representing the dimensions of a point, a curve and a surface. + + + Also provides constants representing the dimensions of the empty geometry and + non-empty geometries, and the wildcard constant meaning "any dimension". + These constants are used as the entries in s. + + + + + Dimension value of a point (0). + + + + + Dimension value of a curve (1). + + + + + Dimension value of a surface (2). + + + + + Dimension value of a empty point (-1). + + + + + Dimension value of non-empty geometries (= {Point,Curve,A}). + + + + + Dimension value for any dimension (= {False, True}). + + + + + Class containing static methods for conversions + between dimension values and characters. + + + + + Symbol for the FALSE pattern matrix entry + + + + + Symbol for the TRUE pattern matrix entry + + + + + Symbol for the DONTCARE pattern matrix entry + + + + + Symbol for the P (dimension 0) pattern matrix entry + + + + + Symbol for the L (dimension 1) pattern matrix entry + + + + + Symbol for the A (dimension 2) pattern matrix entry + + + + + Converts the dimension value to a dimension symbol, + for example, True => 'T' + + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + + + + Converts the dimension symbol to a dimension value, + for example, '*' => Dontcare + + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + + + + Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. + + + + DE-9IM matrices (such as "212FF1FF2") + specify the topological relationship between two s. + This class can also represent matrix patterns (such as "T*T******") + which are used for matching instances of DE-9IM matrices. + + + Methods are provided to: + + Set and query the elements of the matrix in a convenient fashion. + Convert to and from the standard string representation (specified in SFS Section 2.1.13.2). + Test to see if a matrix matches a given pattern string. + + + For a description of the DE-9IM and the spatial predicates derived from it, see the + OGC 99-049 OpenGIS Simple Features Specification for SQL. as well as + OGC 06-103r4 OpenGIS + Implementation Standard for Geographic information - + Simple feature access - Part 1: Common architecture + (which provides some further details on certain predicate specifications). + + The entries of the matrix are defined by the constants in the enum. + The indices of the matrix represent the topological locations + that occur in a geometry (Interior, Boundary, Exterior). + These are provided as constants in the enum. + + + + + + Internal representation of this . + + + + + Creates an with null location values. + + + + + Creates an with the given dimension + symbols. + + A string of nine dimension symbols in row major order. + + + + Creates an with the same elements as + other. + + An to copy. + + + + Adds one matrix to another. + Addition is defined by taking the maximum dimension value of each position + in the summand matrices. + + The matrix to add. + + + + Tests if the dimension value matches TRUE + (i.e. has value 0, 1, 2 or TRUE). + + A number that can be stored in the IntersectionMatrix. + Possible values are {, , , , , } + true if the dimension value matches + + + + Tests if the dimension value satisfies the dimension symbol. + + + a number that can be stored in the IntersectionMatrix. + Possible values are {True, False, Dontcare, 0, 1, 2}. + + + A character used in the string + representation of an . + Possible values are T, F, * , 0, 1, 2. + + + true if the dimension symbol encompasses the dimension value. + + + + + Tests if each of the actual dimension symbols in a matrix string satisfies the + corresponding required dimension symbol in a pattern string. + + + Nine dimension symbols to validate. + Possible values are T, F, * , 0, 1, 2. + + + Nine dimension symbols to validate + against. Possible values are T, F, * , 0, 1, 2. + + + true if each of the required dimension + symbols encompass the corresponding actual dimension symbol. + + + + + Changes the value of one of this elements. + + + The row of this , + indicating the interior, boundary or exterior of the first + + + The column of this , + indicating the interior, boundary or exterior of the second + + The new value of the element + + + + Changes the elements of this to the + dimension symbols in dimensionSymbols. + + + Nine dimension symbols to which to set this + s elements. Possible values are {T, F, * , 0, 1, 2} + + + + + Changes the specified element to minimumDimensionValue if the element is less. + + + The row of this , + indicating the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + + The dimension value with which to compare the + element. The order of dimension values from least to greatest is + True, False, Dontcare, 0, 1, 2. + + + + + If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue + if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0. + + + + + + + + For each element in this , changes the + element to the corresponding minimum dimension symbol if the element is + less. + + + Nine dimension symbols with which to + compare the elements of this . The + order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2. + + + + + Changes the elements of this to dimensionValue. + + + The dimension value to which to set this + s elements. Possible values True, False, Dontcare, 0, 1, 2}. + + + + + Returns the value of one of this s + elements. + + + The row of this , indicating + the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + The dimension value at the given matrix position. + + + + Returns true if this is FF*FF****. + + + true if the two 's related by + this are disjoint. + + + + + Returns true if isDisjoint returns false. + + + true if the two 's related by + this intersect. + + + + + Returns true if this is + FT*******, F**T***** or F***T****. + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this touch; Returns false + if both s are points. + + + + + Returns true if this is + T*T****** (for a point and a curve, a point and an area or a line + and an area) 0******** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this cross. For this + function to return true, the s must + be a point and a curve; a point and a surface; two curves; or a curve + and a surface. + + + + + Returns true if this is + T*F**F***. + + true if the first is within the second. + + + + Returns true if this is + T*****FF*. + + true if the first contains the second. + + + + Returns true if this is T*****FF* + or *T****FF* or ***T**FF* or ****T*FF*. + + true if the first covers the second + + + + Returns true if this is T*F**F*** + or *TF**F*** or **FT*F*** or **F*TF*** + + true if the first is covered by the second + + + + Tests whether the argument dimensions are equal and + this IntersectionMatrix matches + the pattern T*F**FFF*. + + Note: This pattern differs from the one stated in + Simple feature access - Part 1: Common architecture. + That document states the pattern as TFFFTFFFT. This would + specify that + two identical POINTs are not equal, which is not desirable behaviour. + The pattern used here has been corrected to compute equality in this situation. + + The dimension of the first . + The dimension of the second . + + true if the two s + related by this are equal; the + s must have the same dimension to be equal. + + + + + Returns true if this is + T*T***T** (for two points or two surfaces) + 1*T***T** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this overlap. For this + function to return true, the s must + be two points, two curves or two surfaces. + + + + + Returns whether the elements of this + satisfies the required dimension symbols. + + + Nine dimension symbols with which to + compare the elements of this . Possible + values are {T, F, * , 0, 1, 2}. + + + true if this + matches the required dimension symbols. + + + + + Transposes this IntersectionMatrix. + + This as a convenience, + + + + Returns a nine-character String representation of this . + + + The nine dimension symbols of this + in row-major order. + + + + + See methods Get(int, int) and Set(int, int, int value) + + + + + The location of a relative to a + + + + + DE-9IM row index of the interior of the first point and column index of + the interior of the second point. Location value for the interior of a + point. + + int value = 0; + + + + DE-9IM row index of the boundary of the first point and column index of + the boundary of the second point. Location value for the boundary of a + point. + + int value = 1; + + + + DE-9IM row index of the exterior of the first point and column index of + the exterior of the second point. Location value for the exterior of a + point. + + int value = 2; + + + + Used for uninitialized location values. + + int value = 1; + + + + Utility class for enumeration + + + + + Converts the location value to a location symbol, for example, EXTERIOR => 'e'. + + + Either 'e', 'b', 'i' or '-'. + + + + Standard ordinate index values. + + + + + X Ordinate = 0. + + + + + Y Ordinate = 1. + + + + + Z Ordinate = 2. + + + + + M Ordinate = 3 + + + + + Ordinate at index 2 + + + + + Ordinate at index 3 + + + + + Ordinate at index 4 + + + + + Ordinate at index 5 + + + + + Ordinate at index 6 + + + + + Ordinate at index 7 + + + + + Ordinate at index 8 + + + + + Ordinate at index 9 + + + + + Ordinate at index 10 + + + + + Ordinate at index 11 + + + + + Ordinate at index 12 + + + + + Ordinate at index 13 + + + + + Ordinate at index 14 + + + + + Ordinate at index 15 + + + + + Ordinate at index 16 + + + + + Ordinate at index 17 + + + + + Ordinate at index 18 + + + + + Ordinate at index 19 + + + + + Ordinate at index 20 + + + + + Ordinate at index 21 + + + + + Ordinate at index 22 + + + + + Ordinate at index 23 + + + + + Ordinate at index 24 + + + + + Ordinate at index 25 + + + + + Ordinate at index 26 + + + + + Ordinate at index 27 + + + + + Ordinate at index 28 + + + + + Ordinate at index 29 + + + + + Ordinate at index 30 + + + + + Ordinate at index 31 + + + + + Ordinate at index 32 + + + + + Flags for Ordinate values + + + + + No ordinates + + + + + Flag for the x-ordinate + + + + + Flag for the y-ordinate + + + + + Flag for both x- and y-ordinate + + + + + Flag for the z-ordinate + + + + + Flag for x-, y- and z-ordinate + + + + + Flag for the m-ordinate + + + + + Flag for x-, y- and m-ordinate + + + + + Flag for x-, y-, z- and m-ordinate + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 10 + + + + + Flag for ordinate at index 11 + + + + + Flag for ordinate at index 12 + + + + + Flag for ordinate at index 13 + + + + + Flag for ordinate at index 14 + + + + + Flag for ordinate at index 15 + + + + + Flag for ordinate at index 16 + + + + + Flag for ordinate at index 17 + + + + + Flag for ordinate at index 18 + + + + + Flag for ordinate at index 19 + + + + + Flag for ordinate at index 20 + + + + + Flag for ordinate at index 21 + + + + + Flag for ordinate at index 22 + + + + + Flag for ordinate at index 23 + + + + + Flag for ordinate at index 24 + + + + + Flag for ordinate at index 25 + + + + + Flag for ordinate at index 26 + + + + + Flag for ordinate at index 27 + + + + + Flag for ordinate at index 28 + + + + + Flag for ordinate at index 29 + + + + + Flag for ordinate at index 30 + + + + + Flag for ordinate at index 31 + + + + + Flag for ordinate at index 32 + + + + + An interface for classes which prepare s + in order to optimize the performance of repeated calls to specific geometric operations. + + + + A given implementation may provide optimized implementations + for only some of the specified methods, and delegate the remaining + methods to the original operations. + + + An implementation may also only optimize certain situations, and delegate others. + See the implementing classes for documentation about which methods and situations + they optimize. + + Subclasses are intended to be thread-safe, to allow IPreparedGeometry + to be used in a multi-threaded context + (which allows extracting maximum benefit from the prepared state). + + + Martin Davis + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + + + + Tests whether the base contains a given geometry. + + + + The ContainsProperly predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry's interior. + The DE-9IM Intersection Matrix for the two geometries matches >[T**FF*FF*] + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + + + An example use case for this predicate is computing the intersections + of a set of geometries with a large polygonal geometry. + Since intersection is a fairly slow operation, it can be more efficient + to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection + known a priori to be simply the original test geometry. + + + The geometry to test + true if this geometry properly contains the given geometry + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + + + + Tests whether the base is disjoint from given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry is disjoint from the given geometry + + + + + Tests whether the base intersects a given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry intersects the given geometry + + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + + + + Gets the original which has been prepared. + + + + + Static class that provides access to a class. + + + + + Gets or sets the instance. + + + + + Interface for classes that provide access to coordinate system and tranformation facilities. + + + + + Returns the coordinate system by identifier + + The initialization for the coordinate system + The coordinate system. + + + + Returns the coordinate system by and . + + The authority for the coordinate system + The code assigned to the coordinate system by . + The coordinate system. + + + + Method to get the identifier, by which this coordinate system can be accessed. + + The authority name + The code assigned by + The identifier or null + + + + Method to create a coordinate tranformation between two spatial reference systems, defined by their identifiers + + This is a convenience function for . + The identifier for the source spatial reference system. + The identifier for the target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Method to create a coordinate tranformation between two spatial reference systems + + The source spatial reference system. + The target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Delegate function to get a coordinate system from a given initialization string + + The initialization string + The type of the coordinate sytem. + + + + An interface for classes that offer access to geometry creating facillities. + + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Creates a new geometry factory, using , and . + + The geometry factory + + + + Creates a geometry fractory using and . + + + The geometry factory + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The spatial reference id. + The geometry factory. + + + + Creates a geometry factory using the given , + and . + + The coordinate sequence factory to use. + The spatial reference id. + The coordinate sequence factory. + The geometry factory. + + + + Reads the configuration from the configuration + + + + + Writes the current configuration to the configuration + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Byte order + + + + + BigEndian + + + + + LittleEndian + + + + + Lightweight class that handles OGC Geometry type declaration + + + + + Initializes this instance + + The value describing the + + + + Inititalizes this instance based on a geometry and an Ordinates flag. + + The geometry. + The ordinates flag. + + + + Inititalizes this instance based on an + + The OGC geometry type + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + Indicator if a SRID is supplied. + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + The ordinates flag. + Indicator if a SRID is supplied. + + + + Gets or sets the base geometry type + + + + + Gets the OGC Well-Known-Binary type code + + + + + Gets the PostGIS Enhanced Well-Known-Binary type code + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets whether SRID value is stored along with the geometry. + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Interface for a coordinate buffer + + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Sets a m-value at the provided + + The index + The value + + + + Sets a z-value at the provided + + The index + The value + + + + Converts the contents of this to a . +
Optionally you may assign a factory to create the sequence +
+ The factory to use in order to create the sequence. + A coordinate sequence +
+ + + Gets the (current) capacity of the buffer + + + + + Gets the (current) number of coordinates in the buffer + + + + + Base interface for geometry reader or writer interfaces. + + + + + Gets or sets whether the SpatialReference ID must be handled. + + + + + Gets and flag that indicate which ordinates can be handled. + + + This flag must always return at least . + + + + + Gets and sets flag that indicate which ordinates shall be handled. + + + No matter which flag you supply, are always processed, + the rest is binary and 'ed with . + + + + + Interface for binary output of instances. + + The type of the output to produce. + + + + Writes a binary representation of a given geometry. + + The geometry + The binary representation of + + + + Writes a binary representation of a given geometry. + + + + + + + Interface for binary output of instances. + + + + + Gets or sets the desired + + + + + Interface for textual output of instances. + + + + + Interface for input/parsing of instances. + + The type of the source to read from. + + + + Reads a geometry representation from a to a Geometry. + + + The source to read the geometry from + For WKT is string, + for WKB is byte[], + + + A Geometry + + + + + Reads a geometry representation from a to a Geometry. + + The stream to read from. + A Geometry + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Interface for textual input of instances. + + + + + Interface for binary input of instances. + + + + + Enumeration of OGC Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + CircularString + + + + + CompoundCurve + + + + + CurvePolygon + + + + + MultiCurve + + + + + MultiSurface + + + + + Curve + + + + + Surface + + + + + PolyhedralSurface + + + + + TIN + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Creates a ParseException with s detail message + + + The inner exception + + + + Buffer style. + + + + + Specifies a round line buffer end cap endCapStyle (Default). + / + + + + Specifies a butt (or flat) line buffer end cap endCapStyle. + + + + + Specifies a square line buffer end cap endCapStyle. + + + + + End cap style constants + + + + + Specifies a round line buffer end cap style. + + + + + Specifies a flat line buffer end cap style. + + + + + Specifies a square line buffer end cap style. + + + + + An interface for classes that control the parameters for the buffer building process + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + + + + Gets/Sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + qs >>= 1joins are round, and qs indicates the number of segments to use to approximate a quarter-circle. + qs = 0joins are beveled + qs < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |qs| + + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , , and . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Gets or sets the factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + Join style constants + + + + + Specifies a round join style. + + + + + Specifies a mitre join style. + + + + + Specifies a bevel join style. + + + + + Static utility functions for dealing with and dimension + + + + + Translates the -flag to a number of dimensions. + + The ordinates flag + The number of dimensions + + + + Translates a dimension value to an -flag. + + The flag for is set first. + The dimension. + The ordinates-flag + + + + Converts an encoded flag to an array of indices. + + The ordinate flags + The maximum oridinate flag that is to be checked + The ordinate indices + + + + Converts an array of values to an flag. + + An array of values + An flag. + +
+
Index: packages/GeoAPI.1.7.4/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.dll =================================================================== diff -u Binary files differ Index: packages/GeoAPI.1.7.4/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.xml =================================================================== diff -u --- packages/GeoAPI.1.7.4/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.xml (revision 0) +++ packages/GeoAPI.1.7.4/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,5733 @@ + + + + GeoAPI + + + + + Details of axis. This is used to label axes, and indicate the orientation. + + + + + Initializes a new instance of an AxisInfo. + + Name of axis + Axis orientation + + + + Human readable name for axis. Possible values are X, Y, Long, Lat or any other short string. + + + + + Gets enumerated value for orientation. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Orientation of axis. Some coordinate systems use non-standard orientations. + For example, the first axis in South African grids usually points West, + instead of East. This information is obviously relevant for algorithms + converting South African grid coordinates into Lat/Long. + + + + + Unknown or unspecified axis orientation. This can be used for local or fitted coordinate systems. + + + + + Increasing ordinates values go North. This is usually used for Grid Y coordinates and Latitude. + + + + + Increasing ordinates values go South. This is rarely used. + + + + + Increasing ordinates values go East. This is rarely used. + + + + + Increasing ordinates values go West. This is usually used for Grid X coordinates and Longitude. + + + + + Increasing ordinates values go up. This is used for vertical coordinate systems. + + + + + Increasing ordinates values go down. This is used for vertical coordinate systems. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) through + the equation: H=h-N. + + + + + Lowest possible value for horizontal datum types + + + + + Unspecified horizontal datum type. Horizontal datums with this type should never + supply a conversion to WGS84 using Bursa Wolf parameters. + + + + + These datums, such as ED50, NAD27 and NAD83, have been designed to support + horizontal positions on the ellipsoid as opposed to positions in 3-D space. These datums were designed mainly to support a horizontal component of a position in a domain of limited extent, such as a country, a region or a continent. + + + + + A geocentric datum is a "satellite age" modern geodetic datum mainly of global + extent, such as WGS84 (used in GPS), PZ90 (used in GLONASS) and ITRF. These + datums were designed to support both a horizontal component of position and + a vertical component of position (through ellipsoidal heights). The regional + realizations of ITRF, such as ETRF, are also included in this category. + + + + + Highest possible value for horizontal datum types. + + + + + Lowest possible value for vertical datum types. + + + + + Unspecified vertical datum type. + + + + + A vertical datum for orthometric heights that are measured along the plumb line. + + + + + A vertical datum for ellipsoidal heights that are measured along the normal to + the ellipsoid used in the definition of horizontal datum. + + + + + The vertical datum of altitudes or heights in the atmosphere. These are + approximations of orthometric heights obtained with the help of a barometer or + a barometric altimeter. These values are usually expressed in one of the + following units: meters, feet, millibars (used to measure pressure levels), or + theta value (units used to measure geopotential height). + + + + + A normal height system. + + + + + A vertical datum of geoid model derived heights, also called GPS-derived heights. + These heights are approximations of orthometric heights (H), constructed from the + ellipsoidal heights (h) by the use of the given geoid undulation model (N) + through the equation: H=h-N. + + + + + This attribute is used to support the set of datums generated for hydrographic + engineering projects where depth measurements below sea level are needed. It is + often called a hydrographic or a marine datum. Depths are measured in the + direction perpendicular (approximately) to the actual equipotential surfaces of + the earth's gravity field, using such procedures as echo-sounding. + + + + + Highest possible value for vertical datum types. + + + + + Lowest possible value for local datum types. + + + + + Highest possible value for local datum types. + + + + + The IAngularUnit interface defines methods on angular units. + + + + + The IUnit interface abstracts different kinds of units, it has no methods. + + + + + The ISpatialReferenceInfo interface defines the standard + information stored with spatial reference objects. This + interface is reused for many of the spatial reference + objects in the system. + + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Gets or sets the name of the object. + + + + + Gets or sets the authority name for this object, e.g., “POSC”, + is this is a standard object with an authority specific + identity code. Returns “CUSTOM” if this is a custom object. + + + + + Gets or sets the authority specific identification code of the object + + + + + Gets or sets the alias of the object. + + + + + Gets or sets the abbreviation of the object. + + + + + Gets or sets the provider-supplied remarks for the object. + + + + + Returns the Well-known text for this spatial reference object + as defined in the simple features specification. + + + + + Gets an XML representation of this object. + + + + + Gets or sets the number of radians per angular unit. + + + + + An aggregate of two coordinate systems (CRS). One of these is usually a + CRS based on a two dimensional coordinate system such as a geographic or + a projected coordinate system with a horizontal datum. The other is a + vertical CRS which is a one-dimensional coordinate system with a vertical + datum. + + + + + Base interface for all coordinate systems + + + A coordinate system is a mathematical space, where the elements of the space are called + positions. Each position is described by a list of numbers. The length of the list corresponds + to the dimension of the coordinate system. So in a 2D coordinate system each position is + described by a list containing 2 numbers. + + However, in a coordinate system, not all lists of numbers correspond to a position - + some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon + coordinate system, the list (91,91) does not correspond to a position. + + Some coordinate systems also have a mapping from the mathematical space into locations + in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) + corresponds to a location on the surface of the Earth. This mapping from the mathematical + space into real-world locations is called a Datum. + + + + + Gets axis details for dimension within coordinate system. + + Dimension + Axis info + + + + Gets units for dimension within coordinate system. + + + + + Dimension of the coordinate system. + + + + + Gets default envelope of coordinate system. + + + Gets default envelope of coordinate system. Coordinate systems + which are bounded should return the minimum bounding box of their + domain. Unbounded coordinate systems should return a box which is + as large as is likely to be used. For example, a (lon,lat) + geographic coordinate system in degrees should return a box from + (-180,-90) to (180,90), and a geocentric coordinate system could + return a box from (-r,-r,-r) to (+r,+r,+r) where r is the + approximate radius of the Earth. + + + + + Gets first sub-coordinate system. + + + + + Gets second sub-coordinate system. + + + + + Creates spatial reference objects using codes. + + + The codes are maintained by an external authority. A commonly used authority is EPSG, which is also used in the GeoTIFF standard and in SharpMap. + + + + + Returns a projected coordinate system object corresponding to the given code. + + The identification code. + The projected coordinate system object with the given code. + + + + Returns a geographic coordinate system object corresponding to the given code. + + The identification code. + The geographic coordinate system object with the given code. + + + + Returns a horizontal datum object corresponding to the given code. + + The identification code. + The horizontal datum object with the given code. + + + + Returns an ellipsoid object corresponding to the given code. + + The identification code. + The ellipsoid object with the given code. + + + + Returns a prime meridian object corresponding to the given code. + + The identification code. + The prime meridian object with the given code. + + + + Returns a linear unit object corresponding to the given code. + + The identification code. + The linear unit object with the given code. + + + + Returns an angular unit object corresponding to the given code. + + The identification code. + The angular unit object for the given code. + + + + Creates a from a code. + + Authority code + Vertical datum for the given code + + + + Create a vertical coordinate system from a code. + + Authority code + + + + + Creates a 3D coordinate system from a code. + + Authority code + Compound coordinate system for the given code + + + + Creates a horizontal co-ordinate system from a code. + The horizontal coordinate system could be geographic or projected. + + Authority code + Horizontal coordinate system for the given code + + + + Gets the Geoid code from a WKT name. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced + by a quoted string, which is used as a key value. This method converts + the key value string into a code recognized by this authority. + + + + + + + Gets the WKT name of a Geoid. + + + In the OGC definition of WKT horizontal datums, the geoid is referenced by + a quoted string, which is used as a key value. This method gets the OGC WKT + key value from a geoid code. + + + + + + + Returns the authority name for this factory (e.g., "EPSG" or "POSC"). + + + + + Gets a description of the object corresponding to a code. + + + + + Builds up complex objects from simpler objects or values. + + + ICoordinateSystemFactory allows applications to make coordinate systems that + cannot be created by a . This factory is very + flexible, whereas the authority factory is easier to use. + So can be used to make 'standard' coordinate + systems, and can be used to make 'special' + coordinate systems. + For example, the EPSG authority has codes for USA state plane coordinate systems + using the NAD83 datum, but these coordinate systems always use meters. EPSG does not + have codes for NAD83 state plane coordinate systems that use feet units. This factory + lets an application create such a hybrid coordinate system. + + + + + Creates a . + + Name of compound coordinate system. + Head coordinate system + Tail coordinate system + Compound coordinate system + + + + Creates an from radius values. + + + Name of ellipsoid + + + + Ellipsoid + + + + Creates a . + + The units of the axes in the fitted coordinate system will be + inferred from the units of the base coordinate system. If the affine map + performs a rotation, then any mixed axes must have identical units. For + example, a (lat_deg,lon_deg,height_feet) system can be rotated in the + (lat,lon) plane, since both affected axes are in degrees. But you + should not rotate this coordinate system in any other plane. + Name of coordinate system + Base coordinate system + + + Fitted coordinate system + + + + Creates an from an major radius, and inverse flattening. + + + Name of ellipsoid + Semi major-axis + Inverse flattening + Linear unit + Ellipsoid + + + + Creates a coordinate system object from an XML string. + + XML representation for the spatial reference + The resulting spatial reference object + + + + Creates a spatial reference object given its Well-known text representation. + The output object may be either a or + a . + + The Well-known text representation for the spatial reference + The resulting spatial reference object + + + + Creates a , which could be Lat/Lon or Lon/Lat. + + Name of geographical coordinate system + Angular units + Horizontal datum + Prime meridian + First axis + Second axis + Geographic coordinate system + + + + Creates from ellipsoid and Bursa-World parameters. + + + Since this method contains a set of Bursa-Wolf parameters, the created + datum will always have a relationship to WGS84. If you wish to create a + horizontal datum that has no relationship with WGS84, then you can + either specify a horizontalDatumType of , or create it via WKT. + + Name of ellipsoid + Type of datum + Ellipsoid + Wgs84 conversion parameters + Horizontal datum + + + + Creates a local coordinate system. + + + The dimension of the local coordinate system is determined by the size of + the axis array. All the axes will have the same units. If you want to make + a coordinate system with mixed units, then you can make a compound + coordinate system from different local coordinate systems. + + Name of local coordinate system + Local datum + Units + Axis info + Local coordinate system + + + + Creates a . + + Name of datum + Datum type + + + + + Creates a , relative to Greenwich. + + Name of prime meridian + Angular unit + Longitude + Prime meridian + + + + Creates a using a projection object. + + Name of projected coordinate system + Geographic coordinate system + Projection + Linear unit + Primary axis + Secondary axis + Projected coordinate system + + + + Creates a . + + Name of projection + Projection class + Projection parameters + Projection + + + + Creates a from a datum and linear units. + + Name of vertical coordinate system + Vertical datum + Unit + Axis info + Vertical coordinate system + + + + Creates a from an enumerated type value. + + Name of datum + Type of datum + Vertical datum + + + + A set of quantities from which other quantities are calculated. + + + For the OGC abstract model, it can be defined as a set of real points on the earth + that have coordinates. EG. A datum can be thought of as a set of parameters + defining completely the origin and orientation of a coordinate system with respect + to the earth. A textual description and/or a set of parameters describing the + relationship of a coordinate system to some predefined physical locations (such + as center of mass) and physical directions (such as axis of spin). The definition + of the datum may also include the temporal behavior (such as the rate of change of + the orientation of the coordinate axes). + + + + + Gets or sets the type of the datum as an enumerated code. + + + + + The IEllipsoid interface defines the standard information stored with ellipsoid objects. + + + + + Gets or sets the value of the semi-major axis. + + + + + Gets or sets the value of the semi-minor axis. + + + + + Gets or sets the value of the inverse of the flattening constant of the ellipsoid. + + + + + Gets or sets the value of the axis unit. + + + + + Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the + IVF as the defining value, and calculate the polar radius whenever asked. Other + ellipsoids use the polar radius to calculate the IVF whenever asked. This + distinction can be important to avoid floating-point rounding errors. + + + + + A coordinate system which sits inside another coordinate system. The fitted + coordinate system can be rotated and shifted, or use any other math transform + to inject itself into the base coordinate system. + + + + + Gets Well-Known Text of a math transform to the base coordinate system. + The dimension of this fitted coordinate system is determined by the source + dimension of the math transform. The transform should be one-to-one within + this coordinate system's domain, and the base coordinate system dimension + must be at least as big as the dimension of this coordinate system. + + + + + + Gets underlying coordinate system. + + + + + A 3D coordinate system, with its origin at the center of the Earth. + + + + + Returns the HorizontalDatum. The horizontal datum is used to determine where + the centre of the Earth is considered to be. All coordinate points will be + measured from the centre of the Earth, and not the surface. + + + + + Gets the units used along all the axes. + + + + + Returns the PrimeMeridian. + + + + + The IGeodeticSpatialReference interface defines a root interface for all types of geodetic + spatial references, it is a subclass of ICoordinateSystem. + + + + + The IGeographicCoordinateSystem interface is a subclass of IGeodeticSpatialReference and + defines the standard information stored with geographic coordinate system objects. + + + + + A 2D coordinate system suitable for positions on the Earth's surface. + + + + + Returns the HorizontalDatum. + + + + + Gets details on a conversion to WGS84. + + + + + Gets or sets the angular units of the geographic coordinate system. + + + + + Gets or sets the prime meridian of the geographic coordinate system. + + + + + Gets the number of available conversions to WGS84 coordinates. + + + + + The IGeographicTransform interface is implemented on geographic transformation + objects and implements datum transformations between geographic coordinate systems. + + + + + Transforms an array of points from the source geographic coordinate system + to the target geographic coordinate system. + + Points in the source geographic coordinate system + Points in the target geographic coordinate system + + + + Transforms an array of points from the target geographic coordinate system + to the source geographic coordinate system. + + Points in the target geographic coordinate system + Points in the source geographic coordinate system + + + + Gets or sets source geographic coordinate system for the transformation. + + + + + Gets or sets the target geographic coordinate system for the transformation. + + + + + Returns an accessor interface to the parameters for this geographic transformation. + + + + + Procedure used to measure positions on the surface of the Earth. + + + + + Gets or sets the ellipsoid of the datum. + + + + + Gets preferred parameters for a Bursa Wolf transformation into WGS84. The 7 returned values + correspond to (dx,dy,dz) in meters, (ex,ey,ez) in arc-seconds, and scaling in parts-per-million. + + + + + The ILinearUnit interface defines methods on linear units. + + + + + Gets or sets the number of meters per . + + + + + A local coordinate system, with uncertain relationship to the world. + + In general, a local coordinate system cannot be related to other coordinate + systems. However, if two objects supporting this interface have the same dimension, + axes, units and datum then client code is permitted to assume that the two coordinate + systems are identical. This allows several datasets from a common source (e.g. a CAD + system) to be overlaid. In addition, some implementations of the Coordinate + Transformation (CT) package may have a mechanism for correlating local datums. (E.g. + from a database of transformations, which is created and maintained from real-world + measurements.) + + + + + Gets or sets the local datum + + + + + Local datum. If two local datum objects have the same datum type and name, + then they can be considered equal. This means that coordinates can be + transformed between two different local coordinate systems, as long as + they are based on the same local datum. + + + + + The IParameterInfo interface provides an interface through which clients of a + Projected Coordinate System or of a Projection can set the parameters of the + projection. It provides a generic interface for discovering the names and default + values of parameters, and for setting and getting parameter values. Subclasses of + this interface may provide projection specific parameter access methods. + + + + + Returns the default parameters for this projection. + + + + + + Gets the parameter by its name + + + + + + + Gets the number of parameters expected. + + + + + Gets or sets the parameters set for this projection. + + + + + The IPrimeMeridian interface defines the standard information stored with prime + meridian objects. Any prime meridian object must implement this interface as + well as the ISpatialReferenceInfo interface. + + + + + Gets or sets the longitude of the prime meridian (relative to the Greenwich prime meridian). + + + + + Gets or sets the AngularUnits. + + + + + The IProjectedCoordinateSystem interface defines the standard information stored with + projected coordinate system objects. A projected coordinate system is defined using a + geographic coordinate system object and a projection object that defines the + coordinate transformation from the geographic coordinate system to the projected + coordinate systems. The instances of a single ProjectedCoordinateSystem COM class can + be used to model different projected coordinate systems (e.g., UTM Zone 10, Albers) + by associating the ProjectedCoordinateSystem instances with Projection instances + belonging to different Projection COM classes (Transverse Mercator and Albers, + respectively). + + + + + Gets or sets the geographic coordinate system associated with the projected + coordinate system. + + + + + Gets or sets the linear (projected) units of the projected coordinate system. + + + + + Gets or sets the projection for the projected coordinate system. + + + + + The IProjection interface defines the standard information stored with projection + objects. A projection object implements a coordinate transformation from a geographic + coordinate system to a projected coordinate system, given the ellipsoid for the + geographic coordinate system. It is expected that each coordinate transformation of + interest, e.g., Transverse Mercator, Lambert, will be implemented as a COM class of + coType Projection, supporting the IProjection interface. + + + + + Gets an indexed parameter of the projection. + + Index of parameter + n'th parameter + + + + Gets an named parameter of the projection. + + The parameter name is case insensitive + Name of parameter + parameter or null if not found + + + + Gets number of parameters of the projection. + + + + + Gets the projection classification name (e.g. 'Transverse_Mercator'). + + + + + A one-dimensional coordinate system suitable for vertical measurements. + + + + + Gets the vertical datum, which indicates the measurement method + + + + + Gets the units used along the vertical axis. + + + + + Procedure used to measure vertical distances. + + + + + A named parameter value. + + + + + Creates an instance of a parameter + + Units are always either meters or degrees. + Name of parameter + Value + + + + Parameter name + + + + + Parameter value + + + + + A named projection parameter value. + + + The linear units of parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. (Notice that this is different from , + where the units are always meters and degrees.) + + + + + Initializes an instance of a ProjectionParameter + + Name of parameter + Parameter value + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Parameter name. + + + + + Parameter value. + The linear units of a parameters' values match the linear units of the containing + projected coordinate system. The angular units of parameter values match the + angular units of the geographic coordinate system that the projected coordinate + system is based on. + + + + + Returns the Well-known text for this object + as defined in the simple features specification. + + + + + Gets an XML representation of this object + + + + + Flags indicating parts of domain covered by a convex hull. + + + These flags can be combined. For example, the value 3 + corresponds to a combination of and , + which means that some parts of the convex hull are inside the + domain, and some parts of the convex hull are outside the domain. + + + + + At least one point in a convex hull is inside the transform's domain. + + + + + At least one point in a convex hull is outside the transform's domain. + + + + + At least one point in a convex hull is not transformed continuously. + + + As an example, consider a "Longitude_Rotation" transform which adjusts + longitude coordinates to take account of a change in Prime Meridian. If + the rotation is 5 degrees east, then the point (Lat=175,Lon=0) is not + transformed continuously, since it is on the meridian line which will + be split at +180/-180 degrees. + + + + + Describes a coordinate transformation. This interface only describes a + coordinate transformation, it does not actually perform the transform + operation on points. To transform points you must use a math transform. + + + + + Human readable description of domain in source coordinate system. + + + + + Authority which defined transformation and parameter values. + + + An Authority is an organization that maintains definitions of Authority Codes. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is ‘4326’ + + + + + Code used by authority to identify transformation. An empty string is used for no code. + + The AuthorityCode is a compact string defined by an Authority to reference a particular spatial reference object. For example, the European Survey Group (EPSG) authority uses 32 bit integers to reference coordinate systems, so all their code strings will consist of a few digits. The EPSG code for WGS84 Lat/Lon is ‘4326’. + + + + Gets math transform. + + + + + Name of transformation. + + + + + Gets the provider-supplied remarks. + + + + + Source coordinate system. + + + + + Target coordinate system. + + + + + Semantic type of transform. For example, a datum transformation or a coordinate conversion. + + + + + Creates coordinate transformations. + + + + + Creates a transformation between two coordinate systems. + + + This method will examine the coordinate systems in order to construct + a transformation between them. This method may fail if no path between + the coordinate systems is found, using the normal failing behavior of + the DCP (e.g. throwing an exception). + Source coordinate system + Target coordinate system + + + + + Transforms muti-dimensional coordinate points. + + + If a client application wishes to query the source and target coordinate + systems of a transformation, then it should keep hold of the + interface, and use the contained + math transform object whenever it wishes to perform a transform. + + + + + Tests whether this transform does not move any points. + + + + + + Gets the derivative of this transform at a point. If the transform does + not have a well-defined derivative at the point, then this function should + fail in the usual way for the DCP. The derivative is the matrix of the + non-translating portion of the approximate affine map at the point. The + matrix will have dimensions corresponding to the source and target + coordinate systems. If the input dimension is M, and the output dimension + is N, then the matrix will have size [M][N]. The elements of the matrix + {elt[n][m] : n=0..(N-1)} form a vector in the output space which is + parallel to the displacement caused by a small change in the m'th ordinate + in the input space. + + + + + + + Gets transformed convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which generates a convex + hull in the source space. The returned sequence of ordinates represents a convex hull in the + output space. The number of output points will often be different from the number of input + points. Each of the input points should be inside the valid domain (this can be checked by + testing the points' domain flags individually). However, the convex hull of the input points + may go outside the valid domain. The returned convex hull should contain the transformed image + of the intersection of the source convex hull and the source domain. + A convex hull is a shape in a coordinate system, where if two positions A and B are + inside the shape, then all positions in the straight line between A and B are also inside + the shape. So in 3D a cube and a sphere are both convex hulls. Other less obvious examples + of convex hulls are straight lines, and single points. (A single point is a convex hull, + because the positions A and B must both be the same - i.e. the point itself. So the straight + line between A and B has zero length.) + Some examples of shapes that are NOT convex hulls are donuts, and horseshoes. + + + + + + + Gets flags classifying domain points within a convex hull. + + + The supplied ordinates are interpreted as a sequence of points, which + generates a convex hull in the source space. Conceptually, each of the + (usually infinite) points inside the convex hull is then tested against + the source domain. The flags of all these tests are then combined. In + practice, implementations of different transforms will use different + short-cuts to avoid doing an infinite number of tests. + + + + + + + Creates the inverse transform of this object. + + This method may fail if the transform is not one to one. However, all cartographic projections should succeed. + + + + + Transforms a coordinate point. The passed parameter point should not be modified. + + + + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a a coordinate. The input coordinate remains unchanged. + + The coordinate to transform + The transformed coordinate + + + + Transforms a list of coordinate point ordinal values. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Transforms a list of coordinates. + + + This method is provided for efficiently transforming many points. The supplied array + of ordinal values will contain packed ordinal values. For example, if the source + dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). + The size of the passed array must be an integer multiple of DimSource. The returned + ordinal values are packed in a similar way. In some DCPs. the ordinals may be + transformed in-place, and the returned array may be the same as the passed array. + So any client code should not attempt to reuse the passed ordinal values (although + they can certainly reuse the passed array). If there is any problem then the server + implementation will throw an exception. If this happens then the client should not + make any assumptions about the state of the ordinal values. + + + + + + + Reverses the transformation + + + + + Transforms a coordinate sequence. The input coordinate sequence remains unchanged. + + The coordinate sequence to transform. + The transformed coordinate sequence. + + + + Gets the dimension of input points. + + + + + Gets the dimension of output points. + + + + + Gets a Well-Known text representation of this object. + + + + + Gets an XML representation of this object. + + + + + Creates math transforms. + + + CT_MathTransformFactory is a low level factory that is used to create CT_MathTransform objects. Many high level GIS applications will never need to use a CT_MathTransformFactory directly; they can use a CT_CoordinateTransformationFactory instead. However, the CT_MathTransformFactory interface is specified here, since it can be used directly by applications that wish to transform other types of coordinates (e.g. color coordinates, or image pixel coordinates). + The following comments assume that the same vendor implements the math transform factory interfaces and math transform interfaces. + A math transform is an object that actually does the work of applying formulae to coordinate values. The math transform does not know or care how the coordinates relate to positions in the real world. This lack of semantics makes implementing CT_MathTransformFactory significantly easier than it would be otherwise. + For example CT_MathTransformFactory can create affine math transforms. The affine transform applies a matrix to the coordinates without knowing how what it is doing relates to the real world. So if the matrix scales Z values by a factor of 1000, then it could be converting meters into millimeters, or it could be converting kilometers into meters. + Because math transforms have low semantic value (but high mathematical value), programmers who do not have much knowledge of how GIS applications use coordinate systems, or how those coordinate systems relate to the real world can implement CT_MathTransformFactory. + The low semantic content of math transforms also means that they will be useful in applications that have nothing to do with GIS coordinates. For example, a math transform could be used to map color coordinates between different color spaces, such as converting (red, green, blue) colors into (hue, light, saturation) colors. + Since a math transform does not know what its source and target coordinate systems mean, it is not necessary or desirable for a math transform object to keep information on its source and target coordinate systems. + + + + + Creates an affine transform from a matrix. + + If the transform's input dimension is M, and output dimension is N, then the matrix will have size [N+1][M+1]. The +1 in the matrix dimensions allows the matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will be the j'th ordinate of the moved origin. The [i][N] element of the matrix will be 0 for i less than M, and 1 for i equals M. + + + + + + Creates a transform by concatenating two existing transforms. A concatenated transform acts in the same way as applying two transforms, one after the other. + + The dimension of the output space of the first transform must match the dimension of the input space in the second transform. If you wish to concatenate more than two transforms, then you can repeatedly use this method. + + + + + + + Creates a math transform from a Well-Known Text string. + + + + + + + Creates a math transform from XML. + + + + + + + Creates a transform from a classification name and parameters. + + + The client must ensure that all the linear parameters are expressed in meters, and all the angular parameters are expressed in degrees. Also, they must supply "semi_major" and "semi_minor" parameters for cartographic projection transforms. + + + + + + + + Creates a transform which passes through a subset of ordinates to another transform. + + + This allows transforms to operate on a subset of ordinates. For example, if you have (Lat,Lon,Height) coordinates, then you may wish to convert the height values from meters to feet without affecting the (Lat,Lon) values. If you wanted to affect the (Lat,Lon) values and leave the Height values alone, then you would have to swap the ordinates around to (Height,Lat,Lon). You can do this with an affine map. + + + + + + + + Tests whether parameter is angular. Clients must ensure that all angular parameter values are in degrees. + + + + + + + Tests whether parameter is linear. Clients must ensure that all linear parameter values are in meters. + + + + + + + Semantic type of transform used in coordinate transformation. + + + + + Unknown or unspecified type of transform. + + + + + Transform depends only on defined parameters. For example, a cartographic projection. + + + + + Transform depends only on empirically derived parameters. For example a datum transformation. + + + + + Transform depends on both defined and empirical parameters. + + + + + Parameters for a geographic transformation into WGS84. The Bursa Wolf parameters should be applied + to geocentric coordinates, where the X axis points towards the Greenwich Prime Meridian, the Y axis + points East, and the Z axis points North. + + + These parameters can be used to approximate a transformation from the horizontal datum to the + WGS84 datum using a Bursa Wolf transformation. However, it must be remembered that this transformation + is only an approximation. For a given horizontal datum, different Bursa Wolf transformations can be + used to minimize the errors over different regions. + If the DATUM clause contains a TOWGS84 clause, then this should be its “preferred” transformation, + which will often be the transformation which gives a broad approximation over the whole area of interest + (e.g. the area of interest in the containing geographic coordinate system). + Sometimes, only the first three or six parameters are defined. In this case the remaining + parameters must be zero. If only three parameters are defined, then they can still be plugged into the + Bursa Wolf formulas, or you can take a short cut. The Bursa Wolf transformation works on geocentric + coordinates, so you cannot apply it onto geographic coordinates directly. If there are only three + parameters then you can use the Molodenski or abridged Molodenski formulas. + If a datums ToWgs84Parameters parameter values are zero, then the receiving + application can assume that the writing application believed that the datum is approximately equal to + WGS84. + + + + + Initializes an instance of Wgs84ConversionInfo with default parameters (all values = 0) + + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + + + + Initializes an instance of Wgs84ConversionInfo + + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf shift in meters. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf rotation in arc seconds. + Bursa Wolf scaling in parts per million. + Area of use for this transformation + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf shift in meters. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf rotation in arc seconds. + + + + + Bursa Wolf scaling in parts per million. + + + + + Human readable text describing intended region of transformation. + + + + + Affine Bursa-Wolf matrix transformation + + + Transformation of coordinates from one geographic coordinate system into another + (also colloquially known as a "datum transformation") is usually carried out as an + implicit concatenation of three transformations: + [geographical to geocentric >> geocentric to geocentric >> geocentric to geographic + + The middle part of the concatenated transformation, from geocentric to geocentric, is usually + described as a simplified 7-parameter Helmert transformation, expressed in matrix form with 7 + parameters, in what is known as the "Bursa-Wolf" formula:
+ + S = 1 + Ppm/1000000 + [ Xt ] [ S -Ez*S +Ey*S Dx ] [ Xs ] + [ Yt ] = [ +Ez*S S -Ex*S Dy ] [ Ys ] + [ Zt ] [ -Ey*S +Ex*S S Dz ] [ Zs ] + [ 1 ] [ 0 0 0 1 ] [ 1 ] +
+ The parameters are commonly referred to defining the transformation "from source coordinate system + to target coordinate system", whereby (XS, YS, ZS) are the coordinates of the point in the source + geocentric coordinate system and (XT, YT, ZT) are the coordinates of the point in the target + geocentric coordinate system. But that does not define the parameters uniquely; neither is the + definition of the parameters implied in the formula, as is often believed. However, the + following definition, which is consistent with the "Position Vector Transformation" convention, + is common E&P survey practice: +
+ (dX, dY, dZ): Translation vector, to be added to the point's position vector in the source + coordinate system in order to transform from source system to target system; also: the coordinates + of the origin of source coordinate system in the target coordinate system + (RX, RY, RZ): Rotations to be applied to the point's vector. The sign convention is such that + a positive rotation about an axis is defined as a clockwise rotation of the position vector when + viewed from the origin of the Cartesian coordinate system in the positive direction of that axis; + e.g. a positive rotation about the Z-axis only from source system to target system will result in a + larger longitude value for the point in the target system. Although rotation angles may be quoted in + any angular unit of measure, the formula as given here requires the angles to be provided in radians. + : The scale correction to be made to the position vector in the source coordinate system in order + to obtain the correct scale in the target coordinate system. M = (1 + dS*10-6), whereby dS is the scale + correction expressed in parts per million. + for an explanation of the Bursa-Wolf transformation +
+ +
+ + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Indicates whether the current object is equal to another object of the same type. + + + + + + + Returns a hash code for the specified object + + A hash code for the specified object + + + + Checks whether the values of this instance is equal to the values of another instance. + Only parameters used for coordinate system are used for comparison. + Name, abbreviation, authority, alias and remarks are ignored in the comparison. + + + True if equal + + + + Returns the Well Known Text (WKT) for this object. + + The WKT format of this object is: TOWGS84[dx, dy, dz, ex, ey, ez, ppm] + WKT representaion + + + + Gets an XML representation of this object + + + + + Returns true of all 7 parameter values are 0.0 + + + + + + Structure for a closed 1-dimensional ℝ-interval + + + + + The lower bound of the interval + + + + + The upper bound of the interval + + + + + Initializes this structure with = = + + The value for min and max + + + + Initializes this structure with and values + + The minimum interval values + The maximum interval values + + + + Method to expand + + + + + + + + + + + + + + + + + + + Function to compute an interval that contains this and + + The interval + An interval + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval ℝ[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval ℝ[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval ℝ[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Function to test if this intersects the interval . + + + + true if this interval intersects + + + + Function to test if this intersects the interval ℝ[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval intersects the interval ℝ[, ]. + + + + Creates an empty or uninitialzed Interval + + An empty or uninitialized + + + + Creates an interval with the range ℝ[,] + + The value + An + + + + Creates an interval with the range ℝ[,].
+ If necessary, val1 and val2 are exchanged. +
+ The minimum value + The maximum value + An +
+ + + Creates an interval with the range ℝ[,]. + + The template interval + An + + + + Equality operator for s + + The left-hand-side + The right-hand-side + true if the s are equal. + + + + Inequality operator for s + + The left-hand-side + The right-hand-side + true if the s are not equal. + + + + Gets a value if this interval is empty/undefined + + + + + Gets a value indicating the width of the + + + + + Gets a value indicating the centre of the interval (Min + Width * 0.5) + + + + + A lightweight class used to store coordinates on the 2-dimensional Cartesian plane. + + It is distinct from , which is a subclass of . + Unlike objects of type (which contain additional + information such as an envelope, a precision model, and spatial reference + system information), a Coordinate only contains ordinate values + and propertied. + + + Coordinates are two-dimensional points, with an additional Z-ordinate. + If an Z-ordinate value is not specified or not defined, + constructed coordinates have a Z-ordinate of NaN + (which is also the value of ). + + + + Apart from the basic accessor functions, NTS supports + only specific operations involving the Z-ordinate. + + + + + Interface for lightweight classes used to store coordinates on the 2-dimensional Cartesian plane. + + + + + A framework replacement for the System.ICloneable interface. + + + + + Function to create a new object that is a (deep) copy of the current instance. + + A new object that is a copy of this instance. + + + + Computes the 2-dimensional distance to the coordiante. + + The other coordinate + The 2-dimensional distance to other + + + + Compares equality for x- and y-ordinates + + The other coordinate + true if x- and y-ordinates of coordinate and coordiante are equal. + + + + Compares equality for x-, y- and z-ordinates + + The other coordinate + true if x-, y- and z-ordinates of coordinate and coordiante are equal. + + + + The x-ordinate value + + + + + The y-ordinate value + + + + + The z-ordinate value + + + + + The measure value + + + + + Gets or sets all ordinate values + + + + + Gets or sets the value of this + + The index + + + + The value used to indicate a null or missing ordinate value. + In particular, used for the value of ordinates for dimensions + greater than the defined dimension of a coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + X coordinate. + + + + + Constructs a Coordinate at (x,y,z). + + X value. + Y value. + Z value. + + + + Constructs a Coordinate at (0,0,NaN). + + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate having the same (x,y,z) values as + other. + + Coordinate to copy. + + + + Constructs a Coordinate at (x,y,NaN). + + X value. + Y value. + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + Tests if another coordinate has the same value for X and Y, within a tolerance. + + A . + The tolerance value. + true if the X and Y ordinates are within the given tolerance. + The Z ordinate is ignored. + + + + Returns true if other has the same values for the x and y ordinates. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + + Coordinate with which to do the comparison. + true if other is a Coordinate with the same values for the x and y ordinates. + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if + has the same values for X, Y and Z. + + A with which to do the 3D comparison. + + true if is a + with the same values for X, Y and Z. + + + + + Tests if another coordinate has the same value for Z, within a tolerance. + + A . + The tolerance value. + true if the Z ordinates are within the given tolerance. + + + + Returns a string of the form (x,y,z) . + + string of the form (x,y,z) + + + + Create a new object as copy of this instance. + + + + + + Computes the 2-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations. + The Z-ordinate is ignored. + + + + Computes the 3-dimensional Euclidean distance to another location. + + A with which to do the distance comparison. + the 3-dimensional Euclidean distance between the locations. + + + + Gets a hashcode for this coordinate. + + A hashcode for this coordinate. + + + + Computes a hash code for a double value, using the algorithm from + Joshua Bloch's book Effective Java" + + A hashcode for the double value + + + + Returns whether the planar projections of the two Coordinates are equal. + + Coordinate with which to do the 2D comparison. + + true if the x- and y-coordinates are equal; + the Z coordinates do not have to be equal. + + + + + + + + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Compares this object with the specified object for order. + Since Coordinates are 2.5D, this routine ignores the z value when making the comparison. + Returns + -1 : this.x lowerthan other.x || ((this.x == other.x) AND (this.y lowerthan other.y)) + 0 : this.x == other.x AND this.y = other.y + 1 : this.x greaterthan other.x || ((this.x == other.x) AND (this.y greaterthan other.y)) + + Coordinate with which this Coordinate is being compared. + + A negative integer, zero, or a positive integer as this Coordinate + is less than, equal to, or greater than the specified Coordinate. + + + + + Returns true if other has the same values for x, y and z. + + Coordinate with which to do the 3D comparison. + true if other is a Coordinate with the same values for x, y and z. + + + + Computes the 2-dimensional Euclidean distance to another location. + The Z-ordinate is ignored. + + Coordinate with which to do the distance comparison. + the 2-dimensional Euclidean distance between the locations + + + + Gets or sets the ordinate value for the given index. + The supported values for the index are + , and . + + The ordinate index + The ordinate value + Thrown if is not in the valid range. + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + X coordinate. + + + + + Y coordinate. + + + + + Z coordinate. + + + + + The measure value + + + + + Gets/Sets Coordinates (x,y,z) values. + + + + + Gets/Sets the ordinate value for a given index + + The index of the ordinate + The ordinate value + + + + Defines a rectangular region of the 2D coordinate plane. + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + Defines a rectangular region of the 2D coordinate plane. + + + + It is often used to represent the bounding box of a Geometry, + e.g. the minimum and maximum x and y values of the Coordinates. + + + Note that Envelopes support infinite or half-infinite regions, by using the values of + Double.PositiveInfinity and Double.NegativeInfinity. + + + When Envelope objects are created or initialized, + the supplies extent values are automatically sorted into the correct order. + + + + + + Returns if the point specified by and is contained by the envelope. + + The x-ordinate + The y-ordinate + True if the point is contained by the envlope + + + + Returns if the point specified by is contained by the envelope. + + The point + True if the point is contained by the envlope + + + + Returns if the envelope specified by is contained by this envelope. + + The envelope to test + True if the other envelope is contained by this envlope + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Method to initialize the envelope. Calling this function will result in returning true + + + + + Method to initialize the envelope with a . Calling this function will result in an envelope having no extent but a location. + + The point + + + + Method to initialize the envelope. Calling this function will result in an envelope having the same extent as . + + The envelope + + + + Method to initialize the envelope with two s. + + The first point + The second point + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Makes this Envelope a "null" envelope.. + + + + + Gets the area of the envelope + + + + + Gets the width of the envelope + + + + + Gets the height of the envelope + + + + + Gets the maximum x-ordinate of the envelope + + + + + Gets the maximum y-ordinate of the envelope + + + + + Gets the minimum x-ordinate of the envelope + + + + + Gets the mimimum y-ordinate of the envelope + + + + + Gets the or the center of the envelope + + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Interface describing objects that can perform an intersects predicate with objects. + + The type of the component that can intersect + + + + Predicate function to test if intersects with this object. + + The object to test + true if this objects intersects with + + + + Interface describing objects that can expand themselves by objects of type . + + The type of objects that can expand clients + + + + Method to expand this object by + + The object to expand with + + + + Function to expand compute a new object that is this object by expanded by . + + The object to expand with + The expanded object + + + + Test the point q to see whether it intersects the Envelope + defined by p1-p2. + + One extremal point of the envelope. + Another extremal point of the envelope. + Point to test for intersection. + true if q intersects the envelope p1-p2. + + + + Tests whether the envelope defined by p1-p2 + and the envelope defined by q1-q2 + intersect. + + One extremal point of the envelope Point. + Another extremal point of the envelope Point. + One extremal point of the envelope Q. + Another extremal point of the envelope Q. + true if Q intersects Point + + + + Creates a null Envelope. + + + + + Creates an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Creates an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Creates an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Create an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by maximum and minimum values. + + The first x-value. + The second x-value. + The first y-value. + The second y-value. + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Makes this Envelope a "null" envelope.. + + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope. + + + + Expands this envelope by a given distance in all directions. + Both positive and negative distances are supported. + + The distance to expand the envelope along the the X axis. + The distance to expand the envelope along the the Y axis. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the given . + + Has no effect if the point is already on or within the envelope. + The value to lower the minimum x to or to raise the maximum x to. + The value to lower the minimum y to or to raise the maximum y to. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Translates this envelope by given amounts in the X and Y direction. + + The amount to translate along the X axis. + The amount to translate along the Y axis. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Use Intersects instead. + + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Check if the point (x, y) overlaps (lies inside) the region of this Envelope. + + the x-ordinate of the point. + the y-ordinate of the point. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + + + Tests if the given point lies in or on the envelope. + + the x-coordinate of the point which this Envelope is being checked for containing + the y-coordinate of the point which this Envelope is being checked for containing + true if (x, y) lies in the interior or on the boundary of this Envelope. + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + + + + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + Compares two envelopes using lexicographic ordering. + The ordering comparison is based on the usual numerical + comparison between the sequence of ordinates. + Null envelopes are less than all non-null envelopes. + + An envelope + + + + + + + Function to get a textual representation of this envelope + + A textual representation of this envelope + + + + Creates a new object that is a copy of the current instance. + + A new object that is a copy of this instance. + + + + Creates a deep copy of the current envelope. + + + + + + Calculates the union of the current box and the given point. + + + + + Calculates the union of the current box and the given coordinate. + + + + + Calculates the union of the current box and the given box. + + + + + Moves the envelope to the indicated coordinate. + + The new centre coordinate. + + + + Moves the envelope to the indicated point. + + The new centre point. + + + + Resizes the envelope to the indicated point. + + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre point. + The new width. + The new height. + + + + Moves and resizes the current envelope. + + The new centre coordinate. + The new width. + The new height. + + + + Zoom the box. + Possible values are e.g. 50 (to zoom in a 50%) or -50 (to zoom out a 50%). + + + Negative do Envelope smaller. + Positive do Envelope bigger. + + + perCent = -50 compact the envelope a 50% (make it smaller). + perCent = 200 enlarge envelope by 2. + + + + + Initialize to a null Envelope. + + + + + Initialize an Envelope for a region defined by two Coordinates. + + The first Coordinate. + The second Coordinate. + + + + Initialize an Envelope for a region defined by a single Coordinate. + + The Coordinate. + + + + Initialize an Envelope from an existing Envelope. + + The Envelope to initialize from. + + + + Enlarges this Envelope so that it contains + the given . + Has no effect if the point is already on or within the envelope. + + The Coordinate. + + + + Enlarges this Envelope so that it contains + the other Envelope. + Has no effect if other is wholly on or + within the envelope. + + the Envelope to expand to include. + + + + Computes the intersection of two s. + + The envelope to intersect with + + A new Envelope representing the intersection of the envelopes (this will be + the null envelope if either argument is null, or they do not intersect + + + + + Check if the region defined by other + overlaps (intersects) the region of this Envelope. + + the Envelope which this Envelope is + being checked for overlapping. + + + true if the Envelopes overlap. + + + + + Use Intersects instead. In the future, Overlaps may be + changed to be a true overlap check; that is, whether the intersection is + two-dimensional. + + + + + + + Use Intersects instead. + + + + + + + Check if the point p overlaps (lies inside) the region of this Envelope. + + the Coordinate to be tested. + true if the point overlaps this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + The Envelope to check + true if other is contained in this Envelope + + + + + Tests if the given point lies in or on the envelope. + + + Note that this is not the same definition as the SFS contains, + which would exclude the envelope boundary. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + + Tests if the given point lies in or on the envelope. + + the point which this Envelope is being checked for containing + true if the point lies in the interior or on the boundary of this Envelope. + + + + Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary). + + the Envelope to check + true if this Envelope covers the other + + + + Computes the distance between this and another + Envelope. + The distance between overlapping Envelopes is 0. Otherwise, the + distance is the Euclidean distance between the closest points. + + The distance between this and another Envelope. + + + + Method to parse an envelope from its value + + The envelope string + The envelope + + + + Returns true if this Envelope is a "null" envelope. + + + true if this Envelope is uninitialized + or is the envelope of the empty point. + + + + + Returns the difference between the maximum and minimum x values. + + max x - min x, or 0 if this is a null Envelope. + + + + Returns the difference between the maximum and minimum y values. + + max y - min y, or 0 if this is a null Envelope. + + + + Returns the Envelopes minimum x-value. min x > max x + indicates that this is a null Envelope. + + The minimum x-coordinate. + + + + Returns the Envelopes maximum x-value. min x > max x + indicates that this is a null Envelope. + + The maximum x-coordinate. + + + + Returns the Envelopes minimum y-value. min y > max y + indicates that this is a null Envelope. + + The minimum y-coordinate. + + + + Returns the Envelopes maximum y-value. min y > max y + indicates that this is a null Envelope. + + The maximum y-coordinate. + + + + Gets the area of this envelope. + + The area of the envelope, or 0.0 if envelope is null + + + + Gets the minimum extent of this envelope across both dimensions. + + + + + + Gets the maximum extent of this envelope across both dimensions. + + + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + Computes the coordinate of the centre of this envelope (as long as it is non-null). + + + The centre coordinate of this envelope, + or null if the envelope is null. + . + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Gets the item that is bounded + + + + + Interface for a coordinate buffer + + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Sets a m-value at the provided + + The index + The value + + + + Sets a z-value at the provided + + The index + The value + + + + Converts the contents of this to a . +
Optionally you may assign a factory to create the sequence +
+ The factory to use in order to create the sequence. + A coordinate sequence +
+ + + Gets the (current) capacity of the buffer + + + + + Gets the (current) number of coordinates in the buffer + + + + + An interface for classes which use the values of the coordinates in a . + Coordinate filters can be used to implement centroid and + envelope computation, and many other functions. + ICoordinateFilter is + an example of the Gang-of-Four Visitor pattern. + + Note: it is not recommended to use these filters to mutate the coordinates. + There is no guarantee that the coordinate is the actual object stored in the geometry. + In particular, modified values may not be preserved if the target Geometry uses a non-default . + If in-place mutation is required, use . + + + + + + + Performs an operation with or on coord. + + Coordinate to which the filter is applied. + + + + The internal representation of a list of coordinates inside a Geometry. + + This allows Geometries to store their + points using something other than the NTS class. + For example, a storage-efficient implementation + might store coordinate sequences as an array of x's + and an array of y's. + Or a custom coordinate class might support extra attributes like M-values. + + + Implementing a custom coordinate storage structure + requires implementing the and + interfaces. + To use the custom CoordinateSequence, create a + new parameterized by the CoordinateSequenceFactory + The can then be used to create new s. + The new Geometries will use the custom CoordinateSequence implementation. + + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + A copy of the i'th coordinate in the sequence + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + At least the first two dimensions must be copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + The value of the X ordinate in the index'th coordinate. + + + + Returns ordinate Y (1) of the specified coordinate. + + + The value of the Y ordinate in the index'th coordinate. + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + + If the sequence does not provide value for the required ordinate, the implementation must not throw an exception, it should return . + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The ordinate value, or if the sequence does not provide values for "/> + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + + If the sequence can't store the ordinate value, the implementation must not throw an exception, it should simply ignore the call. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. Note that + if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + Returns the kind of ordinates this sequence supplys. . + + + + + Returns the number of coordinates in this sequence. + + + + + An object that knows how to build a particular implementation of + ICoordinateSequence from an array of Coordinates. + + + + + + Returns a based on the given array; + whether or not the array is copied is implementation-dependent. + + A coordinates array, which may not be null nor contain null elements + A coordinate sequence. + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + If the requested dimension is larger than the CoordinateSequence implementation + can provide, then a sequence of maximum possible dimension should be created. + An error should not be thrown. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, and can be set. + + A coordinate sequence. + + + + Gets the Ordinate flags that sequences created by this factory can maximal cope with. + + + + + An interface for classes which process the coordinates in a . + A filter can either record information about each coordinate, + or change the value of the coordinate. + Filters can be + used to implement operations such as coordinate transformations, centroid and + envelope computation, and many other functions. + classes support the concept of applying a + CoordinateSequenceFilter to each + s they contain. + + For maximum efficiency, the execution of filters can be short-circuited by using the property. + + + + CoordinateSequenceFilter is an example of the Gang-of-Four Visitor pattern. + Note: In general, it is preferable to treat Geometrys as immutable. + Mutation should be performed by creating a new Geometry object (see + and for convenient ways to do this). + An exception to this rule is when a new Geometry has been created via . + In this case mutating the Geometry will not cause aliasing issues, + and a filter is a convenient way to implement coordinate transformation. + + + Martin Davis + + + + + + + Performs an operation on a coordinate in a . + + the CoordinateSequence to which the filter is applied + i the index of the coordinate to apply the filter to + + + + Reports whether the application of this filter can be terminated. + + + Once this method returns false, it should + continue to return false on every subsequent call. + + + + + Reports whether the execution of this filter has modified the coordinates of the geometry. + If so, will be executed + after this filter has finished being executed. + + Most filters can simply return a constant value reflecting whether they are able to change the coordinates. + + + + Geometry classes support the concept of applying + an IGeometryComponentFilter filter to the Geometry. + + + The filter is applied to every component of the Geometry + which is itself a Geometry + and which does not itself contain any components. + (For instance, all the LinearRings in Polygons are visited, + but in a MultiPolygon the Polygons themselves are not visited.) + Thus the only classes of Geometry which must be + handled as arguments to + are s, s and s. + An IGeometryComponentFilter filter can either + record information about the Geometry + or change the Geometry in some way. + IGeometryComponentFilter is an example of the Gang-of-Four Visitor pattern. + > + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned. + If geomList contains several Polygons, a + MultiPolygon is returned. + If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned. + If geomList is empty, an empty GeometryCollection + is returned. + + The Geometry to combine. + + A Geometry of the "smallest", "most type-specific" + class that can contain the elements of geomList. + + + + + Returns a clone of g based on a CoordinateSequence created by this + GeometryFactory's CoordinateSequenceFactory. + + + + + Creates a Point using the given Coordinate; a null Coordinate will create + an empty Geometry. + + The coordinate + A Point + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + The coordiante sequence. + A Point + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LineString using the given Coordinates; a null or empty array will + create an empty LineString. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A LineString + + + + Creates a LinearRing using the given Coordinates; a null or empty array will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will + create an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence possibly empty, or null. + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + The polygon + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + Geometries, each of which may be empty but not null. + + + + Creates a with the same extent as the given envelope. + + + + + Gets the coordinate sequence factory to use when creating geometries. + + + + + Gets the spatial reference id to assign when creating geometries + + + + + Gets the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + GeometryCollection classes support the concept of + applying a IGeometryFilter to the Geometry. + The filter is applied to every element Geometry. + A IGeometryFilter can either record information about the Geometry + or change the Geometry in some way. + IGeometryFilter is an example of the Gang-of-Four Visitor pattern. + + + + + Performs an operation with or on geom. + + A Geometry to which the filter is applied. + + + + Interface for basic implementation of Geometry. + + + + + Gets an array of ordinate values. + + + + + Gets the geometry at the given index + + A method moved in IGeometry + The index of the geometry to get + A geometry that is part of the + + + + Normalizes this geometry + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Gets the Well-Known-Binary representation of this geometry + + A byte array describing this geometry + + + + Gets the Well-Known-Text representation of this geometry + + A text describing this geometry + + + + Computes the convex hull for this geometry + + The convex hull + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS equals predicate. + + A geometry + true if this geometry is topologically equal to + + + + Tests whether two geometries are exactly equal + in their normalized forms. + > + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + + + + + + Returns the minimum distance between this Geometry + and the Geometry g. + + The Geometry from which to compute the distance. + + + + Performs an operation with or on this Geometry's + coordinates. If you are using this method to modify the point, be sure + to call afterwards. + Note that you cannot use this method to modify this Geometry + if its underlying 's Get method + returns a copy of the , rather than the actual + Coordinate stored (if it even stores Coordinates at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + If this method modifies any coordinate values, must be called to update the geometry state. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + Notifies this geometry that its coordinates have been changed by an external + party (using a CoordinateFilter, for example). The Geometry will flush + and/or update any information it has cached (such as its ). + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When is called, this method will be called for + this Geometry and its component geometries. + + + + + The used to create this geometry + + + + + The the used to create this. + + + + + Gets the spatial reference id + + + + + Gets the geometry type + + + + + Gets the OGC geometry type + + + + + Gets the area of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the length of this geometry if applicable, otherwise 0d + + A method moved in IGeometry + + + + Gets the number of geometries that make up this geometry + + + A method moved in IGeometry + + + + + Get the number of coordinates, that make up this geometry + + A method moved to IGeometry + + + + Gets the boundary geometry + + + + + Gets the of the boundary + + + + + Gets the centroid of the geometry + + A property moved in IGeometry + + + + Gets a that is guaranteed to be part of the geometry, usually the first. + + + + + Gets an array of s that make up this geometry. + + + + + Gets the of this geometry + + + + + Gets the envelope this would fit into. + + + + + Gets the envelope this would fit into. + + + + + Gets a point that is ensured to lie inside this geometry. + + + + + A ISurface method moved in IGeometry + + + + + Gets or sets the user data associated with this geometry + + + + + + + + + + Floating precision corresponds to the standard + double-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Floating single precision corresponds to the standard + single-precision floating-point representation, which is + based on the IEEE-754 standard + + + + + Fixed Precision indicates that coordinates have a fixed number of decimal places. + The number of decimal places is determined by the log10 of the scale factor. + + + + + Interface for classes specifying the precision model of the Coordinates in a IGeometry. + In other words, specifies the grid of allowable points for all IGeometrys. + + + + + Function to compute a precised value of + + The value to precise + The precised value + + + + Method to precise . + + The coordinate to precise + + + + Gets a value indicating the precision model type + + + + + Gets a value indicating if this precision model has floating precision + + + + + Gets a value indicating the maximum precision digits + + + + + Gets a value indicating the scale factor of a fixed precision model + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + + + Interface for surfaces + + + + + Interface for a curve + + + + + Gets a value indicating the sequence of coordinates that make up curve + + + + + Gets a value indicating the start point of the curve + + + + + Gets a value indicating the end point of the curve + + + + + Gets a value indicating that the curve is closed. + In this case an are equal. + + + + + Gets a value indicating that the curve is a ring. + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that are s. + + Martin Davis + + + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components which are s. + + Martin Davis + + + + + + Gets a value indicating whether this ring is oriented counter-clockwise. + + + + + Provides constants representing the dimensions of a point, a curve and a surface. + + + Also provides constants representing the dimensions of the empty geometry and + non-empty geometries, and the wildcard constant meaning "any dimension". + These constants are used as the entries in s. + + + + + Dimension value of a point (0). + + + + + Dimension value of a curve (1). + + + + + Dimension value of a surface (2). + + + + + Dimension value of a empty point (-1). + + + + + Dimension value of non-empty geometries (= {Point,Curve,A}). + + + + + Dimension value for any dimension (= {False, True}). + + + + + Class containing static methods for conversions + between dimension values and characters. + + + + + Symbol for the FALSE pattern matrix entry + + + + + Symbol for the TRUE pattern matrix entry + + + + + Symbol for the DONTCARE pattern matrix entry + + + + + Symbol for the P (dimension 0) pattern matrix entry + + + + + Symbol for the L (dimension 1) pattern matrix entry + + + + + Symbol for the A (dimension 2) pattern matrix entry + + + + + Converts the dimension value to a dimension symbol, + for example, True => 'T' + + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + + + + Converts the dimension symbol to a dimension value, + for example, '*' => Dontcare + + Character for use in the string representation of an IntersectionMatrix. + Possible values are T, F, * , 0, 1, 2. + Number that can be stored in the IntersectionMatrix. + Possible values are True, False, Dontcare, 0, 1, 2. + + + + Interface to identify all IGeometry subclasses that have a Dimension of + and have components that ar s. + + Martin Davis + + + + + + Enumeration of OGC Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + CircularString + + + + + CompoundCurve + + + + + CurvePolygon + + + + + MultiCurve + + + + + MultiSurface + + + + + Curve + + + + + Surface + + + + + PolyhedralSurface + + + + + TIN + + + + + Static utility functions for dealing with and dimension + + + + + Translates the -flag to a number of dimensions. + + The ordinates flag + The number of dimensions + + + + Translates a dimension value to an -flag. + + The flag for is set first. + The dimension. + The ordinates-flag + + + + Converts an encoded flag to an array of indices. + + The ordinate flags + The maximum oridinate flag that is to be checked + The ordinate indices + + + + Converts an array of values to an flag. + + An array of values + An flag. + + + + An interface for classes which prepare s + in order to optimize the performance of repeated calls to specific geometric operations. + + + + A given implementation may provide optimized implementations + for only some of the specified methods, and delegate the remaining + methods to the original operations. + + + An implementation may also only optimize certain situations, and delegate others. + See the implementing classes for documentation about which methods and situations + they optimize. + + Subclasses are intended to be thread-safe, to allow IPreparedGeometry + to be used in a multi-threaded context + (which allows extracting maximum benefit from the prepared state). + + + Martin Davis + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + + + + Tests whether the base contains a given geometry. + + + + The ContainsProperly predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry's interior. + The DE-9IM Intersection Matrix for the two geometries matches >[T**FF*FF*] + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + + + An example use case for this predicate is computing the intersections + of a set of geometries with a large polygonal geometry. + Since intersection is a fairly slow operation, it can be more efficient + to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection + known a priori to be simply the original test geometry. + + + The geometry to test + true if this geometry properly contains the given geometry + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + + + + Tests whether the base is disjoint from given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry is disjoint from the given geometry + + + + + Tests whether the base intersects a given geometry. + + + This method supports s as input + + The geometry to test + true if this geometry intersects the given geometry + + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + + + + Gets the original which has been prepared. + + + + + Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. + + + + DE-9IM matrices (such as "212FF1FF2") + specify the topological relationship between two s. + This class can also represent matrix patterns (such as "T*T******") + which are used for matching instances of DE-9IM matrices. + + + Methods are provided to: + + Set and query the elements of the matrix in a convenient fashion. + Convert to and from the standard string representation (specified in SFS Section 2.1.13.2). + Test to see if a matrix matches a given pattern string. + + + For a description of the DE-9IM and the spatial predicates derived from it, see the + OGC 99-049 OpenGIS Simple Features Specification for SQL. as well as + OGC 06-103r4 OpenGIS + Implementation Standard for Geographic information - + Simple feature access - Part 1: Common architecture + (which provides some further details on certain predicate specifications). + + The entries of the matrix are defined by the constants in the enum. + The indices of the matrix represent the topological locations + that occur in a geometry (Interior, Boundary, Exterior). + These are provided as constants in the enum. + + + + + + Internal representation of this . + + + + + Creates an with null location values. + + + + + Creates an with the given dimension + symbols. + + A string of nine dimension symbols in row major order. + + + + Creates an with the same elements as + other. + + An to copy. + + + + Adds one matrix to another. + Addition is defined by taking the maximum dimension value of each position + in the summand matrices. + + The matrix to add. + + + + Tests if the dimension value matches TRUE + (i.e. has value 0, 1, 2 or TRUE). + + A number that can be stored in the IntersectionMatrix. + Possible values are {, , , , , } + true if the dimension value matches + + + + Tests if the dimension value satisfies the dimension symbol. + + + a number that can be stored in the IntersectionMatrix. + Possible values are {True, False, Dontcare, 0, 1, 2}. + + + A character used in the string + representation of an . + Possible values are T, F, * , 0, 1, 2. + + + true if the dimension symbol encompasses the dimension value. + + + + + Tests if each of the actual dimension symbols in a matrix string satisfies the + corresponding required dimension symbol in a pattern string. + + + Nine dimension symbols to validate. + Possible values are T, F, * , 0, 1, 2. + + + Nine dimension symbols to validate + against. Possible values are T, F, * , 0, 1, 2. + + + true if each of the required dimension + symbols encompass the corresponding actual dimension symbol. + + + + + Changes the value of one of this elements. + + + The row of this , + indicating the interior, boundary or exterior of the first + + + The column of this , + indicating the interior, boundary or exterior of the second + + The new value of the element + + + + Changes the elements of this to the + dimension symbols in dimensionSymbols. + + + Nine dimension symbols to which to set this + s elements. Possible values are {T, F, * , 0, 1, 2} + + + + + Changes the specified element to minimumDimensionValue if the element is less. + + + The row of this , + indicating the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + + The dimension value with which to compare the + element. The order of dimension values from least to greatest is + True, False, Dontcare, 0, 1, 2. + + + + + If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue + if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0. + + + + + + + + For each element in this , changes the + element to the corresponding minimum dimension symbol if the element is + less. + + + Nine dimension symbols with which to + compare the elements of this . The + order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2. + + + + + Changes the elements of this to dimensionValue. + + + The dimension value to which to set this + s elements. Possible values True, False, Dontcare, 0, 1, 2}. + + + + + Returns the value of one of this s + elements. + + + The row of this , indicating + the interior, boundary or exterior of the first . + + + The column of this , + indicating the interior, boundary or exterior of the second . + + The dimension value at the given matrix position. + + + + Returns true if this is FF*FF****. + + + true if the two 's related by + this are disjoint. + + + + + Returns true if isDisjoint returns false. + + + true if the two 's related by + this intersect. + + + + + Returns true if this is + FT*******, F**T***** or F***T****. + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this touch; Returns false + if both s are points. + + + + + Returns true if this is + T*T****** (for a point and a curve, a point and an area or a line + and an area) 0******** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this cross. For this + function to return true, the s must + be a point and a curve; a point and a surface; two curves; or a curve + and a surface. + + + + + Returns true if this is + T*F**F***. + + true if the first is within the second. + + + + Returns true if this is + T*****FF*. + + true if the first contains the second. + + + + Returns true if this is T*****FF* + or *T****FF* or ***T**FF* or ****T*FF*. + + true if the first covers the second + + + + Returns true if this is T*F**F*** + or *TF**F*** or **FT*F*** or **F*TF*** + + true if the first is covered by the second + + + + Tests whether the argument dimensions are equal and + this IntersectionMatrix matches + the pattern T*F**FFF*. + + Note: This pattern differs from the one stated in + Simple feature access - Part 1: Common architecture. + That document states the pattern as TFFFTFFFT. This would + specify that + two identical POINTs are not equal, which is not desirable behaviour. + The pattern used here has been corrected to compute equality in this situation. + + The dimension of the first . + The dimension of the second . + + true if the two s + related by this are equal; the + s must have the same dimension to be equal. + + + + + Returns true if this is + T*T***T** (for two points or two surfaces) + 1*T***T** (for two curves). + + The dimension of the first . + The dimension of the second . + + true if the two + s related by this overlap. For this + function to return true, the s must + be two points, two curves or two surfaces. + + + + + Returns whether the elements of this + satisfies the required dimension symbols. + + + Nine dimension symbols with which to + compare the elements of this . Possible + values are {T, F, * , 0, 1, 2}. + + + true if this + matches the required dimension symbols. + + + + + Transposes this IntersectionMatrix. + + This as a convenience, + + + + Returns a nine-character String representation of this . + + + The nine dimension symbols of this + in row-major order. + + + + + See methods Get(int, int) and Set(int, int, int value) + + + + + The location of a relative to a + + + + + DE-9IM row index of the interior of the first point and column index of + the interior of the second point. Location value for the interior of a + point. + + int value = 0; + + + + DE-9IM row index of the boundary of the first point and column index of + the boundary of the second point. Location value for the boundary of a + point. + + int value = 1; + + + + DE-9IM row index of the exterior of the first point and column index of + the exterior of the second point. Location value for the exterior of a + point. + + int value = 2; + + + + Used for uninitialized location values. + + int value = 1; + + + + Utility class for enumeration + + + + + Converts the location value to a location symbol, for example, EXTERIOR => 'e'. + + + Either 'e', 'b', 'i' or '-'. + + + + Flags for Ordinate values + + + + + No ordinates + + + + + Flag for the x-ordinate + + + + + Flag for the y-ordinate + + + + + Flag for both x- and y-ordinate + + + + + Flag for the z-ordinate + + + + + Flag for x-, y- and z-ordinate + + + + + Flag for the m-ordinate + + + + + Flag for x-, y- and m-ordinate + + + + + Flag for x-, y-, z- and m-ordinate + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 2 + + + + + Flag for ordinate at index 10 + + + + + Flag for ordinate at index 11 + + + + + Flag for ordinate at index 12 + + + + + Flag for ordinate at index 13 + + + + + Flag for ordinate at index 14 + + + + + Flag for ordinate at index 15 + + + + + Flag for ordinate at index 16 + + + + + Flag for ordinate at index 17 + + + + + Flag for ordinate at index 18 + + + + + Flag for ordinate at index 19 + + + + + Flag for ordinate at index 20 + + + + + Flag for ordinate at index 21 + + + + + Flag for ordinate at index 22 + + + + + Flag for ordinate at index 23 + + + + + Flag for ordinate at index 24 + + + + + Flag for ordinate at index 25 + + + + + Flag for ordinate at index 26 + + + + + Flag for ordinate at index 27 + + + + + Flag for ordinate at index 28 + + + + + Flag for ordinate at index 29 + + + + + Flag for ordinate at index 30 + + + + + Flag for ordinate at index 31 + + + + + Flag for ordinate at index 32 + + + + + Standard ordinate index values. + + + + + X Ordinate = 0. + + + + + Y Ordinate = 1. + + + + + Z Ordinate = 2. + + + + + M Ordinate = 3 + + + + + Ordinate at index 2 + + + + + Ordinate at index 3 + + + + + Ordinate at index 4 + + + + + Ordinate at index 5 + + + + + Ordinate at index 6 + + + + + Ordinate at index 7 + + + + + Ordinate at index 8 + + + + + Ordinate at index 9 + + + + + Ordinate at index 10 + + + + + Ordinate at index 11 + + + + + Ordinate at index 12 + + + + + Ordinate at index 13 + + + + + Ordinate at index 14 + + + + + Ordinate at index 15 + + + + + Ordinate at index 16 + + + + + Ordinate at index 17 + + + + + Ordinate at index 18 + + + + + Ordinate at index 19 + + + + + Ordinate at index 20 + + + + + Ordinate at index 21 + + + + + Ordinate at index 22 + + + + + Ordinate at index 23 + + + + + Ordinate at index 24 + + + + + Ordinate at index 25 + + + + + Ordinate at index 26 + + + + + Ordinate at index 27 + + + + + Ordinate at index 28 + + + + + Ordinate at index 29 + + + + + Ordinate at index 30 + + + + + Ordinate at index 31 + + + + + Ordinate at index 32 + + + + + Static class that provides access to a class. + + + + + Gets or sets the instance. + + + + + Interface for classes that provide access to coordinate system and tranformation facilities. + + + + + Returns the coordinate system by identifier + + The initialization for the coordinate system + The coordinate system. + + + + Returns the coordinate system by and . + + The authority for the coordinate system + The code assigned to the coordinate system by . + The coordinate system. + + + + Method to get the identifier, by which this coordinate system can be accessed. + + The authority name + The code assigned by + The identifier or null + + + + Method to create a coordinate tranformation between two spatial reference systems, defined by their identifiers + + This is a convenience function for . + The identifier for the source spatial reference system. + The identifier for the target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Method to create a coordinate tranformation between two spatial reference systems + + The source spatial reference system. + The target spatial reference system. + A coordinate transformation, null if no transformation could be created. + + + + Delegate function to get a coordinate system from a given initialization string + + The initialization string + The type of the coordinate sytem. + + + + An interface for classes that offer access to geometry creating facillities. + + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Creates a new geometry factory, using , and . + + The geometry factory + + + + Creates a geometry fractory using and . + + + The geometry factory + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The geometry factory. + + + + Creates a geometry factory using the given along with and . + + The coordinate sequence factory to use. + The spatial reference id. + The geometry factory. + + + + Creates a geometry factory using the given , + and . + + The coordinate sequence factory to use. + The spatial reference id. + The coordinate sequence factory. + The geometry factory. + + + + Reads the configuration from the configuration + + + + + Writes the current configuration to the configuration + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Byte order + + + + + BigEndian + + + + + LittleEndian + + + + + Lightweight class that handles OGC Geometry type declaration + + + + + Initializes this instance + + The value describing the + + + + Inititalizes this instance based on a geometry and an Ordinates flag. + + The geometry. + The ordinates flag. + + + + Inititalizes this instance based on an + + The OGC geometry type + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + Indicator if a SRID is supplied. + + + + Inititalizes this instance based on an and an SRID indicator + + The OGC geometry type + The ordinates flag. + Indicator if a SRID is supplied. + + + + Gets or sets the base geometry type + + + + + Gets the OGC Well-Known-Binary type code + + + + + Gets the PostGIS Enhanced Well-Known-Binary type code + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets whether SRID value is stored along with the geometry. + + + + + Gets or sets whether z-ordinate values are stored along with the geometry. + + + + + Gets or sets whether m-ordinate values are stored along with the geometry. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Gets or sets whether z-ordinates are stored along with the geometry. + PostGis EWKB format. + + + + + Interface for input/parsing of instances. + + The type of the source to read from. + + + + Base interface for geometry reader or writer interfaces. + + + + + Gets or sets whether the SpatialReference ID must be handled. + + + + + Gets and flag that indicate which ordinates can be handled. + + + This flag must always return at least . + + + + + Gets and sets flag that indicate which ordinates shall be handled. + + + No matter which flag you supply, are always processed, + the rest is binary and 'ed with . + + + + + Reads a geometry representation from a to a Geometry. + + + The source to read the geometry from + For WKT is string, + for WKB is byte[], + + + A Geometry + + + + + Reads a geometry representation from a to a Geometry. + + The stream to read from. + A Geometry + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Interface for textual input of instances. + + + + + Interface for binary input of instances. + + + + + Interface for binary output of instances. + + The type of the output to produce. + + + + Writes a binary representation of a given geometry. + + The geometry + The binary representation of + + + + Writes a binary representation of a given geometry. + + + + + + + Interface for binary output of instances. + + + + + Gets or sets the desired + + + + + Interface for textual output of instances. + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Creates a ParseException with s detail message + + + The inner exception + + + + Buffer style. + + + + + Specifies a round line buffer end cap endCapStyle (Default). + / + + + + Specifies a butt (or flat) line buffer end cap endCapStyle. + + + + + Specifies a square line buffer end cap endCapStyle. + + + + + End cap style constants + + + + + Specifies a round line buffer end cap style. + + + + + Specifies a flat line buffer end cap style. + + + + + Specifies a square line buffer end cap style. + + + + + An interface for classes that control the parameters for the buffer building process + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + + + + Gets/Sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + qs >>= 1joins are round, and qs indicates the number of segments to use to approximate a quarter-circle. + qs = 0joins are beveled + qs < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |qs| + + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , , and . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Gets or sets the factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + Join style constants + + + + + Specifies a round join style. + + + + + Specifies a mitre join style. + + + + + Specifies a bevel join style. + + + + + A framework replacement for the System.BitConverter class + + Only partial functionality is provided! + + + + Function to convert the bits of a double to a the bits of a long + + The double value + The long value + + + + Function to convert the bits of a long to a the bits of a double + + The long value + The double value + +
+
Index: packages/NetTopologySuite.1.14/NetTopologySuite.1.14.nupkg =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net20/NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net20/NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net20/NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net20/NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,34098 @@ + + + + NetTopologySuite + + + + + An interface for rules which determine whether node points + which are in boundaries of geometry components + are in the boundary of the parent geometry collection. + The SFS specifies a single kind of boundary node rule, + the rule. + However, other kinds of Boundary Node Rules are appropriate + in specific situations (for instance, linear network topology + usually follows the .) + Some JTS operations + (such as , and ) + allow the BoundaryNodeRule to be specified, + and respect the supplied rule when computing the results of the operation. + + An example use case for a non-SFS-standard Boundary Node Rule is + that of checking that a set of s have + valid linear network topology, when turn-arounds are represented + as closed rings. In this situation, the entry road to the + turn-around is only valid when it touches the turn-around ring + at the single (common) endpoint. This is equivalent + to requiring the set of LineStrings to be + simple under the . + The SFS-standard is not + sufficient to perform this test, since it + states that closed rings have no boundary points. + + This interface and its subclasses follow the Strategy design pattern. + + Martin Davis + + + + + + + + Tests whether a point that lies in boundaryCount + geometry component boundaries is considered to form part of the boundary + of the parent geometry. + + boundaryCount the number of component boundaries that this point occurs in + true if points in this number of boundaries lie in the parent boundary + + + + Provides access to static instances of common s. + + + + + The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). + + + + + The Endpoint Boundary Node Rule. + + + + The MultiValent Endpoint Boundary Node Rule. + + + + The Monovalent Endpoint Boundary Node Rule. + + + + + The Boundary Node Rule specified by the OGC Simple Features Specification, + which is the same as the Mod-2 rule. + + + + + + A specifies that points are in the + boundary of a lineal geometry iff + the point lies on the boundary of an odd number + of components. + Under this rule s and closed + s have an empty boundary. + + + This is the rule specified by the OGC SFS, + and is the default rule used in JTS. + + Martin Davis + + + + A which specifies that any points which are endpoints + of lineal components are in the boundary of the + parent geometry. + This corresponds to the "intuitive" topological definition + of boundary. + Under this rule s have a non-empty boundary + (the common endpoint of the underlying LineString). + + + This rule is useful when dealing with linear networks. + For example, it can be used to check + whether linear networks are correctly noded. + The usual network topology constraint is that linear segments may touch only at endpoints. + In the case of a segment touching a closed segment (ring) at one point, + the Mod2 rule cannot distinguish between the permitted case of touching at the + node point and the invalid case of touching at some other interior (non-node) point. + The EndPoint rule does distinguish between these cases, + so is more appropriate for use. + + Martin Davis + + + + A which determines that only + endpoints with valency greater than 1 are on the boundary. + This corresponds to the boundary of a + being all the "attached" endpoints, but not + the "unattached" ones. + + Martin Davis + + + + A which determines that only + endpoints with valency of exactly 1 are on the boundary. + This corresponds to the boundary of a + being all the "unattached" endpoints. + + Martin Davis + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + It is also a reasonable strategy for cases where the + endpoint of one segment lies on or almost on the interior of another one. + Taking the most central endpoint ensures that the computed intersection + point lies in the envelope of the segments. + Also, by always returning one of the input points, this should result + in reducing segment fragmentation. + Intended to be used as a last resort for + computing ill-conditioned intersection situations which + cause other methods to fail. + + + WARNING: in some cases this algorithm makes a poor choice of endpoint. + It has been replaced by a better heuristic in . + + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + + Creates an instance of this class using the provided input coordinates + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + Determines a point closest to the given point. + + + + + Gets the intersection point + + + + + Computes the centroid of a of any dimension. + If the geometry is nominally of higher dimension, + but has lower effective dimension + (i.e. contains only components + having zero length or area), + the centroid will be computed as for the equivalent lower-dimension geometry. + If the input geometry is empty, a + null Coordinate is returned. + +

Algorithm

+ + Dimension 2 - the centroid ic computed + as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + Holes and multipolygons are handled correctly. + See http://www.faqs.org/faqs/graphics/algorithms-faq/ + for further details of the basic approach. + Dimension 1 - Computes the average of the midpoints + of all line segments weighted by the segment length. + Zero-length lines are treated as points. + + Dimension 0 - Compute the average coordinate over all points. + Repeated points are all included in the average + + + If the input geometries are empty, a null Coordinate is returned. +
+ 1.7 +
+ + + Computes the centroid point of a geometry. + + The geometry to use + + The centroid point, or null if the geometry is empty + + + + + the point all triangles are based at + + + + + temporary variable to hold centroid of triangle + + + + + Partial area sum + + + + + partial centroid sum + + + + + Creates a new instance for computing the centroid of a geometry + + + + + Adds a to the centroid total. + + >The to add. + + + + Gets the computed centroid. + + The computed centroid, or null if the input is empty + + + + Computes three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3. + The area is positive if the triangle is oriented CCW, and negative if CW. + + + + + Adds the line segments defined by an array of coordinates + to the linear centroid accumulators. + + An array of s + + + + Adds a point to the point centroid accumulator. + + A + + + + Computes the centroid of an area point. + + + Algorithm: + + Based on the usual algorithm for calculating + the centroid as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + + The algorithm has been extended to handle holes and multi-polygons. + See + for further details of the basic approach. + + + The code has also be extended to handle degenerate (zero-area) polygons. + In this case, the centroid of the line segments in the polygon + will be returned. + + + + + + Adds the area defined by a Geometry to the centroid total. + If the point has no area it does not contribute to the centroid. + + The point to add. + + + + Adds the area defined by an array of + coordinates. The array must be a ring; + i.e. end with the same coordinate as it starts with. + + An array of Coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3, + positive if a,b,c are oriented ccw, and negative if cw. + + + + + Adds the linear segments defined by an array of coordinates + to the linear centroid accumulators. + This is done in case the polygon(s) have zero-area, + in which case the linear centroid is computed instead. + + an array of s + + + + + + + + + + + + + + Computes the centroid of a linear point. + Algorithm: + Compute the average of the midpoints + of all line segments weighted by the segment length. + + + + + Adds the linear components of by a Geometry to the centroid total. + If the geometry has no linear components it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by an array of coordinates. + + An array of Coordinates. + + + + + + + + + Computes the centroid of a point point. + Algorithm: + Compute the average of all points. + + + + + Adds the point(s) defined by a Geometry to the centroid total. + If the point is not of dimension 0 it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by a coordinate. + + A coordinate. + + + + + + + + Basic computational geometry algorithms + for geometry and coordinates defined in 3-dimensional Cartesian space. + + @author mdavis + + + + Computes the distance between two 3D segments. + + @param A the start point of the first segment + @param B the end point of the first segment + @param C the start point of the second segment + @param D the end point of the second segment + @return the distance between the segments + + + + Implements basic computational geometry algorithms using arithmetic. + + Martin Davis + + + + A value which is safely greater than the + relative round-off error in double-precision numbers + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + Computes the sign of the determinant of the 2x2 matrix + with the given entries. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is 0. + + + + + + A filter for computing the orientation index of three coordinates. + + If the orientation can be computed safely using standard DP + arithmetic, this routine returns the orientation index. + Otherwise, a value i > 1 is returned. + In this case the orientation index must + be computed using some other more robust method. + The filter is fast to compute, so can be used to + avoid the use of slower robust methods except when they are really needed, + thus providing better average performance. + + Uses an approach due to Jonathan Shewchuk, which is in the public domain. + + + + The orientation index if it can be computed safely + > 1 if the orientation index cannot be computed safely> + + + + + + Computes an intersection point between two lines + using DD arithmetic. + Currently does not handle case of parallel lines. + + A point of 1st segment + Another point of 1st segment + A point of 2nd segment + Another point of 2nd segment + + + + + Specifies and implements various fundamental Computational Geometric algorithms. + The algorithms supplied in this class are robust for double-precision floating point. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + Returns the index of the direction of the point q + relative to a vector specified by p1-p2. + + The origin point of the vector. + The final point of the vector. + The point to compute the direction to. + + 1 if q is counter-clockwise (left) from p1-p2, + -1 if q is clockwise (right) from p1-p2, + 0 if q is collinear with p1-p2. + + + + + Tests whether a point lies inside or on a ring. + + + The ring may be oriented in either direction. + A point lying exactly on the ring boundary is considered to be inside the ring. + This method does not first check the point against the envelope + of the ring. + + Point to check for ring inclusion. + An array of s representing the ring (which must have first point identical to last point) + true if p is inside ring. + + + + + Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. + + + The ring may be oriented in either direction. + This method does not first check the point against the envelope of the ring. + + Point to check for ring inclusion + An array of coordinates representing the ring (which must have first point identical to last point) + The of p relative to the ring + + + + Tests whether a point lies on the line segments defined by a + list of coordinates. + + + + true if the point is a vertex of the line + or lies in the interior of a line segment in the linestring + + + + + Computes whether a ring defined by an array of s is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + An array of s froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + A coordinate sequence froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + The first vertex of the line segment + The second vertex of the line segment + The point to compute the relative orientation of + + 1 if q is counter-clockwise from p1-p2, + or -1 if q is clockwise from p1-p2, + or 0 if q is collinear with p1-p2 + + + + + Computes the distance from a point p to a line segment AB. + Note: NON-ROBUST! + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The distance from p to line segment AB. + + + + Computes the perpendicular distance from a point p + to the (infinite) line containing the points AB + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The perpendicular distance from p to line AB. + + + + Computes the distance from a point to a sequence of line segments. + + A point + A sequence of contiguous line segments defined by their vertices + The minimum distance between the point and the line segments + If there are too few points to make up a line (at least one?) + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates of the ring + The signed area of the ring + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates forming the ring + The signed area of the ring + + + + Computes the length of a linestring specified by a sequence of points. + + The points specifying the linestring + The length of the linestring + + + + Computes the convex hull of a . + The convex hull is the smallest convex Geometry that contains all the + points in the input Geometry. + Uses the Graham Scan algorithm. + + + + + Create a new convex hull construction for the input Geometry. + + + + + + Create a new convex hull construction for the input array. + + + + + + + + + + + + + + Returns a Geometry that represents the convex hull of the input point. + The point will contain the minimal number of points needed to + represent the convex hull. In particular, no more than two consecutive + points will be collinear. + + + If the convex hull contains 3 or more points, a Polygon; + 2 points, a LineString; + 1 point, a Point; + 0 points, an empty GeometryCollection. + + + + + Uses a heuristic to reduce the number of points scanned to compute the hull. + The heuristic is to find a polygon guaranteed to + be in (or on) the hull, and eliminate all points inside it. + A quadrilateral defined by the extremal points + in the four orthogonal directions + can be used, but even more inclusive is + to use an octilateral defined by the points in the 8 cardinal directions. + Note that even if the method used to determine the polygon vertices + is not 100% robust, this does not affect the robustness of the convex hull. + + To satisfy the requirements of the Graham Scan algorithm, + the returned array has at least 3 entries. + + + The coordinates to reduce + The reduced array of coordinates + + + + Pre sorts the coordinates + + + + + + + + + + + + + + + + + + + + Whether the three coordinates are collinear + and c2 lies between c1 and c3 inclusive. + + + + + + + + + + + + + + + + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + A 2-vertex LineString if the vertices are collinear; + otherwise, a Polygon with unnecessary (collinear) vertices removed. + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + The coordinates with unnecessary (collinear) vertices removed. + + + + Compares s for their angle and distance + relative to an origin. + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + Computes the Euclidean distance (L2 metric) from a to a . + + + Also computes two points on the geometry which are separated by the distance found. + + + + + Contains a pair of points and the distance between them. + + + Provides methods to update with a new point pair with either maximum or minimum distance. + + + + + Initializes to null. + + + + + Initializes the points. + + 1st coordinate + 2nd coordinate + + + + Initializes the points, avoiding recomputing the distance. + + 1st coordinate + 2nd coordinate + the distance between and + + + + The distance between the paired coordinates + + + + + Returns an array containing the paired points + + + + + Represents a homogeneous coordinate in a 2-D coordinate space. + In NTS s are used as a clean way + of computing intersections between line segments. + + David Skea + + + + Computes the (approximate) intersection point between two line segments using homogeneous coordinates. + + + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + 1st Coordinate of 1st linesegment + 2nd Coordinate of 1st linesegment + 1st Coordinate of 2nd linesegment + 2nd Coordinate of 2nd linesegment + + + + Computes the (approximate) intersection point between two line segments + using homogeneous coordinates. + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a homogeneous coordinate which is the intersection of the lines s. + define by the homogenous coordinates represented by two + + A coordinate + A coordinate + + + + Direct access to x private field + + + + + Direct access to y private field + + + + + Direct access to w private field + + + + + + + + + + Computes a point in the interior of an areal geometry. + + +

Algorithm:

+ + Find a Y value which is close to the centre of + the geometry's vertical extent but is different + to any of it's Y ordinates. + Create a horizontal bisector line using the Y value + and the geometry's horizontal extent + Find the intersection between the geometry + and the horizontal bisector line. + The intersection is a collection of lines and points. + Pick the midpoint of the largest intersection geometry + +

KNOWN BUGS

+ + If a fixed precision model is used, + in some cases this method may return a point + which does not lie in the interior.
+
+ + + + + + + + + + + Creates a new interior point finder + for an areal geometry. + + An areal geometry + + + + Tests the interior vertices (if any) + defined by an areal Geometry for the best inside point. + If a component Geometry is not of dimension 2 it is not tested. + + The point to add. + + + + Finds an interior point of a Polygon. + + The geometry to analyze. + + + + If point is a collection, the widest sub-point; otherwise, + the point itself. + + + + + + + + + + + + Returns the centre point of the envelope. + + The envelope to analyze. + The centre of the envelope. + + + + Gets the computed interior point. + + + + + Finds a safe bisector Y ordinate + by projecting to the Y axis + and finding the Y-ordinate interval + which contains the centre of the Y extent. + The centre of this interval is returned as the bisector Y-ordinate. + + Martin Davis + + + + Computes a point in the interior of an linear point. + Algorithm: + Find an interior vertex which is closest to + the centroid of the linestring. + If there is no interior vertex, find the endpoint which is + closest to the centroid. + + + + + + + + + + + Tests the interior vertices (if any) + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + Tests the endpoint vertices + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + + + + + + + + + + + + Computes a point in the interior of an point point. + Algorithm: + Find a point which is closest to the centroid of the point. + + + + + + + + + + + Tests the point(s) defined by a Geometry for the best inside point. + If a Geometry is not of dimension 0 it is not tested. + + The point to add. + + + + + + + + + + + + + + + An interface for classes which determine the of points in a + + Martin Davis + + + + Determines the of a point in the . + + The point to test + the location of the point in the geometry + + + + A LineIntersector is an algorithm that can both test whether + two line segments intersect and compute the intersection point(s) + if they do. + + There are three possible outcomes when determining whether two line segments intersect: + + - the segments do not intersect + - the segments intersect in a single point + - the segments are collinear and they intersect in a line segment + + + + For segments which intersect in a single point, the point may be either an endpoint + or in the interior of each segment. + If the point lies in the interior of both segments, + this is termed a proper intersection. + The property test for this situation. + + The intersection point(s) may be computed in a precise or non-precise manner. + Computing an intersection point precisely involves rounding it + via a supplied . + + LineIntersectors do not perform an initial envelope intersection test + to determine if the segments are disjoint. + This is because this class is likely to be used in a context where + envelope overlap is already known to occur (or be likely). + + + + + These are deprecated, due to ambiguous naming + + + + Indicates that line segments do not intersect + + + + + Indicates that line segments intersect in a single point + + + + + Indicates that line segments intersect in a line segment + + + + + Computes the "edge distance" of an intersection point p along a segment. + The edge distance is a metric of the point along the edge. + The metric used is a robust and easy to compute metric function. + It is not equivalent to the usual Euclidean metric. + It relies on the fact that either the x or the y ordinates of the + points in the edge are unique, depending on whether the edge is longer in + the horizontal or vertical direction. + NOTE: This function may produce incorrect distances + for inputs where p is not precisely on p1-p2 + (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. + My hypothesis is that the function is safe to use for points which are the + result of rounding points which lie on the line, but not safe to use for truncated points. + + + + + This function is non-robust, since it may compute the square of large numbers. + Currently not sure how to improve this. + + + + + The indexes of the endpoints of the intersection lines, in order along + the corresponding line + + + + + If MakePrecise is true, computed intersection coordinates will be made precise + using Coordinate.MakePrecise. + + + + + Gets an endpoint of an input segment. + + the index of the input segment (0 or 1) + the index of the endpoint (0 or 1) + The specified endpoint + + + + Compute the intersection of a point p and the line p1-p2. + This function computes the bool value of the hasIntersection test. + The actual value of the intersection (if there is one) + is equal to the value of p. + + + + + Computes the intersection of the lines p1-p2 and p3-p4. + This function computes both the bool value of the hasIntersection test + and the (approximate) value of the intersection point itself (if there is one). + + + + + Returns the intIndex'th intersection point. + + is 0 or 1. + The intIndex'th intersection point. + + + + Test whether a point is a intersection point of two line segments. + Note that if the intersection is a line segment, this method only tests for + equality with the endpoints of the intersection segment. + It does not return true if the input point is internal to the intersection segment. + + true if the input point is one of the intersection points. + + + + Tests whether either intersection point is an interior point of one of the input segments. + + + true if either intersection point is in the interior of one of the input segment. + + + + + Tests whether either intersection point is an interior point of the specified input segment. + + + true if either intersection point is in the interior of the input segment. + + + + + Computes the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The intIndex'th intersection point in the direction of the specified input line segment. + + + + + Computes the index (order) of the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The index of the intersection point along the segment (0 or 1). + + + + + Computes the intersection line index + + The segment index + + + + Computes the "edge distance" of an intersection point along the specified input line segment. + + is 0 or 1. + is 0 or 1. + The edge distance of the intersection point. + + + + Alias the [0] for ease of reference + + + + + Alias the [1] for ease of reference + + + + + Force computed intersection to be rounded to a given precision model + + + + + Force computed intersection to be rounded to a given precision model. + No getter is provided, because the precision model is not required to be specified. + + + + + Tests whether the input geometries intersect. + + true if the input geometries intersect. + + + + Returns the number of intersection points found. This will be either 0, 1 or 2. + + The number of intersection points found (0, 1, or 2) + + + + Tests whether an intersection is proper. + The intersection between two line segments is considered proper if + they intersect in a single point in the interior of both segments + (e.g. the intersection is a single point and is not equal to any of the endpoints). + The intersection between a point and a line segment is considered proper + if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). + + true if the intersection is proper. + + + + Determines the location of s relative to + a geometry, using indexing for efficiency. + This algorithm is suitable for use in cases where + many points will be tested against a given area. + + Thread-safe and immutable. + + Martin Davis + + + + An interface for classes which determine the of + points in areal geometries. + + Martin Davis + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + Creates a new locator for a given . + + the Geometry to locate in + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + + A visitor for items in an index. + + + + + + + + + + + Static methods for classes + + + + + Convenience method to test a point for intersection with a geometry + + The geometry is wrapped in a class. + + The locator to use. + The coordinate to test. + true if the point is in the interior or boundary of the geometry. + + + Computes the location of points relative to an areal , using a simple O(n) algorithm. + This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. + + The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. + + + + Determines the of a point in an areal . Currently this will never return a value of . + + The point to test + The areal geometry to test + The Location of the point in the geometry + + + + Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. + + The point to test + A linear ring + true if the point lies inside the ring + + + + Measures the degree of similarity between two s + using the area of intersection between the geometries. + The measure is normalized to lie in the range [0, 1]. + Higher measures indicate a great degree of similarity. + + + NOTE: Currently experimental and incomplete. + + mbdavis + + + + An interface for classes which measures the degree of similarity between two {@link Geometry}s. + + + The computed measure lies in the range [0, 1]. + Higher measures indicate a great degree of similarity. + A measure of 1.0 indicates that the input geometries are identical + A measure of 0.0 indicates that the geometries have essentially no similarity. + The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. + + mbdavis + + + + Function to measure the similarity between two s. + + A geometry + A geometry + The similarity value between two s + + + + Measures the degree of similarity between two s using the Hausdorff distance metric. + + + + The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. + + + The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing + this by dividing it by the diagonal distance across the envelope of the combined geometries. + + + mbdavis + + + + + + + + + + + Provides methods to mathematically combine values. + + Martin Davis + + + + + + + + + + + + Implements IPointInRing + using a MonotoneChains and a BinTree index to increase performance. + + + + + + An interface for classes which test whether a Coordinate lies inside a ring. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The action for the internal iterator for performing + envelope select queries on a MonotoneChain. + + + + + These envelopes are used during the MonotoneChain search process. + + + + + + + + + + This method is overridden to process a segment + in the context of the parent chain. + + The parent chain + The index of the start vertex of the segment being processed + + + + This is a convenience method which can be overridden to obtain the actual + line segment which is selected. + + + + + + + + + + + + + + + + + + + Computes the Minimum Bounding Circle (MBC) for the points in a . + The MBC is the smallest circle which covers all the input points + (this is also sometimes known as the Smallest Enclosing Circle). + This is equivalent to computing the Maximum Diameter of the input point set. + + + + The computed circle can be specified in two equivalent ways, + both of which are provide as output by this class: + + As a centre point and a radius + By the set of points defining the circle. + + Depending on the number of points in the input + and their relative positions, this + will be specified by anywhere from 0 to 3 points. + + 0 or 1 points indicate an empty or trivial input point arrangment. + 2 or 3 points define a circle which contains + all the input points. + + + + + The class can also output a which approximates the + shape of the MBC (although as an approximation it is not + guaranteed to cover all the input points.) + + Martin Davis + + + The algorithm used is based on the one by Jon Rokne in + the article "An Easy Bounding Circle" in Graphic Gems II. + + + + Creates a new object for computing the minimum bounding circle for the + point set defined by the vertices of the given geometry. + + The geometry to use to obtain the point set + + + + Gets a geometry which represents the Minimum Bounding Circle. + + + + If the input is degenerate (empty or a single unique point), + this method will return an empty geometry or a single Point geometry. + Otherwise, a Polygon will be returned which approximates the + Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) + + + A Geometry representing the Minimum Bounding Circle. + + + + Gets a geometry representing a line between the two farthest points + in the input. + These points will be two of the extremal points of the Minimum Bounding Circle. + They also lie on the convex hull of the input. + + A LineString between the two farthest points of the input + An empty LineString if the input is empty + A Point if the input is a point + + + + Gets a geometry representing the diameter of the computed Minimum Bounding Circle. + + + + the diameter line of the Minimum Bounding Circle + an empty line if the input is empty + a Point if the input is a point + + + + + + Gets the extremal points which define the computed Minimum Bounding Circle. + + + There may be zero, one, two or three of these points, + depending on the number of points in the input + and the geometry of those points. + + The points defining the Minimum Bounding Circle + + + + Gets the centre point of the computed Minimum Bounding Circle. + + the centre point of the Minimum Bounding Circle, null if the input is empty + + + + Gets the radius of the computed Minimum Bounding Circle. + + The radius of the Minimum Bounding Circle + + + + Computes the minimum diameter of a . + + + + The minimum diameter is defined to be the + width of the smallest band that contains the point, + where a band is a strip of the plane defined + by two parallel lines. + This can be thought of as the smallest hole that the point can be + moved through, with a single rotation. + + + The first step in the algorithm is computing the convex hull of the Geometry. + If the input Geometry is known to be convex, a hint can be supplied to + avoid this computation. + + + This class can also be used to compute a line segment representing + the minimum diameter, the supporting line segment of the minimum diameter, + and a minimum rectangle enclosing the input geometry. + This rectangle will + have width equal to the minimum diameter, and have one side + parallel to the supporting segment. + + + + + + + Gets the minimum rectangle enclosing a geometry. + + The geometry + The minimum rectangle enclosing the geometry + + + + Gets the minimum diameter enclosing a geometry. + + The geometry + The length of the minimum diameter of the geometry + + + + Compute a minimum diameter for a given . + + a Geometry. + + + + Compute a minimum diameter for a giver Geometry, + with a hint if + the Geometry is convex + (e.g. a convex Polygon or LinearRing, + or a two-point LineString, or a Point). + + a Geometry which is convex. + true if the input point is convex. + + + + + + + + + + + + + + + Compute the width information for a ring of Coordinates. + Leaves the width information in the instance variables. + + + + + + + + + + + + + + + + + + + + + + + Gets the minimum rectangular which encloses the input geometry. + + + + The rectangle has width equal to the minimum diameter, and a longer length. + If the convex hull of the input is degenerate (a line or point) a or is returned. + + + The minimum rectangle can be used as an extremely generalized representation for the given geometry. + + + The minimum rectangle enclosing the input (or a line or point if degenerate) + + + + Gets the length of the minimum diameter of the input Geometry. + + The length of the minimum diameter. + + + + Gets the Coordinate forming one end of the minimum diameter. + + A coordinate forming one end of the minimum diameter. + + + + Gets the segment forming the base of the minimum diameter. + + The segment forming the base of the minimum diameter. + + + + Gets a LineString which is a minimum diameter. + + A LineString which is a minimum diameter. + + + + Non-robust versions of various fundamental Computational Geometric algorithms, + FOR TESTING PURPOSES ONLY!. + The non-robustness is due to rounding error in floating point computation. + + + + + + + + + + + + + Computes whether a ring defined by an array of Coordinate is + oriented counter-clockwise. + This will handle coordinate lists which contain repeated points. + + an array of coordinates forming a ring. + + true if the ring is oriented counter-clockwise. + throws ArgumentException if the ring is degenerate (does not contain 3 different points) + + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + 1 if q is counter-clockwise from p1-p2 + -1 if q is clockwise from p1-p2 + 0 if q is collinear with p1-p2 + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + the origin point of the vector + the final point of the vector + the point to compute the direction to + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + A non-robust version of LineIntersector. + + + + + + + + + + true if both numbers are positive or if both numbers are negative, + false if both numbers are zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RParameter computes the parameter for the point p + in the parameterized equation + of the line from p1 to p2. + This is equal to the 'distance' of p along p1-p2. + + + + + + + + + + + + + + + Computes the topological relationship () of a single point to a Geometry. + + + A may be specified to control the evaluation of whether the point lies on the boundary or not + The default rule is to use the the SFS Boundary Determination Rule + + Notes: + + s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. + + Instances of this class are not reentrant. + + + + + + Initializes a new instance of the class. + + + + + Convenience method to test a point for intersection with a Geometry + + The coordinate to test. + The Geometry to test. + true if the point is in the interior or boundary of the Geometry. + + + + Computes the topological relationship ({Location}) of a single point to a Geometry. + It handles both single-element and multi-element Geometries. + The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. + + The Location of the point relative to the input Geometry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the number of segments crossed by a horizontal ray extending to the right + from a given point, in an incremental fashion. + This can be used to determine whether a point lies in a geometry. + The class determines the situation where the point lies exactly on a segment. + When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. + + + This class handles polygonal geometries with any number of shells and holes. + The orientation of the shell and hole rings is unimportant. + In order to compute a correct location for a given polygonal geometry, + it is essential that all segments are counted which + + touch the ray + lie in in any ring which may contain the point + + + The only exception is when the point-on-segment situation is detected, in which + case no further processing is required. + The implication of the above rule is that segments which can be a priori determined to not touch the ray + (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. + + + Martin Davis + + + + Determines the of a point in a ring. + This method is an exemplar of how to use this class. + + The point to test + An array of Coordinates forming a ring + The location of the point in the ring + + + + Determines the of a point in a ring. + + The point to test + A coordinate sequence forming a ring + The location of the point in the ring + + + + Counts a segment + + An endpoint of the segment + Another endpoint of the segment + + + + Reports whether the point lies exactly on one of the supplied segments. + + This method may be called at any time as segments are processed. If the result of this method is true, + no further segments need be supplied, since the result will never change again. + + + + + + Gets the of the point relative to the ring, polygon + or multipolygon from which the processed segments were provided. + + This property only determines the correct location if all relevant segments have been processed + + + + Tests whether the point lies in or on the ring, polygon + + + This property only determines the correct location if all relevant segments have been processed + + + + Computes whether a rectangle intersects line segments. + + + Rectangles contain a large amount of inherent symmetry + (or to put it another way, although they contain four + coordinates they only actually contain 4 ordinates + worth of information). + The algorithm used takes advantage of the symmetry of + the geometric situation + to optimize performance by minimizing the number + of line intersection tests. + + Martin Davis + + + + Creates a new intersector for the given query rectangle, + specified as an . + + The query rectangle, specified as an Envelope + + + + Tests whether the query rectangle intersects a given line segment. + + The first endpoint of the segment + The second endpoint of the segment + true if the rectangle intersects the segment + + + + Implements an algorithm to compute the + sign of a 2x2 determinant for double precision values robustly. + It is a direct translation of code developed by Olivier Devillers. + + The original code carries the following copyright notice: + ************************************************************************ + Author : Olivier Devillers + Olivier.Devillers@sophia.inria.fr + http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html + + Olivier Devillers has allowed the code to be distributed under + the LGPL (2012-02-16) saying "It is ok for LGPL distribution." + + ************************************************************************* + ************************************************************************* + Copyright (c) 1995 by INRIA Prisme Project + BP 93 06902 Sophia Antipolis Cedex, France. + All rights reserved + ************************************************************************* + + + + + Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is null. + + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + A robust version of . + + + + + + + + + + + + + + + + + + + + + + + This method computes the actual value of the intersection point. + To obtain the maximum precision from the intersection calculation, + the coordinates are normalized by subtracting the minimum + ordinate values (in absolute value). This has the effect of + removing common significant digits from the calculation to + maintain more bits of precision. + + + + + + + + + + Computes a segment intersection using homogeneous coordinates. + Round-off error can cause the raw computation to fail, + (usually due to the segments being approximately parallel). + If this happens, a reasonable approximation is computed instead. + + + + + Normalize the supplied coordinates to + so that the midpoint of their intersection envelope + lies at the origin. + + + + + Tests whether a point lies in the envelopes of both input segments. + A correctly computed intersection point should return true + for this test. + Since this test is for debugging purposes only, no attempt is + made to optimize the envelope test. + + + true if the input point lies within both input segment envelopes. + + + + Finds the endpoint of the segments P and Q which + is closest to the other segment. + This is a reasonable surrogate for the true + intersection points in ill-conditioned cases + (e.g. where two segments are nearly coincident, + or where the endpoint of one segment lies almost on the other segment). + + + This replaces the older CentralEndpoint heuristic, + which chose the wrong endpoint in some cases + where the segments had very distinct slopes + and one endpoint lay almost on the other segment. + + an endpoint of segment P + an endpoint of segment P + an endpoint of segment Q + an endpoint of segment Q + the nearest endpoint to the other segment + + + + Tests whether a Coordinate lies inside + a ring, using a linear-time algorithm. + + + + + + + + + + + + + + + + + + + + + + + Implements PointInRing using a SIRtree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all ICRSObject implementing types + + + + + Base Interface for CRSBase Object types. + + + + + Gets the CRS type. + + + + + Gets the type of the CRSBase object. + + + + + Gets the properties. + + + + + Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. + + + + + Defines the Named CRS type. + + + + + Defines the Linked CRS type. + + + + + Defines the Linked CRS type. + + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Defines the Named CRS type. + + + + + Initializes a new instance of the class. + + + The mandatory name + member must be a string identifying a coordinate reference system. OGC CRS URNs such as + 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. + + + + + A graph containing s. + + + + + A graph comprised of s. + It supports tracking the vertices in the graph + via edges incident on them, + to allow efficient lookup of edges and vertices. + + + This class may be subclassed to use a + different subclass of HalfEdge, + by overriding . + If additional logic is required to initialize + edges then + can be overridden as well. + + + + + Creates a single HalfEdge. + Override to use a different HalfEdge subclass. + + the origin location + a new with the given origin + + + + Adds an edge between the coordinates orig and dest + to this graph. + + + Only valid edges can be added (in particular, zero-length segments cannot be added) + + the edge origin location + the edge destination location + The created edge + null if the edge was invalid and not added + + + + + Test if an the coordinates for an edge form a valid edge (with non-zero length) + + The start coordinate + The end coordinate + true of the edge formed is valid + + + + Inserts an edge not already present into the graph. + + the edge origin location + the edge destination location + an existing edge with same orig (if any) + the created edge + + + + Finds an edge in this graph with the given origin + and destination, if one exists. + + the origin location + the destination location + an edge with the given orig and dest, or null if none exists + + + + A HalfEdge which carries information + required to support . + + + + + A which supports + marking edges with a boolean flag. + Useful for algorithms which perform graph traversals. + + + + + Represents a directed component of an edge in an . + HalfEdges link vertices whose locations are defined by s. + HalfEdges start at an origin vertex, + and terminate at a destination vertex. + HalfEdges always occur in symmetric pairs, with the method + giving access to the oppositely-oriented component. + HalfEdges and the methods on them form an edge algebra, + which can be used to traverse and query the topology + of the graph formed by the edges. + + + By design HalfEdges carry minimal information + about the actual usage of the graph they represent. + They can be subclassed to carry more information if required. + + + HalfEdges form a complete and consistent data structure by themselves, + but an is useful to allow retrieving edges + by vertex and edge location, as well as ensuring + edges are created and linked appropriately. + + + + + Creates a HalfEdge pair representing an edge + between two vertices located at coordinates p0 and p1. + + a vertex coordinate + a vertex coordinate + the HalfEdge with origin at p0 + + + + Initialize a symmetric pair of HalfEdges. + Intended for use by subclasses. + The edges are initialized to have each other + as the edge, and to have pointers + which point to edge other. + This effectively creates a graph containing a single edge. + + a HalfEdge + a symmetric HalfEdge + the initialized edge e0 + + + + Creates an edge originating from a given coordinate. + + the origin coordinate + + + + Finds the edge starting at the origin of this edge + with the given dest vertex, if any. + + the dest vertex to search for + + the edge with the required dest vertex, + if it exists, or null + + + + + Tests whether this edge has the given orig and dest vertices. + + the origin vertex to test + the destination vertex to test + true if the vertices are equal to the ones of this edge + + + + Inserts an edge + into the ring of edges around the origin vertex of this edge. + The inserted edge must have the same origin as this edge. + + the edge to insert + + + + Insert an edge with the same origin after this one. + Assumes that the inserted edge is in the correct + position around the ring. + + the edge to insert (with same origin) + + + + Compares edges which originate at the same vertex + based on the angle they make at their origin vertex with the positive X-axis. + This allows sorting edges around their origin vertex in CCW order. + + + + + Implements the total order relation. + The angle of edge a is greater than the angle of edge b, + where the angle of an edge is the angle made by + the first segment of the edge with the positive x-axis. + When applied to a list of edges originating at the same point, + this produces a CCW ordering of the edges around the point. + Using the obvious algorithm of computing the angle is not robust, + since the angle calculation is susceptible to roundoff error. + + + A robust algorithm is: + 1. compare the quadrants the edge vectors lie in. + If the quadrants are different, + it is trivial to determine which edge has a greater angle. + 2. If the vectors lie in the same quadrant, the + function + can be used to determine the relative orientation of the vectors. + + + + + Computes a string representation of a HalfEdge. + + + + + Computes the degree of the origin vertex. + The degree is the number of edges + originating from the vertex. + + the degree of the origin vertex + + + + Finds the first node previous to this edge, if any. + If no such node exists (i.e the edge is part of a ring) + then null is returned. + + + an edge originating at the node prior to this edge, if any, + or null if no node exists + + + + + Gets the origin coordinate of this edge. + + + + + Gets the destination coordinate of this edge. + + + + + Gets the symmetric pair edge of this edge. + + + + + Gets the next edge CCW around the + destination vertex of this edge. + If the vertex has degree 1 then this is the sym edge. + + + + + Returns the edge previous to this one + (with dest being the same as this orig). + + + + + The X component of the distance between the orig and dest vertices. + + + + + The Y component of the distance between the orig and dest vertices. + + + + + Sets the mark for the given edge pair to a boolean value. + + an edge of the pair to update + the mark value to set + + + + Marks the edges in a pair. + + an edge of the pair to mark + + + + Creates a new marked edge. + + the coordinate of the edge origin + + + + Marks this edge. + + + + + Sets this edge to be the start segment of an input LineString. + + + + + Tests whether this edge is the starting segment + in a LineString being dissolved. + + true if this edge is a start segment + + + + Dissolves the linear components + from a collection of s. + into a set of maximal-length s + in which every unique segment appears once only. + The output linestrings run between node vertices + of the input, which are vertices which have + either degree 1, or degree 3 or greater. + + + Use cases for dissolving linear components + include generalization + (in particular, simplifying polygonal coverages), + and visualization + (in particular, avoiding symbology conflicts when + depicting shared polygon boundaries). + + + This class does NOT node the input lines. + If there are line segments crossing in the input, + they will still cross in the output. + + + + + Dissolves the linear components in a geometry. + + the geometry to dissolve + the dissolved lines + + + + Adds a to be dissolved. + Any number of geometries may be adde by calling this method multiple times. + Any type of Geometry may be added. The constituent linework will be + extracted to be dissolved. + + geometry to be line-merged + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + the geometries to be line-merged + + + + Gets the dissolved result as a . + + the dissolved lines + + + + For each edge in stack + (which must originate at a node) + extracts the line it initiates. + + + + + Updates the tracked ringStartEdge + if the given edge has a lower origin + (using the standard ordering). + + + Identifying the lowest starting node meets two goals: + * It ensures that isolated input rings are created using the original node and orientation. + * For isolated rings formed from multiple input linestrings, + it provides a canonical node and orientation for the output + (rather than essentially random, and thus hard to test). + + + + + + Builds a line starting from the given edge. + The start edge origin is a node (valence = 1 or >= 3), + unless it is part of a pure ring. + + + A pure ring has no other incident lines. + In this case the start edge may occur anywhere on the ring. + + + The line is built up to the next node encountered, + or until the start edge is re-encountered + (which happens if the edges form a ring). + + + + + + Adds edges around this node to the stack. + + + + + + Builds an edge graph from geometries containing edges. + + + + + Adds the edges of a Geometry to the graph. + May be called multiple times. + Any dimension of Geometry may be added; the constituent edges are extracted. + + geometry to be added + + + + Adds the edges in a collection of s to the graph. + May be called multiple times. + Any dimension of may be added. + + the geometries to be added + + + + Represents a feature collection. + + + + + Initializes a new instance of the class. + + The features. + + + + Initializes a new instance of the class. + + + + + Adds the specified feature. + + The feature. + + + + Removes the specified feature. + + The feature. + true if item is successfully removed; otherwise, false. This method also returns + false if item was not found in the collection. + + + + Removes the element at the specified index of the collection. + + The index. + + + + Gets the features. + + The features. + + + + Gets the (mandatory) type of the GeoJSON Object. + + + The type of the object. + + + + + Gets or sets the (optional) Coordinate Reference System Object. + + + The Coordinate Reference System Objects. + + + + + Returns the indexTh element in the collection. + + + + + + Returns the number of features contained by this . + + + + + A representation of a planar, linear vector geometry. + + + +

Binary Predicates:

+ Because it is not clear at this time what semantics for spatial + analysis methods involving GeometryCollections would be useful, + GeometryCollections are not supported as arguments to binary + predicates or the Relate method. +
+ +

Overlay Methods:

+ The spatial analysis methods will + return the most specific class possible to represent the result. If the + result is homogeneous, a Point, LineString, or + Polygon will be returned if the result contains a single + element; otherwise, a MultiPoint, MultiLineString, + or MultiPolygon will be returned. If the result is + heterogeneous a GeometryCollection will be returned. +
+ + Representation of Computed Geometries: + The SFS states that the result + of a set-theoretic method is the "point-set" result of the usual + set-theoretic definition of the operation (SFS 3.2.21.1). However, there are + sometimes many ways of representing a point set as a Geometry. + The SFS does not specify an unambiguous representation of a given point set + returned from a spatial analysis method. One goal of NTS is to make this + specification precise and unambiguous. NTS uses a canonical form for + Geometrys returned from overlay methods. The canonical + form is a Geometry which is simple and noded: + Simple means that the Geometry returned will be simple according to + the NTS definition of IsSimple. + Noded applies only to overlays involving LineStrings. It + means that all intersection points on LineStrings will be + present as endpoints of LineStrings in the result. + This definition implies that non-simple geometries which are arguments to + spatial analysis methods must be subjected to a line-dissolve process to + ensure that the results are simple. + + + Constructed Points And The Precision Model: + The results computed by the set-theoretic methods may + contain constructed points which are not present in the input Geometrys. + These new points arise from intersections between line segments in the + edges of the input Geometrys. In the general case it is not + possible to represent constructed points exactly. This is due to the fact + that the coordinates of an intersection point may contain twice as many bits + of precision as the coordinates of the input line segments. In order to + represent these constructed points explicitly, NTS must truncate them to fit + the PrecisionModel. + Unfortunately, truncating coordinates moves them slightly. Line segments + which would not be coincident in the exact result may become coincident in + the truncated representation. This in turn leads to "topology collapses" -- + situations where a computed element has a lower dimension than it would in + the exact result. + When NTS detects topology collapses during the computation of spatial + analysis methods, it will throw an exception. If possible the exception will + report the location of the collapse. + + + +

Geometry Equality

+ There are two ways of comparing geometries for equality: + structural equality and topological equality. +

Structural Equality

+ Structural Equality is provided by the + method. + This implements a comparison based on exact, structural pointwise + equality. + The is a synonym for this method, + to provide structural equality semantics for + use in collections. + It is important to note that structural pointwise equality + is easily affected by things like + ring order and component order. In many situations + it will be desirable to normalize geometries before + comparing them (using the + or methods). + is provided + as a convenience method to compute equality over + normalized geometries, but it is expensive to use. + Finally, + allows using a tolerance value for point comparison. + +

Topological Equality

+ Topological Equality is provided by the + method. + It implements the SFS definition of point-set equality + defined in terms of the DE-9IM matrix. + To support the SFS naming convention, the method + is also provided as a synonym. + However, due to the potential for confusion with + its use is discouraged. + + Since and are overridden, + Geometries can be used effectively in .Net collections. + +
+
+ + + + + + + An object reference which can be used to carry ancillary data defined + by the client. + + + + The bounding box of this Geometry. + + + + + Creates a new Geometry via the specified GeometryFactory. + + The factory + + + + Returns true if the array contains any non-empty Geometrys. + + an array of Geometrys; no elements may be null + + true if any of the Geometrys + IsEmpty methods return false. + + + + + Returns true if the array contains any null elements. + + an array to validate. + true if any of arrays elements are null. + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + Returns an element Geometry from a GeometryCollection, + or this, if the geometry is not a collection. + + The index of the geometry element. + The n'th geometry contained in this geometry. + + + + Returns the minimum distance between this Geometry + and another Geometry g. + + The Geometry from which to compute the distance. + The distance between the geometries + 0 if either input geometry is empty + if g is null + + + + Tests whether the distance from this Geometry + to another is less than or equal to a specified value. + + the Geometry to check the distance to. + the distance value to compare. + true if the geometries are less than distance apart. + + + + Notifies this geometry that its coordinates have been changed by an external + party (for example, via a ). + + + When this method is called the geometry will flush + and/or update any derived information it has cached (such as its ). + The operation is applied to all component Geometries. + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When GeometryChanged is called, this method will be called for + this Geometry and its component Geometries. + + + + + Tests whether this geometry is disjoint from the argument geometry. + + + The Disjoint predicate has the following equivalent definitions: + + The DE-9IM intersection matrix for the two geometries matches FF*FF****. + !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
+
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys are disjoint. + +
+ + + Tests whether this geometry touches the argument geometry + + + The Touches predicate has the following equivalent definitions: + + The geometries have at least one point in common, + but their interiors do not intersect + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns + + FT*******, + F**T***** or + F***T****. + + + If both geometries have dimension 0, the predicate returns false, + since points have only interiors. + This predicate is symmetric. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys touch; + Returns false if both Geometrys are points. + + + + + Tests whether this geometry intersects the argument geometry. + + + The Intersects predicate has the following equivalent definitions: + + The two geometries have at least one point in common + The DE-9IM Intersection Matrix for the two geometries matches
+ [T********] or
+ [*T*******] or
+ [***T*****] or
+ [****T****]
+ !g.disjoint(this)
+ (Intersects is the inverse of Disjoint)
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys intersect. + +
+ + + Tests whether this geometry crosses the specified geometry. + + + The Crosses predicate has the following equivalent definitions: + + The geometries have some but not all interior points in common. + The DE-9IM Intersection Matrix for the two geometries matches + one of the following patterns: + + CodeDescription + [T*T******]for P/L, P/A, and L/A situations + [T*****T**]for L/P, A/P, and A/L situations) + [0********]for L/L situations + + + + For any other combination of dimensions this predicate returns false. + + The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. + In order to make the relation symmetric, + NTS extends the definition to apply to L/P, A/P and A/L situations as well. + + + The Geometry with which to compare this Geometry + true if the two Geometrys cross. + + + + Tests whether this geometry is within the specified geometry. + + + The within predicate has the following equivalent definitions: + + + Every point of this geometry is a point of the other geometry, + and the interiors of the two geometries have at least one point in common. + + The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] + g.contains(this) == true
(Within is the converse of )
+
+ + An implication of the definition is that "The boundary of a geometry is not within the Polygon". + In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false + (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) + For a predicate with similar behaviour but avoiding + this subtle limitation, see . + +
+ The Geometry with which to compare this Geometry. + true if this Geometry is within other. + + +
+ + + + Tests whether this geometry overlaps the specified geometry. + + + The Overlaps predicate has the following equivalent definitions: + + The geometries have at least one point each not shared by the other (or equivalently neither covers the other), + they have the same dimension, + and the intersection of the interiors of the two geometries has + the same dimension as the geometries themselves. + The DE-9IM Intersection Matrix for the two geometries matches + [T*T***T**] (for two points or two surfaces) + or [1*T***T**] (for two curves) + + If the geometries are of different dimension this predicate returns false. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys overlap. + For this function to return true, the Geometry + s must be two points, two curves or two surfaces. + + + + + Tests whether this geometry covers the argument geometry + + + The covers predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry. + The DE-9IM Intersection Matrix for the two geometries matches at least + one of the following patterns: + + [T*****FF*] or
+ [*T****FF*] or
+ [***T**FF*] or
+ [****T*FF*] +
+
+ g.CoveredBy(this) == true
+ (covers is the converse of )
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + In particular, unlike Contains it does not distinguish between + points in the boundary and in the interior of geometries. + For most situations, Covers should be used in preference to Contains. + As an added benefit, Covers is more amenable to optimization, + and hence should be more performant. + +
+ The Geometry with which to compare this Geometry + true if this Geometry covers + + +
+ + Tests whether this geometry is covered by the specified geometry. + + The CoveredBy predicate has the following equivalent definitions: + + Every point of this geometry is a point of the other geometry. + + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns: + + [T*F**F***] + [*TF**F***] + [**FT*F***] + [**F*TF***] + g.Covers(this) == true
+ (CoveredBy is the converse of ) +
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + +
+ the Geometry with which to compare this Geometry + true if this Geometry is covered by g + + +
+ + + Tests whether the elements in the DE-9IM + for the two Geometrys match the elements in intersectionPattern. + + + The pattern is a 9-character string, with symbols drawn from the following set: + + 0 (dimension 0) + 1 (dimension 1) + 2 (dimension 2) + T ( matches 0, 1 or 2) + F ( matches FALSE) + * ( matches any value) + For more information on the DE-9IM, see the OpenGIS Simple Features + Specification. + + the Geometry with which to compare this Geometry + the pattern against which to check the + intersection matrix for the two Geometrys + true if the DE-9IM intersection + matrix for the two Geometrys match intersectionPattern + + + + + Returns the DE-9IM intersection matrix for the two Geometrys. + + The Geometry with which to compare this Geometry + + A matrix describing the intersections of the interiors, + boundaries and exteriors of the two Geometrys. + + + + + Tests whether this geometry is + topologically equal to the argument geometry. + + This method is included for backward compatibility reasons. + It has been superseded by the method, + which has been named to clearly denote its functionality. + + This method should NOT be confused with the method + , which implements + an exact equality comparison. + + The Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal. + + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS Equals predicate. + + + The SFS equals predicate has the following equivalent definitions: + + The two geometries have at least one point in common, + and no point of either geometry lies in the exterior of the other geometry. + The DE-9IM Intersection Matrix for the two geometries matches + the pattern T*F**FFF* +
+            T*F
+            **F
+            FF*
+            
+
+ Note that this method computes topologically equality. + For structural equality, see {@link #equalsExact(Geometry)}. +
+ the Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal +
+ + + Tests whether this geometry is structurally and numerically equal + to a given Object. + + + If the argument Object is not a Geometry, + the result is false. + Otherwise, the result is computed using + . + + This method is provided to fulfill the Java contract + for value-based object equality. + In conjunction with + it provides semantics which are most useful + for using + Geometrys as keys and values in Java collections. + + Note that to produce the expected result the input geometries + should be in normal form. It is the caller's + responsibility to perform this where required + (using + or as appropriate). + + The object to compare + true if this geometry is exactly equal to the argument + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets a hash code for the Geometry. + + + An integer value suitable for use as a hashcode + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + + + + + + + Returns the Well-known Binary representation of this Geometry. + For a definition of the Well-known Binary format, see the OpenGIS Simple + Features Specification. + + The Well-known Binary representation of this Geometry. + + + + + + + + + + Returns the feature representation as GML 2.1.1 XML document. + This XML document is based on Geometry.xsd schema. + NO features or XLink are implemented here! + + + + + Computes a buffer area around this geometry having the given width. The + buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The buffer geometry is constructed using 8 segments per quadrant to approximate + the circular arcs. + The end cap style is BufferStyle.CapRound. + + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified accuracy of approximation for circular arcs. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + + + + Returns the smallest convex Polygon that contains all the + points in the Geometry. This obviously applies only to Geometry + s which contain 3 or more points. + + the minimum-area convex polygon containing this Geometry's points. + + + + Computes a new geometry which has all component coordinate sequences + in reverse order (opposite orientation) to this one. + + A reversed geometry + + + + Computes a Geometry representing the point-set which is + common to both this Geometry and the other Geometry. + + The intersection of two geometries of different dimension produces a result + geometry of dimension less than or equal to the minimum dimension of the input + geometries. + The result geometry may be a heterogenous . + If the result is empty, it is an atomic geometry + with the dimension of the lowest input dimension. + + Intersection of s is supported + only for homogeneous collection types. + + Non-empty heterogeneous arguments are not supported. + + The Geometry with which to compute the intersection. + A geometry representing the point-set common to the two Geometrys. + if a robustness error occurs. + if the argument is a non-empty heterogenous GeometryCollection + + + + Computes a Geometry representing the point-set + which is contained in both this + Geometry and the other Geometry. + + + The method may be used on arguments of different dimension, but it does not + support arguments. + + The union of two geometries of different dimension produces a result + geometry of dimension equal to the maximum dimension of the input + geometries. + The result geometry may be a heterogenous + . + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Unioning s has the effect of + noding and dissolving the input linework. In this context + "noding" means that there will be a node or endpoint in the result for + every endpoint or line segment crossing in the input. "Dissolving" means + that any duplicate (i.e. coincident) line segments or portions of line + segments will be reduced to a single line segment in the result. + If merged linework is required, the + class can be used. + + Non-empty arguments are not supported. + the Geometry with which to compute the union + A point-set combining the points of this Geometry and the + points of other + Thrown if a robustness error occurs + Thrown if either input is a non-empty GeometryCollection + + + + + Computes a Geometry representing the closure of the point-set + of the points contained in this Geometry that are not contained in + the other Geometry. + + If the result is empty, it is an atomic geometry + with the dimension of the left-hand input. + + Non-empty arguments are not supported. + + The Geometry with which to compute the difference. + A Geometry representing the point-set difference of this Geometry with other. + + + + Computes a Geometry representing the closure of the point-set + which is the union of the points in this Geometry which are not + contained in the other Geometry, + with the points in the other Geometry not contained in this + Geometry. + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Non-empty arguments are not supported. + + The Geometry with which to compute the symmetric difference. + a Geometry representing the point-set symmetric difference of this Geometry with other. + + + + Computes the union of all the elements of this geometry. + + + This method supports s (which the other overlay operations currently do not). + + The result obeys the following contract: + + Unioning a set of s has the effect of fully noding and dissolving the linework. + Unioning a set of s always returns a geometry + (unlike ), which may return geometries of lower dimension if a topology + collapse occurred). + + + Thrown if a robustness error occurs + + + + Returns true if the two Geometrys are exactly equal, + up to a specified tolerance. + Two Geometries are exactly within a tolerance equal if: + + they have the same class, + they have the same values of Coordinates, + within the given tolerance distance, in their internal + Coordinate lists, in exactly the same order. + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry + have identical structure and point values, up to the distance tolerance. + Distance at or below which two Coordinates will be considered equal. + + true if this and the other Geometry + are of the same class and have equal internal data. + + + + + + + + Returns true if the two Geometrys are exactly equal. + Two Geometries are exactly equal if: + + they have the same class, + they have the same values of Coordinates in their internal + Coordinate lists, in exactly the same order. + + This provides a stricter test of equality than + , which is more useful + in certain situations + (such as using geometries as keys in collections). + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry. + + true if this and the other Geometry have identical structure and point values. + + + + + Tests whether two geometries are exactly equal + in their normalized forms. + + This is a convenience method which creates normalized + versions of both geometries before computing + . + This method is relatively expensive to compute. + For maximum performance, the client + should instead perform normalization on the individual geometries + at an appropriate point during processing. + + + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + Performs an operation with or on this Geometry's coordinates. + + + If this method modifies any coordinate values, + must be called to update the geometry state. + Note that you cannot use this method to + modify this Geometry if its underlying CoordinateSequence's #get method + returns a copy of the Coordinate, rather than the actual Coordinate stored + (if it even stores Coordinate objects at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + + + If the filter reports that a coordinate value has been changed, + will be called automatically. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + + + + + + + Converts this Geometry to normal form (or canonical form ). + + + + Normal form is a unique representation for Geometrys. + It can be used to test whether two Geometrys are equal + in a way that is independent of the ordering of the coordinates within + them. Normal form equality is a stronger condition than topological + equality, but weaker than pointwise equality. + + The definitions for normal + form use the standard lexicographical ordering for coordinates. "Sorted in + order of coordinates" means the obvious extension of this ordering to + sequences of coordinates. + + + NOTE that this method mutates the value of this geometry in-place. + If this is not safe and/or wanted, the geometry should be + cloned prior to normalization. + + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry, using the given . + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + A IComparer<ICoordinateSequence> + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether the two Geometrys are equal, from the point + of view of the EqualsExact method. Called by EqualsExact + . In general, two Geometry classes are considered to be + "equivalent" only if they are the same class. An exception is LineString + , which is considered to be equivalent to its subclasses. + + The Geometry with which to compare this Geometry for equality. + + true if the classes of the two Geometry + s are considered to be equal by the equalsExact method. + + + + + Throws an exception if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + if g is a GeometryCollection, but not one of its subclasses. + + + + + Returns true if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + If g is a GeometryCollection, but not one of its subclasses. + + + + + Returns the minimum and maximum x and y values in this Geometry, + or a null Envelope if this Geometry is empty. + Unlike EnvelopeInternal, this method calculates the Envelope + each time it is called; EnvelopeInternal caches the result + of this method. + + + This Geometrys bounding box; if the Geometry + is empty, Envelope.IsNull will return true. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry having the same class. + + A Geometry having the same class as this Geometry. + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry of the same class. + using the given . + + A Geometry having the same class as this Geometry + The comparer + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the JTS Technical + Specifications + + + + + Returns the first non-zero result of CompareTo encountered as + the two Collections are iterated over. If, by the time one of + the iterations is complete, no non-zero result has been encountered, + returns 0 if the other iteration is also complete. If b + completes before a, a positive number is returned; if a + before b, a negative number. + + A Collection of IComparables. + A Collection of IComparables. + The first non-zero compareTo result, if any; otherwise, zero. + + + + + + + + + + + + + + + + + + + + + A predefined with == . + + + + + + + Gets the factory which contains the context in which this point was created. + + The factory for this point. + + + + Gets/Sets the user data object for this point, if any. + + + A simple scheme for applications to add their own custom data to a Geometry. + An example use might be to add an object representing a Coordinate Reference System. + Note that user data objects are not present in geometries created by + construction methods. + + + + + Sets the ID of the Spatial Reference System used by the Geometry. + + + + NOTE: This method should only be used for exceptional circumstances or + for backwards compatibility. Normally the SRID should be set on the + used to create the geometry. + SRIDs set using this method will not be propagated to + geometries returned by constructive methods. + + + + + + Returns the name of this Geometry's actual class. + + The name of this Geometrys actual class. + + + + Gets the OGC geometry type + + + + + Returns the PrecisionModel used by the Geometry. + + + the specification of the grid of allowable points, for this + Geometry and all other Geometrys. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the number of Geometryes in a GeometryCollection, + or 1, if the geometry is not a collection. + + + + + Tests whether this is simple. + + The SFS definition of simplicity + follows the general rule that a Geometry is simple if it has no points of + self-tangency, self-intersection or other anomalous points. + + Simplicity is defined for each subclass as follows: + + Valid polygonal geometries are simple, since their rings + must not self-intersect. IsSimple + tests for this condition and reports false if it is not met. + (This is a looser test than checking for validity). + Linear rings have the same semantics. + Linear geometries are simple iff they do not self-intersect at points + other than boundary points. + Zero-dimensional geometries (points) are simple iff they have no + repeated points. + Empty Geometrys are always simple. + + + true if this Geometry is simple + + + + + Tests whether this Geometry is topologically + valid, according to the OGC SFS specification. + For validity rules see the documentation for the specific geometry subclass. + + true if this Geometry is valid. + + + + Tests whether the set of points covered in this Geometry is empty. + + true if this Geometry does not cover any points. + + + + Returns the area of this Geometry. + Areal Geometries have a non-zero area. + They override this function to compute the area. + Others return 0.0 + + The area of the Geometry. + + + + Returns the length of this Geometry. + Linear geometries return their length. + Areal geometries return their perimeter. + They override this function to compute the length. + Others return 0.0 + + The length of the Geometry. + + + + Computes the centroid of this Geometry. + The centroid + is equal to the centroid of the set of component Geometries of highest + dimension (since the lower-dimension geometries contribute zero + "weight" to the centroid). + + The centroid of an empty geometry is POINT EMPTY. + + A Point which is the centroid of this Geometry. + + + + Computes an interior point of this Geometry. + + + An interior point is guaranteed to lie in the interior of the Geometry, + if it possible to calculate such a point exactly. Otherwise, + the point may lie on the boundary of the point. + + The interior point of an empty geometry is POINT EMPTY. + + A Point which is in the interior of this Geometry. + + + + + + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the boundary, or an empty geometry of appropriate dimension + if this Geometry is empty. + For a discussion of this function, see the OpenGIS Simple + Features Specification. As stated in SFS Section 2.1.13.1, "the boundary + of a Geometry is a set of Geometries of the next lower dimension." + + The closure of the combinatorial boundary of this Geometry. + NOTE: make abstract, remove setter and change geoapi + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + Gets a geometry representing the envelope (bounding box) of this Geometry. + + If this Geometry is + + empty, returns an empty Point + a point, returns a Point + a line parallel to an axis, a two-vertex LineString, + otherwise, returns a + Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, + maxy), (minx, maxy), (minx, miny). + + + + A Geometry representing the envelope of this Geometry + + + + + + Gets an containing + the minimum and maximum x and y values in this Geometry. + If the geometry is empty, an empty Envelope + is returned. + + + The returned object is a copy of the one maintained internally, + to avoid aliasing issues. + For best performance, clients which access this + envelope frequently should cache the return value. + the envelope of this Geometry. + An empty Envelope if this Geometry is empty + + + + + + + + + + + + + + + Delegate function declaration to handle filter operation + + The geometry to filter + + + + An implementation that applies filtering with the provided + + + + + Creates an instance of this class + + The filter method to be used + + + + OGC compliant geometry factory + + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + Note that the factory constructor methods do not change the input coordinates in any way. + In particular, they are not rounded to the supplied PrecisionModel. + It is assumed that input Coordinates meet the given precision. + + + + + A predefined with + == . + + + + + A predefined with + == . + + A shortcut for . + + + + A predefined with + == . + + + + + A predefined with + == . + + + + + + + + + + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. + + + + + Constructs a GeometryFactory that generates Geometries having the given + CoordinateSequence implementation, a double-precision floating PrecisionModel and a + spatial-reference ID of 0. + + + + + Constructs a GeometryFactory that generates Geometries having the given + {PrecisionModel} and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel and spatial-reference ID, and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + The SRID to use. + + + + Constructs a GeometryFactory that generates Geometries having a floating + PrecisionModel and a spatial-reference ID of 0. + + + + + Converts the ICollection to an array. + + The ICollection of Points to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Geometry's to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LinearRings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Polygons to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPoints to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiLineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPolygons to convert. + The ICollection in array format. + + + + Creates a with the same extent as the given envelope. + + + + The Geometry returned is guaranteed to be valid. + To provide this behaviour, the following cases occur: + + + If the Envelope is: +
    +
  • null returns an empty
  • +
  • a point returns a non-empty
  • +
  • a line returns a two-point
  • +
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
  • +
+
+
+ The Envelope + + An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases) + +
+ + + Creates a Point using the given Coordinate. + A null coordinate creates an empty Geometry. + + a Coordinate, or null + A object + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + a CoordinateSequence (possibly empty), or null + A object + + + + Creates a LineString using the given Coordinates. + A null or empty array creates an empty LineString. + + An array without null elements, or an empty array, or null. + A object + + + + Creates a LineString using the given CoordinateSequence. + A null or empty CoordinateSequence creates an empty LineString. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a LinearRing using the given Coordinates; a null or empty array + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A object + If the ring is not closed, or has too few points + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence (possibly empty), or null. + A object + If the ring is not closed, or has too few points + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + A object + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + the created Polygon + If the boundary ring is invalid + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + A object + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + A object + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + an array of Geometries, each of which may be empty but not null, or null + A object + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned.
+ If geomList contains several Polygons, a + MultiPolygon is returned.
+ If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned.
+ If geomList is empty, an empty GeometryCollection + is returned. + Note that this method does not "flatten" Geometries in the input, and hence if + any MultiGeometries are contained in the input a GeometryCollection containing + them will be returned. +
+ The Geometry to combine. + + A of the "smallest", "most type-specific" + class that can contain the elements of geomList. + +
+ + + Creates a deep copy of the input . + The defined for this factory + is used to copy the s + of the input geometry. + + This is a convenient way to change the CoordinateSequence + used to represent a geometry, or to change the + factory used for a geometry. + + can also be used to make a deep copy, + but it does not allow changing the CoordinateSequence type. + + The geometry + A deep copy of the input geometry, using the CoordinateSequence type of this factory + + + + + Returns the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + + + + + + The SRID value defined for this factory. + + + + + Creates an instance of this class using the default + values for , + and + . + + + + + Creates an instance of this class using the default + values for , + , + but the specified . + + + + Creates an instance of this class using the default + values for , + but the + specified . + + + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. +
The are guaranteed to be orientated clockwise. +
+
+ + + Methods to map various collections + of s + via defined mapping functions. + + Martin Davis + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation delegate + A result collection or geometry of most specific type + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation + A result collection or geometry of most specific type + + + + An interface for geometry functions used for mapping. + + Martin Davis + + + + Computes a new geometry value. + + The input geometry + A result geometry + + + + Represents an (1-dimensional) closed interval on the Real number line. + + + + + Creates a new interval instance, setting ==0d; + + + + + Creates a new interval instance, setting = and =; + + The minimum value + The maximum value + + + + Creates a new interval instance, setting = and =. + + + + + + Method to initialize the interval with the given and values.
+ If < , their values are exchanged. +
+ The minimum value + The maximum value +
+ + + Method to expand this interval to contain . + + The interval to contain. + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval R[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval R[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval R[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval R[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Gets or sets a value indicating the minimum value of the closed interval. + + + + + Gets or sets a value indicating the maximum value of the closed interval. + + + + + Gets the width of the interval ( - ) + + + + + Gets the centre of the interval ( + * 0.5d) + + + + + A visitor for s in a index. + + 1.7 + + + + Visits a node. + + The node to visit + + + + A contiguous portion of 1D-space. Used internally by SIRtree. + + + + + + + + + + + + + + + + + + + + + this + + + + + + + this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writes a formatted string containing the KML representation + of a JTS . + The output is KML fragments which can be substituted + wherever the KML abstract + element can be used. + + + Output elements are indented to provide a + nicely-formatted representation. + An output line prefix and maximum + number of coordinates per line can be specified. + + + The Z ordinate value output can be forced to be a specific value. + The and modes can be set. + If set, the corresponding sub-elements will be output. + + + + + The KML standard value clampToGround for use in . + + + + + The KML standard value relativeToGround for use in . + + + + + The KML standard value absolute for use in . + + + + + Writes a Geometry as KML to a string, using + a specified Z value. + + the geometry to write + the Z value to use + a string containing the KML geometry representation + + + + Writes a Geometry as KML to a string, using + a specified Z value, precision, extrude flag, + and altitude mode code. + + the geometry to write + the Z value to use + the maximum number of decimal places to write + the extrude flag to write + the altitude model code to write + a string containing the KML geometry representation + + + + Writes a in KML format as a string. + + the geometry to write + a string containing the KML geometry representation + + + + Writes the KML representation of a to a . + + the geometry to write + the writer to write to + + + + Appends the KML representation of a to a . + + the geometry to write + the buffer to write into + + + + Takes a list of coordinates and converts it to KML. + + + 2D and 3D aware. Terminates the coordinate output with a newline. + + + + + A tag string which is prefixed to every emitted text line. + This can be used to indent the geometry text in a containing document. + + + + + The maximum number of coordinates to output per line. + + + + + The Z value to be output for all coordinates. + This overrides any Z value present in the Geometry coordinates. + + + + + The flag to be output in the extrude element. + + + + + The flag to be output in the tesselate element. + + + + + The value output in the altitudeMode element. + + + + + The maximum number of decimal places to output in ordinate values. + Useful for limiting output size. + + + negative values set the precision to , + like standard behavior. + + + + + Reads a sequence of {@link Geometry}s in WKBHex format + from a text file. + Each WKBHex geometry must be on a single line + The geometries in the file may be separated by any amount + of whitespace and newlines. + + Martin Davis + + + + Creates a new given the + to use to parse the geometries. + + The geometry reader to use + + + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no filename was specified + Thrown if the filename specified does not exist + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no stream was passed + Thrown if passed stream is not readable or seekable + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The stream reader to use. + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Tests if reader has reached limit + + A collection of already read geometries + true if number of geometries has been read. + + + + Tests if reader is at EOF. + + + + + Gets or sets a value indicating the maximum number of geometries to read + + + + + Gets or sets the number of geometries to skip before storing. + + + + + Enumeration for the 3 coordinate planes + + + + + Models a plane in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the oriented distance from a point to the plane.
+ The distance is: + + positive if the point lies above the plane (relative to the plane normal) + zero if the point is on the plane + negative if the point lies below the plane (relative to the plane normal) + +
+ The point to compute the distance for + The oriented distance to the plane +
+ + + Computes the axis plane that this plane lies closest to. + + Geometries lying in this plane undergo least distortion + (and have maximum area) + when projected to the closest axis plane. + This provides optimal conditioning for + computing a Point-in-Polygon test. + + The index of the closest axis plane + + + + Represents a vector in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the dot product of the 3D vectors AB and CD. + + A coordinate + A coordinate + A coordinate + A coordinate + The dot product + + + + Creates a new vector with given , and components. + + The x component + The y component + The z component + A new vector + + + + Creates a new vector from a . + + The coordinate to copy + A new vector + + + + Computes the 3D dot-product of two s + + The 1st vector + The 2nd vector + The dot product of the (coordinate) vectors + + + + Creates a vector, that is the difference of and + + The origin coordinate + The destination coordinate + + + + Creates a vector with the ordinates , and + + The x-ordinate + The y-ordinate + The z-ordinate + + + + Computes the dot-product of this and + + The 2nd vector + The dot product of the vectors + + + + Function to compute the length of this vector + + The length of this vector + + + + Function to compute the length of vector . + + A coordinate, treated as vector + The length of + + + + Function to compute a normalized form of this vector + + A normalized form of this vector + + + + Function to devide all dimensions of this vector by . + + The divisor + A new (divided) vector + + + + Function to compute a normalized form of vector . + + A coordinate vector + A normalized form of + + + + Gets a value indicating the x-ordinate + + + + + Gets a value indicating the y-ordinate + + + + + Gets a value indicating the z-ordinate + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + + + + Processes possible intersections detected by a . + + + + The is passed to a . + + The + method is called whenever the + detects that two s might intersect. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + This class is an example of the Strategy pattern. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + + + This method is called by clients + of the interface to process + intersections for two segments of the s being intersected. + + + + + + + + + Reports whether the client of this class needs to continue testing + all intersections in an arrangement. + + if there is no need to continue testing segments + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Intersects two sets of s using + brute-force comparison. + + + + + An intersector for the red-blue intersection problem. + In this class of line arrangement problem, + two disjoint sets of linestrings are intersected. + + Implementing classes must provide a way + of supplying the base set of segment strings to + test against (e.g. in the constructor, + for straightforward thread-safety). + + In order to allow optimizing processing, + the following condition is assumed to hold for each set: + + the only intersection between any two linestrings occurs at their endpoints. + + Implementations can take advantage of this fact to optimize processing + (i.e by avoiding testing for intersections between linestrings + belonging to the same set). + + + + + Computes the intersections with a given set of s, + using the supplied . + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of base segments. + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Processes all of the segment pairs in the given segment strings + using the given SegmentIntersector. + + A segment string + A segment string + The segment intersector to use + + + + A geometry service provider class + + + + + Creates an instance of this class, using the as default and a precision model. No is specified + + + + + Creates an instance of this class, using the provided , and spatial reference Id (. + + The coordinate sequence factory to use. + The precision model. + The default spatial reference ID + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Gets or sets the current instance + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Gets a value representing the number of geometry factories that have been stored in the cache + + + + + A pair of s, whose leaf items + support a distance metric between them. + Used to compute the distance between the members, + and to expand a member relative to the other + in order to produce new branches of the + Branch-and-Bound evaluation tree. + Provides an ordering based on the distance between the members, + which allows building a priority queue by minimum distance. + + Martin Davis + + + + Creates an instance of this class with the given s and the function. + + The first boundable + The second boundable + The item distance function + + + + Gets one of the member s in the pair + (indexed by [0, 1]). + + The index of the member to return (0 or 1) + The chosen member + + + + Computes the distance between the s in this pair. + The boundables are either composites or leaves. + If either is composite, the distance is computed as the minimum distance + between the bounds. + If both are leaves, the distance is computed by . + + The distance between the s in this pair. + + + + Compares two pairs based on their minimum distances + + + + + For a pair which is not a leaf + (i.e. has at least one composite boundable) + computes a list of new pairs + from the expansion of the larger boundable. + + + + + Gets the minimum possible distance between the Boundables in + this pair. + If the members are both items, this will be the + exact distance between them. + Otherwise, this distance will be a lower bound on + the distances between the items in the members. + + The exact or lower bound distance for this pair + + + + Tests if both elements of the pair are leaf nodes + + + + + An function for + items which are using the method. + + Martin Davis + + + + A function method which computes the distance + between two s in an . + Used for Nearest Neighbour searches. + + Martin Davis + + + + Computes the distance between two items. + + The first item. + The second item. + If the metric is not applicable to the arguments + The distance between and . + + + + Computes the distance between two items, + using the method. + + An item which is a geometry. + An item which is a geometry. + if either item is not a Geometry + The distance between the two items. + + + + Implements extended-precision floating-point numbers + which maintain 106 bits (approximately 30 decimal digits) of precision. + + A DoubleDouble uses a representation containing two double-precision values. + A number x is represented as a pair of doubles, x.hi and x.lo, + such that the number represented by x is x.hi + x.lo, where +
+                |x.lo| <= 0.5*ulp(x.hi)
+            
+ and ulp(y) means "unit in the last place of y". + The basic arithmetic operations are implemented using + convenient properties of IEEE-754 floating-point arithmetic. + + The range of values which can be represented is the same as in IEEE-754. + The precision of the representable numbers + is twice as great as IEEE-754 double precision. + + The correctness of the arithmetic algorithms relies on operations + being performed with standard IEEE-754 double precision and rounding. + This is the Java standard arithmetic model, but for performance reasons + Java implementations are not + constrained to using this standard by default. + Some processors (notably the Intel Pentium architecure) perform + floating point operations in (non-IEEE-754-standard) extended-precision. + A JVM implementation may choose to use the non-standard extended-precision + as its default arithmetic mode. + To prevent this from happening, this code uses the + Java strictfp modifier, + which forces all operations to take place in the standard IEEE-754 rounding model. + + The API provides both a set of value-oriented operations + and a set of mutating operations. + Value-oriented operations treat DoubleDouble values as + immutable; operations on them return new objects carrying the result + of the operation. This provides a simple and safe semantics for + writing DoubleDouble expressions. However, there is a performance + penalty for the object allocations required. + The mutable interface updates object values in-place. + It provides optimum memory performance, but requires + care to ensure that aliasing errors are not created + and constant values are not changed. + + This implementation uses algorithms originally designed variously by + Knuth, Kahan, Dekker, and Linnainmaa. + Douglas Priest developed the first C implementation of these techniques. + Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al. +

References

+ + Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, + in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, + IEEE Computer Society Press, Los Alamitos, Calif., 1991. + Yozo Hida, Xiaoye S. Li and David H. Bailey, + Quad-Double Arithmetic: Algorithms, Implementation, and Application, + manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. + David Bailey, High Precision Software Directory; + http://crd.lbl.gov/~dhbailey/mpdist/index.html + +
+ Martin Davis +
+ + + The value to split a double-precision value on during multiplication + + + + The value nearest to the constant Pi. + + + The value nearest to the constant 2 * Pi. + + + The value nearest to the constant Pi / 2. + + + + The value nearest to the constant e (the natural logarithm base). + + + + + A value representing the result of an operation which does not return a valid number. + + + + + The smallest representable relative difference between two values + + + + + Converts the string argument to a DoubleDouble number. + + A string containing a representation of a numeric value + The extended precision version of the value + Thrown if is not a valid representation of a number + + + Converts the double argument to a DoubleDouble number. + + @param x a numeric value + @return the extended precision version of the value + + + The high-order component of the double-double precision value. + + + The low-order component of the double-double precision value. + + + + Creates a new with value x. + + The initial value + + + + Creates a new with value (hi, lo). + + The high order component + The low order component + + + + Creates a with a value equal to the argument + + The initial value + + + Creates a new DoubleDouble with value equal to the argument. + + @param str the value to initialize by + @throws NumberFormatException if str is not a valid representation of a number + + + + Creates a new with the value of the argument. + + The value to copy + A copy of + + + + Creates and returns a copy of this value. + + Acopy of this value + + + + Returns a whose value is (this + ) + + The addende"/> + (this + ) + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns a whose value is (this + y). + + The addend + (this + y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Returns a whose value is -this. + + -this + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + ** + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + ** + + + Returns a DoubleDouble whose value is 1 / this. + + @return the reciprocal of this value + + + + Computes the minimum of this and another DD number. + + A DD number + The minimum of the two numbers + + + + Computes the maximum of this and another DD number. + + A DD number + The maximum of the two numbers + + + + + + Returns an integer indicating the sign of this value. + + + if this value is > 0, returns 1 + if this value is < 0, returns -1 + if this value is = 0, returns 0 + if this value is NaN, returns 0 + + + + An integer indicating the sign of this value + + + + Rounds this value to the nearest integer. + The value is rounded to an integer by adding 1/2 and taking the floor of the result. + Special cases: + + If this value is NaN, returns NaN. + + + This value rounded to the nearest integer + + + + Returns the integer which is largest in absolute value and not further + from zero than this value. + + Special cases: + + If this value is NaN, returns NaN. + + + + The integer which is largest in absolute value and not further from zero than this value + + + + + Returns the absolute value of this value. + + Special cases: + + if this value is NaN, it is returned. + + + The absolute value of this value + + + + Computes the square of this value. + + The square of this value + + + + Computes the square of this value. + + The square of this value. + + + Computes the positive square root of this value. + If the number is NaN or negative, NaN is returned. + + @return the positive square root of this number. + If the argument is NaN or less than zero, the result is NaN. + + + + Computes the value of this number raised to an integral power. + Follows semantics of .Net Math.Pow as closely as possible. + + The integer exponent + x raised to the integral power exp + + + Converts this value to the nearest double-precision number. + + @return the nearest double-precision number to this value + + + Converts this value to the nearest integer. + + @return the nearest integer to this value + + + + Gets a value indicating whether this object is positive or not + + + + + Gets a value indicating whether this object is positive or not + + + + Tests whether this value is equal to another DoubleDouble value. + + @param y a DoubleDouble value + @return true if this value = y + + + Tests whether this value is greater than another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value > y + + + Tests whether this value is greater than or equals to another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value >= y + + + + Tests whether this value is less than another DoubleDouble value. + + A DoubleDouble value + true if this value is < + + + + Compares two DoubleDouble objects numerically. + + @return -1,0 or 1 depending on whether this value is less than, equal to + or greater than the value of o + + + + Dumps the components of this number to a string. + + A string showing the components of the number + + + + Returns a string representation of this number, in either standard or scientific notation. + If the magnitude of the number is in the range [ 10-3, 108 ] + standard notation will be used. Otherwise, scientific notation will be used. + + A string representation of this number + + + + Returns the string representation of this value in standard notation. + + The string representation in standard notation + + + + Returns the string representation of this value in scientific notation. + + The string representation in scientific notation + + + Extracts the significant digits in the decimal representation of the argument. + A decimal point may be optionally inserted in the string of digits + (as long as its position lies within the extracted digits + - if not, the caller must prepend or append the appropriate zeroes and decimal point). + + @param y the number to extract ( >= 0) + @param decimalPointPos the position in which to insert a decimal point + @return the string containing the significant digits and possibly a decimal point + + + + Returns the string for this value if it has a known representation (e.g. NaN or 0.0). + + The string for this special number
+ or null if the number is not a special number
+
+ + + Determines the decimal magnitude of a number. + The magnitude is the exponent of the greatest power of 10 which is less than + or equal to the number. + + The number to find the magnitude of + The decimal magnitude of + + + + Converts a string representation of a real number into a DoubleDouble value. + The format accepted is similar to the standard Java real number syntax. + It is defined by the following regular expression: +
+            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
+            
+
+ The string to parse + The value of the parsed number + Thrown if str is not a valid representation of a number +
+ + + Gets a value indicating whether this object is zero (0) or not + + + + + Gets a value indicating whether this object is negative or not + + + + + Various utility functions for mathematical and numerical operations. + + + + + Clamps a double value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Clamps a int value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Computes the base-10 logarithm of a double value. + + + If the argument is NaN or less than zero, then the result is NaN. + If the argument is positive infinity, then the result is positive infinity. + If the argument is positive zero or negative zero, then the result is negative infinity. + + + + A positive number + The value log a, the base-10 logarithm of the input value + + + + + Computes the average of two numbers. + + A number + A number + The average of the inputs + + + + Computes the maximum fo three values + + A number + A number + A number + The maximum value of , and + + + + Computes the maximum of four values + + A number + A number + A number + A number + The maximum value of , , and + + + + Computes the minimum of four values + + A number + A number + A number + The minimum value of , and + + + + Computes the minimum of four values + + A number + A number + A number + A number + The minimum value of , , and + + + + Implements some 2D matrix operations + (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination. + In order to avoid overhead the algorithm runs in-place + on - if should not be modified the client must supply a copy. + + An nxn matrix in row/column order )modified by this method) + A vector of length n + A vector containing the solution (if any)
or null if the system has no or no unique solution +
+ If the matrix has the wrong size +
+ + + A 2-dimensional mathematical vector represented by double-precision X and Y components. + + mbdavis + + + + Creates a new vector with given X and Y components. + + The x component + The y component + A new vector + + + + Creates a new vector from an existing one. + + The vector to copy + A new vector + + + + Creates a vector from a . + + The coordinate to copy + A new vector + + + Creates a vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + A new vector + + + The X component of this vector. + + + The Y component of this vector. + + + + Creates an new vector instance + + + + + Creates a new vector instance using the provided and ordinates + + The x-ordinate value + The y-ordinate value + + + + Creates a new vector instance based on . + + The vector + + + Creates a new vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + + + + Creates a vector from a . + + The coordinate + A new vector + + + + Adds to this vector instance. + + The vector to add + The result vector + + + + Subtracts from this vector instance + + The vector to subtract + The result vector + + + + Multiplies the vector by a scalar value. + + The value to multiply by + A new vector with the value v * d + + + + Divides the vector by a scalar value. + + The value to divide by + A new vector with the value v / d + + + + Negates this vector + + A new vector with [-_x, -_y] + + + + + + + + + + + + + + + + Normalizes the vector + + A new normalized vector + + + + + + + + + + + Computes the weighted sum of this vector + with another vector, + with this vector contributing a fraction + of frac to the total. + + In other words, +
+            sum = frac * this + (1 - frac) * v
+            
+
+ The vector to sum + The fraction of the total contributed by this vector + The weighted sum of the two vectors +
+ + + Computes the distance between this vector and another one. + + A vector + The distance between the vectors + + + + Computes the dot-product of two vectors + + A vector + The dot product of the vectors + + + + Computes the angle this vector describes to the horizontal axis + + The angle + + + + + + + + + + + + + + + + + + Rotates this vector by + + The angle + The rotated vector + + + + Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 + degrees or Pi/2 radians). A positive number rotates counter-clockwise, a + negative number rotates clockwise. Under this operation the magnitude of + the vector and the absolute values of the ordinates do not change, only + their sign and ordinate index. + + The number of quarter-circles to rotate by + The rotated vector. + + + + + + + + + + + Gets a made of this vector translated by . + + The translation coordinate + A coordinate + + + + Gets a from this vector + + A coordinate + + + + Creates a copy of this vector + + A copy of this vector + + + + Gets a string representation of this vector + + A string representing this vector + + + + Tests if a vector has the same values for the x and y components. + + A with which to do the comparison. + true if is a with the same values for the X and Y components. + + + + Gets a hashcode for this vector. + + A hashcode for this vector + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + + Functions for performing vector mathematics. + + + + + Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each + triangle coordinate must have a Z value. If this is not the case, the returned Coordinate + will have NaN values. The returned vector has unit length. + + A point + A point + A point + The normal vector to the triangle -- + + + + Normalizes the vector + + The normalized + + + + Computes the cross product of and + + A vector + A vector + The cross product of and + + + + Computes the dot product of and + + A vector + A vector + The dot product of and + + + + Computes the determinant of a 2x2 matrix + + The m[0,0] value + The m[0,1] value + The m[1,0] value + The m[1,1] value + The determinant + + + + Helper class for transforming objects. + + + + + Transforms a object. + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Densifies a geometry by inserting extra vertices along the line segments + contained in the geometry. + All segments in the created densified geometry will be no longer than + than the given distance tolerance. + + + Densified polygonal geometries are guaranteed to be topologically correct. + The coordinates created during densification respect the input geometry's . + Note: At some future point this class will offer a variety of densification strategies. + + Martin Davis + + + + Densifies a geometry using a given distance tolerance, and respecting the input geometry's . + + The geometry densify + The distance tolerance () + The densified geometry + + + + Densifies a coordinate sequence. + + The coordinate sequence to densify + The distance tolerance () + The precision model to apply on the new coordinates + The densified coordinate sequence + + + Creates a new densifier instance + The geometry to densify + + + + Gets the densified geometry. + + The densified geometry + + + + Gets or sets the distance tolerance for the densification. All line segments + in the densified geometry will be no longer than the distance tolereance. + Simplified geometry will be within this distance of the original geometry. + The distance tolerance must be positive. + + + + + A framework for processes which transform an input Geometry into + an output , possibly changing its structure and type(s). + + + + This class is a framework for implementing subclasses + which perform transformations on + various different Geometry subclasses. + + + It provides an easy way of applying specific transformations + to given point types, while allowing unhandled types to be simply copied. + Also, the framework handles ensuring that if subcomponents change type + the parent geometries types change appropriately to maintain valid structure. + Subclasses will override whichever TransformX methods + they need to to handle particular Geometry types. + + + A typically usage would be a transformation that may transform Polygons into + Polygons, LineStrings or Points, depending on the geometry of the input + (For instance, a simplification operation). + This class would likely need to override the + method to ensure that if input Polygons change type the result is a GeometryCollection, + not a MultiPolygon. + + The default behaviour of this class is simply to recursively transform + each Geometry component into an identical object by deep copying down + to the level of, but not including, coordinates. + + + Note that all TransformXXX methods may return null, + to avoid creating empty point objects. This will be handled correctly + by the transformer. TransformXXX methods should always return valid + geometry - if they cannot do this they should return null + (for instance, it may not be possible for a transformLineString implementation + to return at least two points - in this case, it should return null). + The method itself will always + return a non-null Geometry object (but this may be empty). + > + + + + + + + + + true if empty geometries should not be included in the result. + + + + + true if a homogenous collection result + from a GeometryCollection should still + be a general GeometryCollection. + + + + + true if the type of the input should be preserved. + + + + + + + + + + + + Convenience method which provides standard way of + creating a CoordinateSequence. + + The coordinate array to copy. + A coordinate sequence for the array. + + + + Convenience method which provides statndard way of copying {CoordinateSequence}s + + The sequence to copy. + A deep copy of the sequence. + + + + Transforms a . + This method should always return a valid coordinate list for + the desired result type. (E.g. a coordinate list for a LineString + must have 0 or at least 2 points). + If this is not possible, return an empty sequence - + this will be pruned out. + + The coordinates to transform + The parent geometry + The transformed coordinates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Makes the input geometry available + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections + A valid area geometry + + + + Stores all attributes associated with a single Geometry feature. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the names + + + + + + + + + + + + + + + + + + + + + + + + Returns a string array containing + all names of present attributes. + + + + + + Returns a object array containing + all values of present attributes. + + + + + + Verifies if attribute specified already exists. + + + + + + + Build a field with the given value and add it to attributes table. + + Name of the new attribute. + Value for attribute (can be null). + If attribute already exists. + + + + Delete the specified attribute from the table. + + + + + + Return the System.Type of the specified attribute, + useful for casting values retrieved with GetValue methods. + + + + + + + Get the value of the specified attribute. + + + + + + + Set the value of the specified attribute. + + + + + + + + + + + + Get / Set the value of the specified attribute. + + + + + + + Feature class + + + + + + + + + + + + + + + + + Geometry representation of the feature. + + + + + Attributes table of the feature. + + + + + Angle orientation + + + + Constant representing no orientation + + + Constant representing straight orientation + + + Constant representing counterclockwise orientation + + + Constant representing left orientation + + + Constant representing clockwise orientation + + + Constant representing right orientation + + + + Utility functions for working with angles. + Unless otherwise noted, methods in this class express angles in radians. + + + + + Converts from radians to degrees. + + An angle in radians + The angle in degrees + + + + Converts from degrees to radians. + + An angle in degrees + The angle in radians + + + + Returns the angle of the vector from p0 to p1, relative to the positive X-axis. + + The angle is normalized to be in the range [ -Pi, Pi ]. + The start-point + The end-point + The normalized angle (in radians) that p0-p1 makes with the positive X-axis + + + + Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. + + + The angle is normalized to be in the range ( -Pi, Pi ]. + + The point + The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. + + + + Tests whether the angle between p0-p1-p2 is acute. + + + An angle is acute if it is less than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Tests whether the angle between p0-p1-p2 is obtuse + + + An angle is obtuse if it is greater than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Returns the unoriented smallest angle between two vectors. + + + The computed angle will be in the range [0, Pi). + + The tip of one vector + The tail of each vector + The tip of the other vector + + + + Returns the oriented smallest angle between two vectors. + The computed angle will be in the range (-Pi, Pi]. + A positive result corresponds to a rotation (CCW) from v1 to v2; + a negative result corresponds to a (CW) rotation; + a zero result corresponds to no rotation. + + The tip of v1 + The tail of each vector + The tip of v2 + The angle between v1 and v2, relative to v1 + + + + Computes the interior angle between two segments of a ring. + The ring is assumed to be oriented in a clockwise direction. + + The computed angle will be in the range [0, 2Pi] + A point of the ring + The next point of the ring + The next point of the ring + The interior angle based at p1 + + + + Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. + + An angle (in radians) + An angle (in radians) + Whether a1 must turn , or to overlap a2. + + + + Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. + + The angle to normalize + An equivalent angle in the range (-Pi, Pi] + + + + Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). + + E.g. + + + NormalizePositive(0.0) = 0.0 + NormalizePositive(-PI) = + NormalizePositive(-2PI) = 0.0 + NormalizePositive(-3PI) = + NormalizePositive(-4PI) = 0 + NormalizePositive(PI) = + NormalizePositive(2PI) = 0.0 + NormalizePositive(3PI) = + NormalizePositive(4PI) = 0.0 + + + + + The angle to normalize, in radians. + An equivalent positive angle + + + + Computes the unoriented smallest difference between two angles. + + + + The angles are assumed to be normalized to the range [-Pi, Pi]. + The result will be in the range [0, Pi]. + + + The angle of one vector (in [-Pi, Pi] ) + The angle of the other vector (in range [-Pi, Pi] ) + The angle (in radians) between the two vectors (in range [0, Pi] ) + + + + Useful utility functions for handling Coordinate arrays. + + + + + Tests whether an array of s forms a ring, by checking length and closure. + Self-intersection is not checked. + + An array of Coordinates + true if the coordinate form a ring. + + + + Finds a in a list of s + which is not contained in another list of s. + + The s to test. + An array of s to test the input points against. + + A from + which is not in , or null. + + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + + + + Determines which orientation of the array is (overall) increasing. + In other words, determines which end of the array is "smaller" + (using the standard ordering on ). + Returns an integer indicating the increasing direction. + If the sequence is a palindrome, it is defined to be + oriented in a positive direction. + + The array of Coordinates to test. + + 1 if the array is smaller at the start or is a palindrome, + -1 if smaller at the end. + + + + + Determines whether two arrays of equal length + are equal in opposite directions. + + + + + + + + Creates a deep copy of the argument Coordinate array. + + Array of Coordinates. + Deep copy of the input. + + + + Creates a deep copy of a given section of a source array into a destination Coordinate array. + The destination array must be an appropriate size to receive the copied coordinates. + + An array of Coordinates + The index to start copying from + The array to receive the deep-copied coordinates + The destination index to start copying to + The number of items to copy + + + + Converts the given of + s into a array. + + of coordinates. + + + If contains not only s. + + + + + Converts the given of + s into a array. + + of coordinates. + + + + + Returns whether Equals returns true for any two consecutive + coordinates in the given array. + + Array of Coordinates. + true if coord has repeated points; false otherwise. + + + + Returns either the given coordinate array if its length is greater than + the given amount, or an empty coordinate array. + + Length amount. + Array of Coordinates. + New Coordinate array. + + + + If the coordinate array argument has repeated points, + constructs a new array containing no repeated points. + Otherwise, returns the argument. + + + + + + + Collapses a coordinate array to remove all null elements. + + The coordinate array to collapse + An Array containing only non-null elements + + + + Reverses the coordinates in an array in-place. + + Array of Coordinates. + + + + Returns true if the two arrays are identical, both null, or pointwise + equal (as compared using Coordinate.Equals). + + First array of Coordinates. + Second array of Coordinates. + true if two Coordinates array are equals; false otherwise + + + + Returns true if the two arrays are identical, both null, or pointwise + equal, using a user-defined + for s. + + An array of s. + Another array of s. + + A for s. + + + + + + Returns the minimum coordinate, using the usual lexicographic comparison. + + Array to search. + The minimum coordinate in the array, found using CompareTo. + + + + Shifts the positions of the coordinates until firstCoordinate is first. + + Array to rearrange. + Coordinate to make first. + + + + Returns the index of in . + The first position is 0; the second is 1; etc. + + A to search for. + A array to search. + The position of coordinate, or -1 if it is not found. + + + + Extracts a subsequence of the input array + from indices to (inclusive). + The input indices are clamped to the array size; + If the end index is less than the start index, + the extracted array will be empty. + + The input array. + The index of the start of the subsequence to extract. + The index of the end of the subsequence to extract. + A subsequence of the input array. + + + + Computes the of the coordinates. + + the array to scan. + the of the . + + + Extracts the coordinates which intersect an {@link Envelope}. + + @param coordinates the coordinates to scan + @param env the envelope to intersect with + @return an array of the coordinates which intersect the envelope + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + Compares the specified s arrays. + + + + + + + + A comparator for arrays modulo their directionality. + E.g. if two coordinate arrays are identical but reversed + they will compare as equal under this ordering. + If the arrays are not equal, the ordering returned + is the ordering in the forward direction. + + + + + A backed by an array of s. + This is the implementation that s use by default. + + Coordinates returned by , and are live -- + modifications to them are actually changing the + CoordinateSequence's underlying data. + A dimension may be specified for the coordinates in the sequence, + which may be 2 or 3. + The actual coordinates will always have 3 ordinates, + but the dimension is useful as metadata in some situations. + + + + The actual dimension of the coordinates in the sequence. + Allowable values are 2 or 3. + + + + Constructs a sequence based on the given array of s. + The coordinate dimension is 3 + + + The array is not copied. + + The coordinate array that will be referenced. + + + + Constructs a sequence based on the given array + of s. + + The Array is not copied + The coordinate array that will be referenced. + The dimension of the coordinates + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Constructs a sequence of a given , populated + with new s of the given . + + The size of the sequence to create. + the dimension of the coordinates + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Get the Coordinate with index i. + + The index of the coordinate. + The requested Coordinate instance. + + + + Get a copy of the Coordinate with index i. + + The index of the coordinate. + A copy of the requested Coordinate. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Creates a deep copy of the object. + + The deep copy. + + + + + + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + This method exposes the internal Array of Coordinate Objects. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the string representation of the coordinate array. + + + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the length of the coordinate sequence. + + + + + Creates CoordinateSequences represented as an array of Coordinates. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Returns the singleton instance of CoordinateArraySequenceFactory. + + + + + A list of Coordinates, which may + be set to prevent repeated coordinates from occuring in the list. + + + + + Constructs a new list without any coordinates + + + + + Constructs a new list from an array of Coordinates, allowing repeated points. + (I.e. this constructor produces a with exactly the same set of points + as the input array.) + + Initial coordinates + + + + Constructs a new list from a collection of Coordinates, + allows repeated points. + + Collection of coordinates to load into the list. + + + + Constructs a new list from a collection of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Collection of coordinates to load into the list. + If false, repeated points are removed. + + + + Constructs a new list from an array of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Array of coordinates to load into the list. + If false, repeated points are removed. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Adds a section of an array of coordinates to the list. + + The coordinates + If set to false, repeated coordinates are collapsed + The index to start from + The index to add up to but not including + true (as by general collection contract) + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + If false, the array is added in reverse order. + Return true. + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the list. + + Coordinate to be inserted, as object. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the end of this list. + + Coordinate to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if all ok. + + + + Inserts the specified coordinate at the specified position in this list. + + The position at which to insert + the coordinate to insert + if set to false, repeated coordinates are collapsed + + + + Add an array of coordinates. + + Coordinates collection to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if at least one element has added (IList not empty). + + + + Ensure this coordList is a ring, by adding the start point if necessary. + + + + + Returns the Coordinates in this collection. + + Coordinater as Coordinate[] array. + + + + Returns a deep copy of this collection. + + The copied object. + + + + Compares two s. + + + For sequences of the same dimension, the ordering is lexicographic. + Otherwise, lower dimensions are sorted before higher. + The dimensions compared can be limited; if this is done + ordinate dimensions above the limit will not be compared. + + + If different behaviour is required for comparing size, dimension, + or coordinate values, any or all methods can be overridden. + + + + + Compare two doubles, allowing for NaN values. + NaN is treated as being less than any valid number. + + A double + A double + -1, 0, or 1 depending on whether a is less than, equal to or greater than b + + + The number of dimensions to test + + + Creates a comparator which will test all dimensions. + + + + + @param dimensionLimit + Creates a comparator which will test only the specified number of dimensions. + The number of dimensions to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 + + + + Compares the same coordinate of two s + + A coordinate sequence + A coordinate sequence + The index of the coordinate to test + the number of dimensiosn to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 + + + + Utility functions for manipulating s. + + + + + Reverses the coordinates in a sequence in-place. + + + + + + Swaps two coordinates in a sequence. + + seq the sequence to modify + the index of a coordinate to swap + the index of a coordinate to swap + + + + Copies a section of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinates from + The starting index of the coordinates to copy + The sequence to which the coordinates should be copied to + The starting index of the coordinates in + The number of coordinates to copy + + + + Copies a coordinate of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinate from + The index of the coordinate to copy + The sequence to which the coordinate should be copied to + The index of the coordinate in + + + + Tests whether a forms a valid , + by checking the sequence length and closure + (whether the first and last points are identical in 2D). + Self-intersection is not checked. + + The sequence to test + True if the sequence is a ring + + + + + Ensures that a CoordinateSequence forms a valid ring, + returning a new closed sequence of the correct length if required. + If the input sequence is already a valid ring, it is returned + without modification. + If the input sequence is too short or is not closed, + it is extended with one or more copies of the start point. + + The CoordinateSequenceFactory to use to create the new sequence + The sequence to test + The original sequence, if it was a valid ring, or a new sequence which is valid. + + + + Tests whether two s are equal. + To be equal, the sequences must be the same length. + They do not need to be of the same dimension, + but the ordinate values for the smallest dimension of the two + must be equal. + Two NaN ordinates values are considered to be equal. + + a CoordinateSequence + a CoordinateSequence + true if the sequences are equal in the common dimensions + + + + Creates a string representation of a . + The format is: + + ( ord0,ord1.. ord0,ord1,... ... ) + + + the sequence to output + the string representation of the sequence + + + + The CoordinateSequence implementation that Geometries use by default. In + this implementation, Coordinates returned by ToArray and GetCoordinates are live -- + parties that change them are actually changing the + DefaultCoordinateSequence's underlying data. + + + + + Constructs a DefaultCoordinateSequence based on the given array (the + array is not copied). + + Coordinate array that will be assimilated. + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns a copy of the coordinate at specified index. + + Coordinate index. + The copy of the coordinate specified. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns a deep copy of the object passed. + + The copied object. + + + + This method exposes the internal Array of Coordinate Objects. + + Coordinate[] array. + + + + Returns the string Representation of the coordinate array + + A string. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns the elements number of the coordinate sequence. + + + + + + Returns the elements number of the coordinate sequence. + + The length. + + + + Creates CoordinateSequences internally represented + as an array of x's and an array of y's. + + + + + + + + + + Returns a DefaultCoordinateSequence based on the given array + (the array is not copied). + + Coordinates array, which may not be null + nor contain null elements + Singleton instance of DefaultCoordinateSequenceFactory. + + + + Returns the singleton instance of DefaultCoordinateSequenceFactory. + + Singleton instance of DefaultCoordinateSequenceFactory. + + + + A coordinate sequence that follows the dotspatial shape range + + + + + Creates an instance of this class + + The + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The number of dimensions. + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The kind of ordinates. + + + + Creates a sequence based on the given coordinate sequence. + + The coordinate sequence. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Releases the weak reference to the weak referenced coordinate array + + This is necessary if you modify the values of the , , arrays externally. + + + + Gets the vector with x- and y-ordinate values; + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with z-ordinate values + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with measure values + + If you modify the values of this vector externally, you need to call ! + + + + A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, + and can be set. + + A coordinate sequence. + + + + Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. + + + + + + Gets the Ordinate flags that sequences created by this factory can cope with. + + + + + Basic implementation of GeometryCollection. + + + + + Represents an empty GeometryCollection. + + + + + Internal representation of this GeometryCollection. + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + For create this is used a standard + with == . + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a GeometryCollectionEnumerator: + this IEnumerator returns the parent geometry as first element. + In most cases is more useful the code + geometryCollectionInstance.Geometries.GetEnumerator(): + this returns an IEnumerator over geometries composing GeometryCollection. + + + + + + Creates a with + every component reversed. + The order of the components in the collection are not reversed. + + A in the reverse order + + + + + + + + + Collects all coordinates of all subgeometries into an Array. + Note that while changes to the coordinate objects themselves + may modify the Geometries in place, the returned Array as such + is only a temporary container which is not synchronized back. + + The collected coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "GeometryCollection" + + + + Gets the OGC geometry type + + + + + + + + + + Returns the area of this GeometryCollection. + + + + + Returns the length of this GeometryCollection. + + + + + Return true if all features in collection are of the same type. + + + + + Returns the iTh element in the collection. + + + + + + + Returns the number of geometries contained by this . + + + + + Iterates over all Geometry's in a GeometryCollection. + Implements a pre-order depth-first traversal of the GeometryCollection + (which may be nested). The original GeometryCollection is + returned as well (as the first object), as are all sub-collections. It is + simple to ignore the GeometryCollection objects if they are not + needed. + + + + + The GeometryCollection being iterated over. + + + + + Indicates whether or not the first element (the GeometryCollection) + has been returned. + + + + + The number of Geometrys in the the GeometryCollection. + + + + + The index of the Geometry that will be returned when next + is called. + + + + + The iterator over a nested GeometryCollection, or null + if this GeometryCollectionIterator is not currently iterating + over a nested GeometryCollection. + + + + + Constructs an iterator over the given GeometryCollection. + + + The collection over which to iterate; also, the first + element returned by the iterator. + + + + + + + + + + + + + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + + + The parent GeometryCollection is the first object returned! + + + + Models an OGC SFS LinearRing. + + + A LinearRing is a which is both closed and simple. + In other words, + the first and last coordinate in the ring must be equal, + and the interior of the ring must not self-intersect. + Either orientation of the ring is allowed. + + A ring must have either 0 or 4 or more points. + The first and last points must be equal (in 2D). + If these conditions are not met, the constructors throw + an + + + + + Models an OGC-style LineString + + + A LineString consists of a sequence of two or more vertices, + along with all points along the linearly-interpolated curves + (line segments) between each + pair of consecutive vertices. + Consecutive vertices may be equal. + The line segments in the line may intersect each other (in other words, + the linestring may "curl back" in itself and self-intersect. + Linestrings with exactly two identical points are invalid. + A linestring must have either 0 or 2 or more points. + If these conditions are not met, the constructors throw an . + + + + + + Represents an empty LineString. + + + + + The points of this LineString. + + + + + + + + + + + + + + + + + + + Creates a whose coordinates are in the reverse order of this objects. + + A with coordinates in the reverse order. + + + + Returns true if the given point is a vertex of this LineString. + + The Coordinate to check. + true if pt is one of this LineString's vertices. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalizes a LineString. A normalized linestring + has the first point which is not equal to it's reflected point + less than the reflected point. + + + + + + + + + + + + Initializes a new instance of the class. + + + For create this is used a standard + with == . + + The coordinates used for create this . + If too few points are provided + + + + Initializes a new instance of the class. + + + The points of the linestring, or null + to create the empty point. Consecutive points may not be equal. + + + If too few points are provided + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "LineString" + + + + Returns the length of this LineString + + The length of the polygon. + + + + + + + + + + + + + + + + + Returns the value of the angle between the + and the . + + + + + The minimum number of vertices allowed in a valid non-empty ring (= 4). + Empty rings with 0 vertices are also valid. + + + + + Constructs a LinearRing with the given points. + + + Points forming a closed and simple linestring, or + null or an empty array to create the empty point. + This array must not contain null elements. + + + If the ring is not closed, or has too few points + + + + + + + + + Initializes a new instance of the class. + + The points used for create this instance. + + For create this is used a standard + with == . + + If the ring is not closed, or has too few points + + + + Returns Dimensions.False, since by definition LinearRings do not have a boundary. + + + + + Returns the name of this object's interface. + + "LinearRing" + + + + Represents a line segment defined by two Coordinates. + Provides methods to compute various geometric properties + and relationships of line segments. + This class is designed to be easily mutable (to the extent of + having its contained points public). + This supports a common pattern of reusing a single LineSegment + object as a way of computing segment properties on the + segments defined by arrays or lists of Coordinates. + + + + + Creates an instance of this class using two coordinates + + The start-point + The end-point + + + + Creates an instance of this class using another instance + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the orientation of a LineSegment relative to this segment. + The concept of orientation is specified as follows: + Given two line segments A and L, + A is to the left of a segment L if A lies wholly in the + closed half-plane lying to the left of L + A is to the right of a segment L if A lies wholly in the + closed half-plane lying to the right of L + otherwise, A has indeterminate orientation relative to L. This + happens if A is collinear with L or if A crosses the line determined by L. + + The LineSegment to compare. + + 1 if seg is to the left of this segment, + -1 if seg is to the right of this segment, + 0 if seg is collinear to or crosses this segment. + + + + + Determines the orientation index of a relative to this segment. + The orientation index is as defined in . + + + + + 1 if p is to the left of this segment + -1 if p is to the right of this segment + 0 if p is collinear with this segment + " + + + + + + Reverses the direction of the line segment. + + + + + Puts the line segment into a normalized form. + This is useful for using line segments in maps and indexes when + topological equality rather than exact equality is desired. + + + + + Computes the distance between this line segment and another one. + + + + + + + Computes the distance between this line segment and a point. + + + + + Computes the perpendicular distance between the (infinite) line defined + by this line segment and a point. + + + + + + + Computes the that lies a given + fraction along the line defined by this segment. + + + A fraction of 0.0 returns the start point of the segment; + A fraction of 1.0 returns the end point of the segment. + If the fraction is < 0.0 or > 1.0 the point returned + will lie before the start or beyond the end of the segment. + + the fraction of the segment length along the line + the point at that distance + + + + Computes the that lies a given + + + A fraction along the line defined by this segment and offset from + the segment by a given distance. + A fraction of 0.0 offsets from the start point of the segment; + A fraction of 1.0 offsets from the end point of the segment. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + + the fraction of the segment length along the line + the distance the point is offset from the segment + (positive is to the left, negative is to the right) + the point at that distance and offset + if the segment has zero length + + + Computes the Projection Factor for the projection of the point p + onto this LineSegment. The Projection Factor is the constant r + by which the vector for this segment must be multiplied to + equal the vector for the projection of p on the line + defined by this segment. + + The projection factor will lie in the range (-inf, +inf), + or be NaN if the line segment has zero length. + + The point to compute the factor for + The projection factor for the point + + + + Computes the fraction of distance (in [0.0, 1.0]) + that the projection of a point occurs along this line segment. + If the point is beyond either ends of the line segment, + the closest fractional value (0.0 or 1.0) is returned. + + + Essentially, this is the clamped to + the range [0.0, 1.0]. + + the point + the fraction along the line segment the projection of the point occurs + + + + Compute the projection of a point onto the line determined + by this line segment. + Note that the projected point may lie outside the line segment. + If this is the case, the projection factor will lie outside the range [0.0, 1.0]. + + + + + + + Project a line segment onto this line segment and return the resulting + line segment. The returned line segment will be a subset of + the target line line segment. This subset may be null, if + the segments are oriented in such a way that there is no projection. + Note that the returned line may have zero length (i.e. the same endpoints). + This can happen for instance if the lines are perpendicular to one another. + + The line segment to project. + The projected line segment, or null if there is no overlap. + + + + Computes the closest point on this line segment to another point. + + The point to find the closest point to. + + A Coordinate which is the closest point on the line segment to the point p. + + + + + Computes the closest points on a line segment. + + + + A pair of Coordinates which are the closest points on the line segments. + + + + + Computes an intersection point between two segments, if there is one. + There may be 0, 1 or many intersection points between two segments. + If there are 0, null is returned. If there is 1 or more, a single one + is returned (chosen at the discretion of the algorithm). If + more information is required about the details of the intersection, + the {RobustLineIntersector} class should be used. + + A line segment + An intersection point, or null if there is none. + + + + + Computes the intersection point of the lines defined by two segments, if there is one. + + + There may be 0, 1 or an infinite number of intersection points between two lines. + If there is a unique intersection point, it is returned. + Otherwise, null is returned. + If more information is required about the details of the intersection, + the class should be used. + + A line segment defining a straight line + An intersection point, or null if there is none or an infinite number + + + + + Creates a LineString with the same coordinates as this segment + + the geometery factory to use + A LineString with the same geometry as this segment + + + + Returns true if o has the same values for its points. + + A LineSegment with which to do the comparison. + + true if o is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + + + + + + + + + + Compares this object with the specified object for order. + Uses the standard lexicographic ordering for the points in the LineSegment. + + + The LineSegment with which this LineSegment + is being compared. + + + A negative integer, zero, or a positive integer as this LineSegment + is less than, equal to, or greater than the specified LineSegment. + + + + + Returns true if other is + topologically equal to this LineSegment (e.g. irrespective + of orientation). + + + A LineSegment with which to do the comparison. + + + true if other is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + Return HashCode. + + + + + The end-point + + + + + The start-point + + + + + Gets the minimum X ordinate + + + + + Gets the maximum X ordinate + + + + + Gets the minimum Y ordinate + + + + + Gets the maximum Y ordinate + + + + + Computes the length of the line segment. + + The length of the line segment. + + + + Tests whether the segment is horizontal. + + true if the segment is horizontal. + + + + Tests whether the segment is vertical. + + true if the segment is vertical. + + + + The angle this segment makes with the x-axis (in radians). + + + + The midpoint of the segment + + + + Basic implementation of MultiLineString. + + + + + Represents an empty MultiLineString. + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + For create this is used a standard + with == . + + + + + Creates a in the reverse order to this object. + Both the order of the component LineStrings + and the order of their coordinate sequences are reversed. + + a in the reverse order. + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiLineString" + + + + Gets the OGC geometry type + + + + + Gets a value indicating whether this instance is closed. + + true if this instance is closed; otherwise, false. + + + + Models a collection of Points. + + + + + Represents an empty MultiPoint. + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + For create this is used a standard + with == . + + + + + + + + + + + + + Returns the Coordinate at the given position. + + The index of the Coordinate to retrieve, beginning at 0. + + The nth Coordinate. + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPoint" + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + Basic implementation of MultiPolygon. + + + + + Represents an empty MultiPolygon. + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + For create this is used a standard + with == . + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + + + + + + + + + + + Creates a {@link MultiPolygon} with every component reversed. + + The order of the components in the collection are not reversed. + An in the reverse order + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPolygon" + + + + + + + + + A bounding container for a which is in the shape of a general octagon. + + + The OctagonalEnvelope of a geometric object + is a geometry which is tight bound along the (up to) four extremal rectilineal parallels + and along the (up to) four extremal diagonal parallels. + Depending on the shape of the contained + geometry, the octagon may be degenerate to any extreme + (e.g. it may be a rectangle, a line, or a point). + + + + + Gets the octagonal envelope of a geometry + + The geometry + The octagonal envelope of the geometry + + + + Creates a new null bounding octagon + + + + + Creates a new null bounding octagon bounding a + + The coordinate to bound + + + + Creates a new null bounding octagon bounding a pair of s + + A coordinate to bound + A coordinate to bound + + + + Creates a new null bounding octagon bounding an + + + + + Creates a new null bounding octagon bounding an + (the copy constructor). + + + + + Creates a new null bounding octagon bounding a + + + + + Sets the value of this object to the null value + + + + + Tests if the extremal values for this octagon are valid. + + @return true if this object has valid values + + + + + A CoordinateSequence implementation based on a packed arrays. + A CoordinateSequence implementation based on a packed arrays. + + + + + A soft reference to the Coordinate[] representation of this sequence. + Makes repeated coordinate array accesses more efficient. + + + + + The dimensions of the coordinates hold in the packed array + + + + + The ordinates + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + + A copy of the i'th coordinate in the sequence + + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. + Note that if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + + + + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the first ordinate of a coordinate in this sequence. + + + + + + + Sets the second ordinate of a coordinate in this sequence. + + + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on doubles. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on floats. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked: + if it is over dimensions you may not get an exception but a meaningless value. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Builds packed array coordinate sequences. The array data type can be either + double or float, and defaults to double. + + + + + Initializes a new instance of the class, + using double values. + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + + + + + + Returns a CoordinateSequence based on the given array; whether or not the + array is copied is implementation-dependent. + + Coordinates array, which may not be null nor contain null elements + + + + + Returns a CoordinateSequence based on the given coordinate sequence; whether or not the + array is copied is implementation-dependent. + + + + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates + + The ordinates each coordinate has. is fix, and can be set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a single point. + + A Point is topologically valid if and only if: + + The coordinate which defines it if any) is a valid coordinate + (i.e. does not have an NaN X- or Y-ordinate + + + + + + + Represents an empty Point. + + + + + The Coordinate wrapped by this Point. + + + + + Initializes a new instance of the class. + + The coordinate used for create this . + + For create this is used a standard + with == . + + + + + Constructs a Point with the given coordinate. + + + Contains the single coordinate on which to base this Point, + or null to create the empty point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + The z coordinate. + /// + For create this is used a standard + with set to . + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + /// + For create this is used a standard + with set to . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Point" + + + + Gets the OGC geometry type + + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + + + + + + Represents a polygon with linear edges, which may include holes. + The outer boundary (shell) + and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. + The boundary rings of the polygon may have any orientation. + Polygons are closed, simple geometries by definition. + + The polygon model conforms to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + A Polygon is topologically valid if and only if: + + the coordinates which define it are valid coordinates + the linear rings for the shell and holes are valid + (i.e. are closed and do not self-intersect) + holes touch the shell or another hole at at most one point + (which implies that the rings of the shell and holes must not cross) + the interior of the polygon is connected, + or equivalently no sequence of touching holes + makes the interior of the polygon disconnected + (i.e. effectively split the polygon into two pieces). + + + + + + Represents an empty Polygon. + + + + + The exterior boundary, or null if this Polygon + is the empty point. + + + + + The interior boundaries, if any. + + + + + Initializes a new instance of the class. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + For create this is used a standard + with == . + + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Polygon" + + + + Returns the area of this Polygon + + + + + + Returns the perimeter of this Polygon. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the precision model of the Coordinates in a Geometry. + In other words, specifies the grid of allowable + points for all Geometrys. + + + The MakePrecise method allows rounding a coordinate to + a "precise" value; that is, one whose + precision is known exactly. + Coordinates are assumed to be precise in geometries. + That is, the coordinates are assumed to be rounded to the + precision model given for the point. + NTS input routines automatically round coordinates to the precision model + before creating Geometries. + All internal operations + assume that coordinates are rounded to the precision model. + Constructive methods (such as bool operations) always round computed + coordinates to the appropriate precision model. + Currently three types of precision model are supported: + + Floating: represents full double precision floating point. + This is the default precision model used in NTS + FloatingSingle: represents single precision floating point. + Fixed: represents a model with a fixed number of decimal places. + + A Fixed Precision Model is specified by a scale factor. + The scale factor specifies the size of the grid which numbers are rounded to. + Input coordinates are mapped to fixed coordinates according to the following + equations: + + jtsPt.x = round( (inputPt.x * scale ) / scale + jtsPt.y = round( (inputPt.y * scale ) / scale + + + For example, to specify 3 decimal places of precision, use a scale factor + of 1000. To specify -3 decimal places of precision (i.e. rounding to + the nearest 1000), use a scale factor of 0.001. + + Coordinates are represented internally as Java double-precision values. + Since .NET uses the IEEE-394 floating point standard, this + provides 53 bits of precision. (Thus the maximum precisely representable + integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). + + NTS binary methods currently do not handle inputs which have different precision models. + The precision model of any constructed geometric value is undefined. + + + + + The maximum precise value representable in a double. Since IEE754 + double-precision numbers allow 53 bits of mantissa, the value is equal to + 2^53 - 1. This provides almost 16 decimal digits of precision. + + + + + Determines which of two s is the most precise + + A precision model + A precision model + The PrecisionModel which is most precise + + + + The type of PrecisionModel this represents. + + + + + The scale factor which determines the number of decimal places in fixed precision. + + + + + Creates a PrecisionModel with a default precision + of Floating. + + + + + Creates a PrecisionModel that specifies + an explicit precision model type. + If the model type is Fixed the scale factor will default to 1. + + + The type of the precision model. + + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate + + Not used. + Not used. + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate. + + + + + Copy constructor to create a new PrecisionModel + from an existing one. + + + + + + Return HashCode. + + + + + Sets internal to the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the + precise representation of external. + + + + + Returns the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the precise + representation of external + + + + + Returns the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Sets external to the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Rounds a numeric value to the PrecisionModel grid. + Symmetric Arithmetic Rounding is used, to provide + uniform rounding behaviour no matter where the number is + on the number line. + + + This method has no effect on NaN values + + + + + + Rounds a Coordinate to the PrecisionModel grid. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compares this PrecisionModel object with the specified object for order. + A PrecisionModel is greater than another if it provides greater precision. + The comparison is based on the value returned by the + {getMaximumSignificantDigits) method. + This comparison is not strictly accurate when comparing floating precision models + to fixed models; however, it is correct when both models are either floating or fixed. + + + The PrecisionModel with which this PrecisionModel + is being compared. + + + A negative integer, zero, or a positive integer as this PrecisionModel + is less than, equal to, or greater than the specified PrecisionModel. + + + + + + + + + + + + Tests whether the precision model supports floating point. + + true if the precision model supports floating point. + + + + Returns the maximum number of significant digits provided by this + precision model. + Intended for use by routines which need to print out precise values. + + + The maximum number of decimal places provided by this precision model. + + + + + Returns the scale factor used to specify a fixed precision model. + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + The scale factor for the fixed precision model + + + + + Gets the type of this PrecisionModel. + + + + + + Returns the x-offset used to obtain a precise coordinate. + + + The amount by which to subtract the x-coordinate before + multiplying by the scale. + + + + + Returns the y-offset used to obtain a precise coordinate. + + + The amount by which to subtract the y-coordinate before + multiplying by the scale + + + + + A base class containing the logic for computes the contains + and covers spatial relationship predicates + for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + Contains and covers are very similar, and differ only in how certain + cases along the boundary are handled. These cases require + full topological evaluation to handle, so all the code in + this class is common to both predicates. + + + It is not possible to short-circuit in all cases, in particular + in the case where line segments of the test geometry touches the polygon linework. + In this case full topology must be computed. + (However, if the test geometry consists of only points, this + can be evaluated in an optimized fashion. + + + Martin Davis + + + + A base class for predicate operations on s. + + mbdavis + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether all components of the test Geometry are contained in the target geometry. + + Handles both linear and point components. + A geometry to test + + true if all componenta of the argument are contained in the target geometry + + + + + Tests whether all components of the test Geometry are contained in the interior of the target geometry. + + Handles both linear and point components. + A geometry to test + true if all componenta of the argument are contained in the target geometry interior + + + + Tests whether any component of the test Geometry intersects the area of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry + + + + Tests whether any component of the test Geometry intersects the interior of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry interior + + + + Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) + + The test geometry + The representative points of the target geometry + true if any component intersects the areal test geometry + + + This flag controls a difference between contains and covers. + + For contains the value is true. + For covers the value is false. + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Evaluate the contains or covers relationship + for the given geometry. + + the test geometry + true if the test geometry is contained + + + + Tests whether a geometry consists of a single polygon with no holes. + + True if the geometry is a single polygon with no holes + + + + Computes the full topological predicate. + Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon has the relationship with the test geometry + + + + A base class for subclasses. + + + Contains default implementations for methods, which simply delegate to the equivalent methods. + This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. + + Martin Davis + + + + Tests whether any representative of the target geometry intersects the test geometry. + This is useful in A/A, A/L, A/P, L/P, and P/P cases. + + The test geometry + true if any component intersects the areal test geometry + + + + Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. + + A geometry + true if the envelopes intersect + + + + Determines whether the envelope of this geometry covers the Geometry g. + + A geometry + true if g is contained in this envelope + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + Default implementation. + + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + Default implementation. + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + Default implementation. + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + Default implementation. + + + + Tests whether the base is disjoint from given geometry. + + The geometry to test + true if this geometry is disjoint from the given geometry + + Default implementation. + + + + Tests whether the base intersects a given geometry. + + The geometry to test + true if this geometry intersects the given geometry + + Default implementation. + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + Default implementation. + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + Default implementation. + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + Default implementation. + + + + Gets the list of representative points for this geometry. + One vertex is included for every component of the geometry + (i.e. including one for every ring of polygonal geometries). + + Do not modify the returned list! + + + + + A factory for creating s. It chooses an appropriate implementation of PreparedGeometry + based on the geoemtric type of the input geometry. + + + In the future, the factory may accept hints that indicate + special optimizations which can be performed. + + Martin Davis + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + mbdavis + + + + Computes the intersects spatial relationship predicate + for a target relative to other classes. + + + Uses short-circuit tests and indexing to improve performance. + + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared linestring + A test geometry + true if the linestring intersects the geometry + + + + Creates an instance of this operation. + + The target PreparedLineString + + + + Tests whether this geometry intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Tests whether any representative point of the test Geometry intersects + the target geometry. + + + Only handles test geometries which are Puntal (dimension 0) + + A Puntal geometry to test + true if any point of the argument intersects the prepared geometry + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + Martin Davis + + + + Tests whether this point intersects a . + + + The optimization here is that computing topology for the test geometry + is avoided. This can be significant for large geometries. + + + + + A prepared version for geometries. + This class supports both s and s. + This class does not support MultiPolygons which are non-valid + (e.g. with overlapping elements). + + + Instances of this class are thread-safe and immutable. + + mbdavis + + + + Computes the contains spatial relationship predicate for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + It is not possible to short-circuit in all cases, in particular + in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + + Martin Davis + + + + Computes the contains spatial relationship predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon contains the geometry + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon contains a given geometry. + + The test geometry + true if the test geometry is contained + + + + Computes the full topological contains predicate.
+ Used when short-circuit tests are not conclusive. +
+ The test geometry + true if this prepared polygon contains the test geometry +
+ + + Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
+ Uses short-circuit tests and indexing to improve performance. +
+ + + A Geometry A containsProperly another Geometry B iff + all points of B are contained in the Interior of A. + Equivalently, B is contained in A AND B does not intersect + the Boundary of A. + + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + In a situation with many geometries intersecting the boundary + of the target geometry, this can make a performance difference. + + + Martin Davis +
+ + Computes the containsProperly predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon properly contains the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon containsProperly a given geometry. + + The test geometry + true if the polygon properly contains the geometry + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + + Uses short-circuit tests and indexing to improve performance. + + It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + Martin Davis + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + The prepared polygon + A test geometry + true if the polygon covers the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon covers a given geometry. + + The test geometry + true if the test geometry is covered + + + + Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon covers the test geometry + + + + Computes the intersects spatial relationship predicate + for s relative to all other classes. + + Uses short-circuit tests and indexing to improve performance. + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared polygon + A test geometry + true if the polygon intersects the geometry + + + + Creates an instance of this operation. + + The prepared polygon + + + + Tests whether this PreparedPolygon intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Indicates an invalid or inconsistent topological situation encountered during processing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a planar triangle, and provides methods for calculating various + properties of triangles. + + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + + Tests whether a triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 degrees. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + True if the triangle is acute. + + + + Computes the line which is the perpendicular bisector of the + + A point + Another point + The perpendicular bisector, as an HCoordinate line segment a-b. + + + Computes the circumcentre of a triangle. + + The circumcentre is the centre of the circumcircle, + the smallest circle which encloses the triangle. + It is also the common intersection point of the + perpendicular bisectors of the sides of the triangle, + and is the only point which has equal distance to all three + vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. For example, + the circumcentre of an obtuse isoceles triangle lies outside the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The circumcentre of the triangle + + + + Computes the determinant of a 2x2 matrix. Uses standard double-precision + arithmetic, so is susceptible to round-off error. + + the [0,0] entry of the matrix + the [0,1] entry of the matrix + the [1,0] entry of the matrix + the [1,1] entry of the matrix + The determinant + + + + Computes the incentre of a triangle. + + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + It is also the point at which the bisectors of the triangle's angles meet. + It is the centre of the triangle's InCircle, which is the unique circle + that is tangent to each of the triangle's three sides. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point which is the incentre of the triangle + + + Computes the centroid (centre of mass) of a triangle. + + This is also the point at which the triangle's three + medians intersect (a triangle median is the segment from a vertex of the triangle to the + midpoint of the opposite side). + The centroid divides each median in a ratio of 2:1. + The centroid always lies within the triangle. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The centroid of the triangle + + + Computes the length of the longest side of a triangle + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The length of the longest side of the triangle + + + Computes the point at which the bisector of the angle ABC cuts the segment AC. + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The angle bisector cut point + + + + Computes the 2D area of a triangle. + The area value is always non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + Computes the signed 2D area of a triangle. + + + + The area value is positive if the triangle is oriented CW, + and negative if it is oriented CCW. + + + The signed area value can be used to determine point orientation, but + the implementation in this method is susceptible to round-off errors. + Use for robust orientation + calculation. + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + + Computes the 3D area of a triangle. + The value computed is alway non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The 3D area of the triangle + + + + Computes the Z-value (elevation) of an XY point + on a three-dimensional plane defined by a triangle + whose vertices have Z-values. + The defining triangle must not be degenerate + (in other words, the triangle must enclose a + non-zero area), + and must not be parallel to the Z-axis. + + This method can be used to interpolate + the Z-value of a point inside a triangle + (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + The computed Z-value (elevation) of the point + + + + Creates a new triangle with the given vertices. + + A vertex + A vertex + A vertex + + + + Computes the InCentre of this triangle + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + This is also the point at which the bisectors of the angles meet. + It is the centre of the triangle's InCircle, + which is the unique circle that is tangent to each of the triangle's three sides. + + + The point which is the InCentre of the triangle. + + + + + Tests whether this triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 + degrees. + + true if this triangle is acute + + + + Computes the circumcentre of this triangle. The circumcentre is the centre + of the circumcircle, the smallest circle which encloses the triangle. It is + also the common intersection point of the perpendicular bisectors of the + sides of the triangle, and is the only point which has equal distance to + all three vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + The circumcentre of this triangle + + + + Computes the centroid (centre of mass) of this triangle. This is also the + point at which the triangle's three medians intersect (a triangle median is + the segment from a vertex of the triangle to the midpoint of the opposite + side). The centroid divides each median in a ratio of 2:1. + + The centroid always lies within the triangle. + + The centroid of this triangle + + + + Computes the length of the longest side of this triangle + + The length of the longest side of this triangle + + + + Computes the 2D area of this triangle. The area value is always + non-negative. + + The area of this triangle + + + + + Computes the signed 2D area of this triangle. The area value is positive if + the triangle is oriented CW, and negative if it is oriented CCW. + + The signed area value can be used to determine point orientation, but the + implementation in this method is susceptible to round-off errors. Use + + for robust orientation calculation. + + The signed 2D area of this triangle + + + + + Computes the 3D area of this triangle. The value computed is alway + non-negative. + + The 3D area of this triangle + + + + Computes the Z-value (elevation) of an XY point on a three-dimensional + plane defined by this triangle (whose vertices must have Z-values). This + triangle must not be degenerate (in other words, the triangle must enclose + a non-zero area), and must not be parallel to the Z-axis. + + This method can be used to interpolate the Z-value of a point inside this + triangle (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + The computed Z-value (elevation) of the point + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + Represents an affine transformation on the 2D Cartesian plane. + + + + It can be used to transform a or . + An affine transformation is a mapping of the 2D plane into itself + via a series of transformations of the following basic types: +
    +
  • reflection (through a line)
  • +
  • rotation (around the origin)
  • +
  • scaling (relative to the origin)
  • +
  • shearing (in both the X and Y directions)
  • +
  • translation
  • +
+
+ + In general, affine transformations preserve straightness and parallel lines, + but do not preserve distance or shape. + + + An affine transformation can be represented by a 3x3 + matrix in the following form: +
+            T = | m00 m01 m02 |
+                | m10 m11 m12 |
+                |  0   0   1  |
+            
+ A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') + by representing it as a 3x1 matrix and using matrix multiplication to compute: +
+            | x' |  = T x | x |
+            | y' |        | y |
+            | 1  |        | 1 |
+            
+
+

Transformation Composition

+ + Affine transformations can be composed using the method. + Composition is computed via multiplication of the + transformation matrices, and is defined as: +
+            A.compose(B) = TB x TA
+            
+
+ + This produces a transformation whose effect is that of A followed by B. + The methods , , + , , and + have the effect of composing a transformation of that type with + the transformation they are invoked on. + The composition of transformations is in general not commutative. + +

Transformation Inversion

+ + Affine transformations may be invertible or non-invertible. + If a transformation is invertible, then there exists + an inverse transformation which when composed produces + the identity transformation. + The method + computes the inverse of a transformation, if one exists. + + + @author Martin Davis + +
+
+ + + Creates a transformation for a reflection about the + line (x0,y0) - (x1,y1). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + the x-ordinate of a another point on the reflection line + the y-ordinate of a another point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a reflection about the + line (0,0) - (x,y). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a rotation + about the origin + by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + a transformation for the rotation + + + + Creates a transformation for a rotation + by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a scaling relative to the origin. + + the value to scale by in the x direction + the value to scale by in the y direction + a transformation for the scaling + + + + Creates a transformation for a scaling relative to the point (x,y). + + The value to scale by in the x direction + The value to scale by in the y direction + The x-ordinate of the point to scale around + The y-ordinate of the point to scale around + A transformation for the scaling + + + + Creates a transformation for a shear. + + the value to shear by in the x direction + the value to shear by in the y direction + a tranformation for the shear + + + + Creates a transformation for a translation. + + the value to translate by in the x direction + the value to translate by in the y direction + a tranformation for the translation + + + + Constructs a new identity transformation + + + + + Constructs a new transformation whose + matrix has the specified values. + + an array containing the 6 values { m00, m01, m02, m10, m11, m12 } + if matrix is null + if matrix is too small + + + + Constructs a new transformation whose + matrix has the specified values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + + + + Constructs a transformation which is + a copy of the given one. + + the transformation to copy + + + + Constructs a transformation + which maps the given source + points into the given destination points. + + source point 0 + source point 1 + source point 2 + the mapped point for source point 0 + the mapped point for source point 1 + the mapped point for source point 2 + + + + Sets this transformation to be the identity transformation. + + + The identity transformation has the matrix: +
+            | 1 0 0 |
+            | 0 1 0 |
+            | 0 0 1 |
+            
+
+ this transformation, with an updated matrix +
+ + + Sets this transformation's matrix to have the given values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + this transformation, with an updated matrix + + + + Sets this transformation to be a copy of the given one + + a transformation to copy + this transformation, with an updated matrix + + + + Computes the inverse of this transformation, if one + exists. + + + + * The inverse is the transformation which when + * composed with this one produces the identity + * transformation. + * A transformation has an inverse if and only if it + * is not singular (i.e. its + * determinant is non-zero). + * Geometrically, an transformation is non-invertible + * if it maps the plane to a line or a point. + * If no inverse exists this method + * will throw a . + + + * The matrix of the inverse is equal to the + * inverse of the matrix for the transformation. + * It is computed as follows: + *
+            *                 1
+            * inverse(A)  =  ---   x  adjoint(A)
+            *                det
+            *
+            *
+            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
+            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
+            *                det      |  0     0     m00*m11-m10*m01  |
+            *
+            *
+            *
+            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
+            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
+            *               |   0           0          1               |
+            *
+            * 
+
+
+ A new inverse transformation + + +
+ + + Explicitly computes the math for a reflection. May not work. + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection + about the line defined by vector (x,y). + + + The transformation for a reflection + is computed by: +
+            d = sqrt(x2 + y2)
+            sin = x / d;
+            cos = x / d;
+            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
+            
+
+ the x-component of the reflection line vector + the y-component of the reflection line vector + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the orign. + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle theta + has the value: +
+            |  cos(theta)  -sin(theta)   0 |
+            |  sin(theta)   cos(theta)   0 |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the origin + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   0 |
+            |  sinTheta   cosTheta   0 |
+            |         0          0   1 |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y). + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y) + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |         0          0         1       |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a scaling. + + + The transformation matrix for a scale + has the value: +
+            |  xScale      0  dx |
+            |  1      yScale  dy |
+            |  0           0   1 |
+            
+
+ the amount to scale x-ordinates by + the amount to scale y-ordinates by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a shear. + + + The transformation matrix for a shear + has the value: +
+            |  1      xShear  0 |
+            |  yShear      1  0 |
+            |  0           0  1 |
+            
+ Note that a shear of (1, 1) is not + equal to shear(1, 0) composed with shear(0, 1). + Instead, shear(1, 1) corresponds to a mapping onto the + line x = y. +
+ the x component to shear by + the y component to shear by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a translation. + + + For a translation by the vector (x, y) + the transformation matrix has the value: +
+            |  1  0  dx |
+            |  1  0  dy |
+            |  0  0   1 |
+            
+
+ the x component to translate by + the y component to translate by + this transformation, with an updated matrix +
+ + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of the line to reflect around + the y-ordinate of the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation transformation composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by in radians + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around the origin composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a scale transformation composed + with the current value. + + the value to scale by in the x direction + the value to scale by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a shear transformation composed + with the current value. + + the value to shear by in the x direction + the value to shear by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a translation transformation composed + with the current value. + + the value to translate by in the x direction + the value to translate by in the y direction + this transformation, with an updated matrix + + + + Updates this transformation to be + the composition of this transformation with the given . + + + This produces a transformation whose effect + is equal to applying this transformation + followed by the argument transformation. + Mathematically, +
+            A.compose(B) = TB x TA
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Updates this transformation to be the composition + of a given with this transformation. + + + This produces a transformation whose effect + is equal to applying the argument transformation + followed by this transformation. + Mathematically, +
+            A.composeBefore(B) = TA x TB
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Applies this transformation to the coordinate + and places the results in the coordinate + (which may be the same as the source). + + the coordinate to transform + the coordinate to accept the results + the dest coordinate + + + + + Cretaes a new which is the result of this transformation applied to the input Geometry. + + A Geometry + The transformed Geometry + + + + Applies this transformation to the i'th coordinate + in the given CoordinateSequence. + + a CoordinateSequence + the index of the coordinate to transform + + + + Transforms the i'th coordinate in the input sequence + + A CoordinateSequence + The index of the coordinate to transform + + + + Tests if an object is an AffineTransformation and has the same matrix as this transformation. + + An object to test + true if the given object is equal to this object + + + + Gets a text representation of this transformation. + The string is of the form: + + AffineTransformation[[m00, m01, m02], [m10, m11, m12]] + + + A string representing this transformation + + + + Clones this transformation + + A copy of this transformation + + + + Gets an array containing the entries + of the transformation matrix. + + + Only the 6 non-trivial entries are returned, + in the sequence: +
+            m00, m01, m02, m10, m11, m12
+            
+
+ an array of length 6 +
+ + + Computes the determinant of the transformation matrix. + + + + The determinant is computed as: +
+             | m00 m01 m02 |
+             | m10 m11 m12 | = m00 * m11 - m01 * m10
+             |  0   0   1  |
+             
+
+ + If the determinant is zero, + the transform is singular (not invertible), + and operations which attempt to compute + an inverse will throw a . + +
+ the determinant of the transformation + + + The determinant of the transformation + +
+ + + Reports that this filter should continue to be executed until + all coordinates have been transformed. + + false + + + Tests if this transformation is the identity transformation. + + + + Builds an defined by a set of control vectors. + + + + A control vector consists of a source point and a destination point, + which is the image of the source point under the desired transformation. + + + A transformation is well-defined + by a set of three control vectors + if and only if the source points are not collinear. + (In particular, the degenerate situation + where two or more source points are identical will not produce a well-defined transformation). + A well-defined transformation exists and is unique. + If the control vectors are not well-defined, the system of equations + defining the transformation matrix entries is not solvable, + and no transformation can be determined. + + No such restriction applies to the destination points. + However, if the destination points are collinear or non-unique, + a non-invertible transformations will be generated. + + + This technique of recovering a transformation + from its effect on known points is used in the Bilinear Interpolated Triangulation + algorithm for warping planar surfaces. + + + Martin Davis + + + + Constructs a new builder for the transformation defined by the given set of control point mappings. + + A control point + A control point + A control point + The image of under the required transformation + The image of under the required transformation + The image of under the required transformation + + + + Computes the + determined by the control point mappings, + or null if the control vectors do not determine a well-defined transformation. + + + + An affine transformation + null if the control vectors do not determine a well-defined transformation. + + + + + + Computes the transformation matrix by + solving the two systems of linear equations + defined by the control point mappings, + if this is possible. + + True if the transformation matrix is solvable + + + + Solves the transformation matrix system of linear equations + for the given right-hand side vector. + + The vector for the right-hand side of the system + The solution vector, if it can be determinated, otherwise null + + + + Supports creating s defined by various kinds of inputs and transformation mapping rules. + + Martin Davis + + + + Creates a tranformation from a set of three control vectors. A control + vector consists of a source point and a destination point, which is the + image of the source point under the desired transformation. Three control + vectors allows defining a fully general affine transformation. + + + + + + + + The computed transformation + + + + Creates an AffineTransformation defined by a pair of control vectors. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. The + computed transformation is a combination of one or more of a uniform scale, + a rotation, and a translation (i.e. there is no shear component and no + reflection) + + + + + + The computed transformation + null if the control vectors do not determine a well-defined transformation + + + + Creates an AffineTransformation defined by a single control vector. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. This + produces a translation. + + The start point of the control vector + The end point of the control vector + The computed transformation + + + + Creates an AffineTransformation defined by a set of control vectors. + Between one and three vectors must be supplied. + + The source points of the vectors + The destination points of the vectors + The computed transformation + if the control vector arrays are too short, long or of different lengths + + + + Creates an AffineTransformation defined by a maping between two baselines. + The computed transformation consists of: + + a translation from the start point of the source baseline to the start point of the destination baseline, + a rotation through the angle between the baselines about the destination start point, + and a scaling equal to the ratio of the baseline lengths. + + If the source baseline has zero length, an identity transformation is returned. + + The start point of the source baseline + The end point of the source baseline + The start point of the destination baseline + The end point of the destination baseline + + + + + Extracts a single representative from each connected component of a . + + 1.9 + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The Geometry from which to extract + A list of Coordinates + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + Maps the members of a + into another GeometryCollection via a defined + mapping function. + + Martin Davis + + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + Combines s to produce a of the most appropriate type. + + + Input geometries which are already collections will have their elements extracted first. + No validation of the result geometry is performed. + (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). + + mbdavis + + + + Combines a collection of geometries. + The geometries to combine + The combined geometry + + + + Combines two geometries. + + A geometry to combine + A geometry to combine + The combined geometry + + + + Combines three geometries. + + A geometry to combine + A geometry to combine + A geometry to combine + The combined geometry + + + + Creates a list from two items + + + + A list from two geometries + + + + Creates a list from three items + + + + + A list from three geometries + + + + Creates a new combiner for a collection of geometries + + The geometries to combine + + + + Extracts the GeometryFactory used by the geometries in a collection + + + a GeometryFactory + + + + Computes the combination of the input geometries to produce the most appropriate or + + A Geometry which is the combination of the inputs + + + + + Value indicating whether empty geometries should be skipped + + + + + A class which supports creating new s + which are modifications of existing ones, + maintaining the same type structure. + + + Geometry objects are intended to be treated as immutable. + This class allows you to "modifies" a Geometrys + by traversing them, applying a user-defined + , or + and creating a new Geometrys with the same structure but + (possibly) modified components. + + Examples of the kinds of modifications which can be made are: + + + The values of the coordinates may be changed. + The editor does not check whether changing coordinate values makes the result Geometry invalid + + + The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). + The modifed coordinate lists must be consistent with their original parent component + (e.g. a LinearRing must always have at least 4 coordinates, and the first and last + coordinate must be equal). + + + Components of the original point may be deleted + (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). + Deletions will be propagated up the component tree appropriately. + + + + All changes must be consistent with the original Geometry's structure + (e.g. a Polygon cannot be collapsed into a LineString). + If changing the structure is required, use a . + + + This class supports creating an edited Geometry + using a different via the + constructor. + Examples of situations where this is required is if the geometry is + transformed to a new SRID and/or a new PrecisionModel. + + Usage notes + + The resulting Geometry is not checked for validity. + If validity needs to be enforced, the new Geometry's + method should be called. + By default the UserData of the input geometry is not copied to the result. + + + + + + + + + The factory used to create the modified Geometry. + + + If null the GeometryFactory of the input is used. + + + + + Creates a new GeometryEditor object which will create + edited with the same as the input Geometry. + + + + + Creates a new GeometryEditor object which will create + edited s with the given . + + The GeometryFactory to create the edited Geometry with. + + + + Edit the input Geometry with the given edit operation. + Clients can create subclasses of GeometryEditorOperation or + CoordinateOperation to perform required modifications. + + The Geometry to edit. + The edit operation to carry out. + A new Geometry which is the result of the editing (which may be empty). + + + + Gets or sets a value indicating if the User Data is copied to the edit result. + If so, only the object reference is copied. + + + + + A interface which specifies an edit operation for Geometries. + + + + + Edits a Geometry by returning a new Geometry with a modification. + The returned Geometry may be the input geometry itself. + It may be null if the geometry is to be deleted. + + The Geometry to modify. + + The factory with which to construct the modified Geometry + (may be different to the factory of the input point). + + A new Geometry which is a modification of the input Geometry. + null if the Geometry is to be deleted completely + + + + A GeometryEditorOperation which does not modify + the input geometry. + This can be used for simple changes of + (including PrecisionModel and SRID). + + mbdavis + + + + A GeometryEditorOperation which edits the coordinate list of a Geometry. + Operates on Geometry subclasses which contains a single coordinate list. + + + + + + + + + + + + + Edits the array of Coordinates from a Geometry. + + The coordinate array to operate on. + The point containing the coordinate list. + An edited coordinate array (which may be the same as the input). + + + + A which edits the + of a . + + Operates on Geometry subclasses which contains a single coordinate list. + + + + An edited coordinate sequence (which may be the same as the input) + + + + Extracts the components of a given type from a . + + + + + Extracts the T components from an and adds them to the provided . + + the geometry from which to extract + the list to add the extracted elements to + The geometry type to extract + + + + Extracts the T elements from a single and returns them in a . + + the geometry from which to extract + + + + Extracts the components of type T from a . + + + + + Constructs a filter with a list in which to store the elements found. + + The list to extract into + + + + Extracts all the 1-dimensional () components from a . + For polygonal geometries, this will extract all the component s. + If desired, s can be forced to be returned as s. + + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single point. + If more than one point is to be processed, it is more + efficient to create a single LineExtracterFilter instance + and pass it to multiple geometries. + + The point from which to extract linear components. + The list of linear components. + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The geometry from which to extract linear components + true if s should be converted to s + The list of linear components + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + true if s should be converted to s + A linear geometry + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single + and adds them to the. + + The geometry from which to extract + The list to add the extracted elements to + The list argument + + + + Extracts the elements from a single + and returns them in a . + + The geometry from which to extract + A list containing the linear elements + + + + Extracts the elements from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Constructs a filter with a list in which to store the elements found. + + + + + Implements some 2D matrix operations (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination.
+ In order to avoid overhead the algorithm runs in-place + on A - if A should not be modified the client must supply a copy. +
+ A an nxn matrix in row/column order )modified by this method) + A vector of length n + if the matrix is the wrong size + + + A vector containing the solution (if any) + null if the system has no or no unique solution + + +
+ + + Indicates that an is non-invertible. + + Martin Davis + + + + Extracts all the 0-dimensional (Point) components from a Geometry. + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + the geometry from which to extract + + + + Constructs a PointExtracterFilter with a list in which to store Points found. + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + The geometry from which to extract + + + + Constructs a PolygonExtracterFilter with a list in which to store Polygons found. + + + + + + + + + + + + A visitor to elements which componets, which + allows short-circuiting when a defined condition holds. + + + + + + + + + + + + + + + + + + + + + + + A Depth object records the topological depth of the sides + of an Edge for up to two Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Depth object is null (has never been initialized) if all depths are null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalize the depths for each point, if they are non-null. + A normalized depth + has depth values in the set { 0, 1 }. + Normalizing the depths + involves reducing the depths by the same amount so that at least + one of them is 0. If the remaining value is > 0, it is set to 1. + + + + + + + + + + + Calls GetDepth and SetDepth. + + + + + + + + + + + + + Models the end of an edge incident on a node. + + + + EdgeEnds have a direction determined by the direction of the ray from the initial + point to the next point. + + + EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". + This ordering is used to sort EdgeEnds around a node. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the total order relation: + a has a greater angle with the positive x-axis than b. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is obviously susceptible to roundoff. + A robust algorithm is: + - first compare the quadrant. If the quadrants + are different, it it trivial to determine which vector is "greater". + - if the vectors lie in the same quadrant, the computeOrientation function + can be used to decide the relative orientation of the vectors. + + + + + + Subclasses should override this if they are using labels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes the factor for the change in depth when moving from one location to another. + E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. + + + + + + + + + + The depth of each side (position) of this edge. + The 0 element of the array is never used. + + + + + + + + + + + + + + + + + + + + + + + + + + Compute the label in the appropriate orientation for this DirEdge. + + + + + Set both edge depths. + One depth for a given side is provided. + The other is computed depending on the Location + transition and the depthDelta of the edge. + + + + + + + Set both edge depths. One depth for a given side is provided. The other is + computed depending on the Location transition and the depthDelta of the edge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VisitedEdge get property returns true if bot Visited + and Sym.Visited are true. + VisitedEdge set property marks both DirectedEdges attached to a given Edge. + This is used for edges corresponding to lines, which will only + appear oriented in a single direction in the result. + + + + + + + + + + + + + + + + + + + + + + + + + This edge is a line edge if + at least one of the labels is a line label + any labels which are not line labels have all Location = Exterior. + + + + + This is an interior Area edge if + its label is an Area label for both Geometries + and for each Geometry both sides are in the interior. + + true if this is an interior Area edge. + + + + A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. + It supports labelling the edges as well as linking the edges to form both + MaximalEdgeRings and MinimalEdgeRings. + + + + + A EdgeEndStar is an ordered list of EdgeEnds around a node. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + A map which maintains the edges in sorted order around the node. + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + The location of the point for this star in Geometry i Areas. + + + + + Insert a EdgeEnd into this EdgeEndStar. + + + + + + Insert an EdgeEnd into the map, and clear the edgeList cache, + since the list of edges has now changed. + + + + + + + Iterator access to the ordered list of edges is optimized by + copying the map collection to a list. (This assumes that + once an iterator is requested, it is likely that insertion into + the map is complete). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate for the node this star is based at. + + + + + + + + + + + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + Insert a directed edge in the list. + + + + + + + + + + + + + + + + + + + + + + + + + Compute the labelling for all dirEdges in this star, as well + as the overall labelling. + + + + + + For each dirEdge in the star, merge the label . + + + + + Update incomplete dirEdge labels from the labelling for the node. + + + + + + + + + + + + Traverse the star of DirectedEdges, linking the included edges together. + To link two dirEdges, the next pointer for an incoming dirEdge + is set to the next outgoing edge. + DirEdges are only linked if: + they belong to an area (i.e. they have sides) + they are marked as being in the result + Edges are linked in CCW order (the order they are stored). + This means that rings have their face on the Right + (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). + PRECONDITION: No pair of dirEdges are both marked as being in the result. + + + + + + + + + + + + + + + + Traverse the star of edges, maintaing the current location in the result + area at this node (if any). + If any L edges are found in the interior of the result, mark them as covered. + + + + + + + + + + + Compute the DirectedEdge depths for a subsequence of the edge array. + + The last depth assigned (from the R side of the last edge visited). + + + + + + + + + + + + + + + + + + + + A GraphComponent is the parent class for the objects' + that form a graph. Each GraphComponent can carry a + Label. + + + + + + + + + + + + + + + + + + + + + Compute the contribution to an IM for this component. + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + + + + + + + + + + + IsInResult indicates if this component has already been included in the result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A coordinate in this component (or null, if there are none). + + + + + An isolated component is one that does not intersect or touch any other + component. This is the case if the label has valid locations for + only a single Geometry. + + true if this component is isolated. + + + + Updates an IM from the label for an edge. + Handles edges from both L and A geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an EdgeIntersection for intersection intIndex. + An intersection that falls exactly on a vertex of the edge is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if the coordinate sequences of the Edges are identical. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The depthDelta is the change in depth as an edge is crossed from R to L. + + The change in depth as the edge is crossed from R to L. + + + + + + + + + + + + + + + + + + + + + + + + An Edge is collapsed if it is an Area edge and it consists of + two segments which are equal and opposite (eg a zero-width V). + + + + + + + + + + + + + + + + + + + + An EdgeIntersection represents a point on an + edge which intersects with another edge. + The intersection may either be a single point, or a line segment + (in which case this point is the start of the line segment) + The label attached to this intersection point applies to + the edge from this point forwards, until the next + intersection or the end of the edge. + The intersection point must be precise. + + + + + + + + + + + + + + + + + + + + + + + + + -1 this EdgeIntersection is located before the argument location, + 0 this EdgeIntersection is at the argument location, + 1 this EdgeIntersection is located after the argument location. + + + + + + + + + + + + + + + + + + The point of intersection. + + + + + The index of the containing line segment in the parent edge. + + + + + The edge distance of this point along the containing line segment. + + + + + A list of edge intersections along an Edge. + + + + + + + + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + + The EdgeIntersection found or added. + + + + Returns an iterator of EdgeIntersections. + + + + + + + + + + + + Adds entries for the first and last points of the edge to the list. + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the input list (this is so a single list + can be used to accumulate all split edges for a Geometry). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + + + + + + + + + + + + A EdgeList is a list of Edges. It supports locating edges + that are pointwise equals to a target edge. + + + + + + Remove the selected Edge element from the list if present. + + Edge element to remove from list + + + + Insert an edge unless it is already in the list. + + + + + + + + + + + + If there is an edge equal to e already in the list, return it. + Otherwise return null. + + + + equal edge, if there is one already in the list, + null otherwise. + + + + + + + + + + + + + + + + + + If the edge e is already in the list, return its index. + + + + Index, if e is already in the list, + -1 otherwise. + + + + + + + + + + + + + + + + + + + + + + + Validates that a collection of is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Checks whether the supplied s are correctly noded. + + an enumeration of Edges. + If the SegmentStrings are not correctly noded + + + + Creates a new validator for the given collection of s. + + + + + Checks whether the supplied edges are correctly noded. + + If the SegmentStrings are not correctly noded + + + + + + + + + The directed edge which starts the list of edges for this EdgeRing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compute a LinearRing from the point list previously collected. + Test if the ring is a hole (i.e. if it is CCW) and set the hole flag + accordingly. + + + + + + + + + + + + + + + + + + + Collect all the points from the DirectedEdges of this ring into a contiguous list. + + + + + + + + + + + + + + + + + + + + + + Merge the RHS label from a DirectedEdge into the label for this EdgeRing. + The DirectedEdge label may be null. This is acceptable - it results + from a node which is NOT an intersection node between the Geometries + (e.g. the end node of a LinearRing). In this case the DirectedEdge label + does not contribute any information to the overall labelling, and is simply skipped. + + + + + + + + + + + + + + + This method will cause the ring to be computed. + It will also check any holes, if they have been assigned. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the list of DirectedEdges that make up this EdgeRing. + + + + + + + + + + A GeometryGraph is a graph that models a given Geometry. + + + + + The computation of the IntersectionMatrix relies on the use of a structure + called a "topology graph". The topology graph contains nodes and edges + corresponding to the nodes and line segments of a Geometry. Each + node and edge in the graph is labeled with its topological location relative to + the source point. + Note that there is no requirement that points of self-intersection be a vertex. + Thus to obtain a correct topology graph, Geometrys must be + self-noded before constructing their graphs. + Two fundamental operations are supported by topology graphs: + Computing the intersections between all the edges and nodes of a single graph + Computing the intersections between the edges and nodes of two different graphs + + + + + For nodes in the Collection, link the DirectedEdges at the node that are in the result. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The node if found; null otherwise + + + + + + Add a set of edges to the graph. For each edge two DirectedEdges + will be created. DirectedEdges are NOT linked by this method. + + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Returns the EdgeEnd which has edge e as its base edge + (MD 18 Feb 2002 - this should return a pair of edges). + + + The edge, if found null if the edge was not found. + + + + Returns the edge whose first two coordinates are p0 and p1. + + + + The edge, if found null if the edge was not found. + + + + Returns the edge which starts at p0 and whose first segment is + parallel to p1. + + + + The edge, if found null if the edge was not found. + + + + The coordinate pairs match if they define line segments lying in the same direction. + E.g. the segments are parallel and in the same quadrant + (as opposed to parallel and opposite!). + + + + + + + + + + + + + + + + + + + + + + + + + This method implements the Boundary Determination Rule + for determining whether + a component (node or edge) that appears multiple times in elements + of a MultiGeometry is in the boundary or the interior of the Geometry. + The SFS uses the "Mod-2 Rule", which this function implements. + An alternative (and possibly more intuitive) rule would be + the "At Most One Rule": + isInBoundary = (componentCount == 1) + + + + + The lineEdgeMap is a map of the linestring components of the + parentGeometry to the edges which are derived from them. + This is used to efficiently perform findEdge queries + + + + + If this flag is true, the Boundary Determination Rule will used when deciding + whether nodes are in the boundary or not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + Adds a polygon ring to the graph. Empty rings are ignored. + The left and right topological location arguments assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged. + + + + + + + + + + + + + + + + + + + + Add an Edge computed externally. The label on the Edge is assumed + to be correct. + + + + + + Add a point computed externally. The point is assumed to be a + Point Geometry part, which has a location of INTERIOR. + + + + + + Compute self-nodes, taking advantage of the Geometry type to + minimize the number of intersection tests. (E.g. rings are + not tested for self-intersection, since they are assumed to be valid). + + The LineIntersector to use. + If false, intersection checks are optimized to not test rings for self-intersection. + The SegmentIntersector used, containing information about the intersections found. + + + + + + + + + + + + + + + + + + + + + Adds candidate boundary points using the current . + This is used to add the boundary + points of dim-1 geometries (Curves/MultiCurves). + + + + + + + + + + + + + Add a node for a self-intersection. + If the node is a potential boundary node (e.g. came from an edge which + is a boundary) then insert it as a potential boundary node. + Otherwise, just add it as a regular node. + + + + + + + + Determines the of the given in this geometry. + + The point to test + + The location of the point in the geometry + + + + + + + + + + + + + + + + + + + + Gets the used with this geometry graph. + + + + + + + + + + An EdgeSetIntersector computes all the intersections between the + edges in the set. It adds the computed intersections to each edge + they are found on. It may be used in two scenarios: + determining the internal intersections between a single set of edges + determining the mutual intersections between two different sets of edges + It uses a SegmentIntersector to compute the intersections between + segments and to record statistics about what kinds of intersections were found. + + + + + Computes all self-intersections between edges in a set of edges, + allowing client to choose whether self-intersections are computed. + + A list of edges to test for intersections. + The SegmentIntersector to use. + true if self-intersections are to be tested as well. + + + + Computes all mutual intersections between two sets of edges. + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + They have the following properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + + Specifically, a sequence of contiguous line segments + is a monotone chain iff all the vectors defined by the oriented segments + lies in the same quadrant. + + Monotone Chains have the following useful properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + Note that due to the efficient intersection test, there is no need to limit the size + of chains to obtain fast performance. + + + + + + + + + + + + + + + + + + + + The index of the last point in the monotone chain. + + + + + + Computes the intersection of line segments, + and adds the intersection to the edges containing the segments. + + + + + + + + + + + + + Testing only. + + + + + + + + + + + + + + + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning + and end segments. + + + + + + + + + This method is called by clients of the EdgeIntersector class to test for and add + intersections for two segments of the edges being intersected. + Note that clients (such as MonotoneChainEdges) may choose not to intersect + certain pairs of segments for efficiency reasons. + + + + + + + + + + + + + + + + + + + + + + + + + The proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire Geometry, since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the Geometry. + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this SegmentIntersector. + + + + + Finds all intersections in one or two sets of edges, + using the straightforward method of + comparing all segments. + This algorithm is too slow for production use, but is useful for testing purposes. + + + + + + + + + + + + + + + + + + + + + Performs a brute-force comparison of every segment in each Edge. + This has n^2 performance, and is about 100 times slower than using + monotone chains. + + + + + + + + Finds all intersections in one or two sets of edges, + using an x-axis sweepline algorithm in conjunction with Monotone Chains. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + The use of MonotoneChains as the items in the index + seems to offer an improvement in performance over a sweep-line alone. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + Finds all intersections in one or two sets of edges, + using a simple x-axis sweepline algorithm. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because DELETE events have a link to their corresponding INSERT event, + it is possible to compute exactly the range of events which must be + compared to a given INSERT event object. + + + + + + + + + + + + + + + + + + + + + + + + + Creates an INSERT event. + + The edge set label for this object. + The event location + the object being inserted + + + + Creates a DELETE event. + + The event location + The corresponding INSERT event + + + + Events are ordered first by their x-value, and then by their eventType. + Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Label indicates the topological relationship of a component + of a topology graph to a given Geometry. + This class supports labels for relationships to two Geometrys, + which is sufficient for algorithms for binary operations. + Topology graphs support the concept of labeling nodes and edges in the graph. + The label of a node or edge specifies its topological relationship to one or + more geometries. (In fact, since NTS operations have only two arguments labels + are required for only two geometries). A label for a node or edge has one or + two elements, depending on whether the node or edge occurs in one or both of the + input Geometrys. Elements contain attributes which categorize the + topological location of the node or edge relative to the parent + Geometry; that is, whether the node or edge is in the interior, + boundary or exterior of the Geometry. Attributes have a value + from the set {Interior, Boundary, Exterior}. In a node each + element has a single attribute On. For an edge each element has a + triplet of attributes Left, On, Right. + It is up to the client code to associate the 0 and 1 TopologyLocations + with specific geometries. + + + + + Converts a Label to a Line label (that is, one with no side Location). + + Label to convert. + Label as Line label. + + + + Construct a Label with a single location for both Geometries. + Initialize the locations to Null. + + + + + + Construct a Label with a single location for both Geometries. + Initialize the location for the Geometry index. + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for both Geometries to the given values. + + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for the given Geometry index. + + + + + + + + + Construct a Label with the same values as the argument Label. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge this label with another one. + Merging updates any null attributes of this label with the attributes from lbl. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts one GeometryLocation to a Line location. + + + + + + + + + + + + + + + + + + + + + + Only non-null if this node is precise. + + + + + + + + + + + + + + + + + Basic nodes do not compute IMs. + + + + + + Add the edge to the list of edges at this node. + + + + + + + + + + + + To merge labels for two nodes, + the merged location for each LabelElement is computed. + The location for the corresponding node LabelElement is set to the result, + as long as the location is non-null. + + + + + + + + + + + + + Updates the label of a node to BOUNDARY, + obeying the mod-2 boundaryDetermination rule. + + + + + + The location for a given eltIndex for a node will be one + of { Null, Interior, Boundary }. + A node may be on both the boundary and the interior of a point; + in this case, the rule is that the node is considered to be in the boundary. + The merged location is the maximum of the two input values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The basic node constructor does not allow for incident edges. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + + + + + + + This method expects that a node has a coordinate value. + + + + + + + + + + + + + Adds a node for the start point of this EdgeEnd + (if one does not already exist in this map). + Adds the EdgeEnd to the (possibly new) node. + + + + + + The node if found; null otherwise. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An indicator that a Location is on a GraphComponent (0) + + + + + An indicator that a Location is to the left of a GraphComponent (1) + + + + + An indicator that a Location is to the right of a GraphComponent (2) + + + + + An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) + /// + + + + A Position indicates the position of a Location relative to a graph component + (Node, Edge, or Area). + + + + + Returns Positions.Left if the position is Positions.Right, + Positions.Right if the position is Left, or the position + otherwise. + + + + + + Utility functions for working with quadrants, which are numbered as follows: + + 1 | 0 + --+-- + 2 | 3 + + + + + + North-East + + + + + North-West + + + + + South-West + + + + + South-East + + + + + Only static methods! + + + + + Returns the quadrant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + If the displacements are both 0 + + + + Returns the quadrant of a directed line segment from p0 to p1. + + + + if the points are equal + + + + Returns true if the quadrants are 1 and 3, or 2 and 4. + + + + + + + Returns the right-hand quadrant of the halfplane defined by the two quadrants, + or -1 if the quadrants are opposite, or the quadrant if they are identical. + + + + + + + Returns whether the given quadrant lies within the given halfplane (specified + by its right-hand quadrant). + + + + + + + Returns true if the given quadrant is 0 or 1. + + + + + + A TopologyLocation is the labelling of a + GraphComponent's topological relationship to a single Geometry. + + + If the parent component is an area edge, each side and the edge itself + have a topological location. These locations are named: + + Onon the edge + Leftleft-hand side of the edge + Rightright-hand side + + + If the parent component is a line edge or node, there is a single + topological relationship attribute, On. + + The possible values of a topological location are + { , , , } + + The labelling is stored in an array _location[j] where + where j has the values On, Left, Right. + + + + + + + + + + + + Constructs a TopologyLocation specifying how points on, to the left of, and to the + right of some GraphComponent relate to some Geometry. Possible values for the + parameters are Location.Null, Location.Exterior, Location.Boundary, + and Location.Interior. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge updates only the Null attributes of this object + with the attributes of another. + + + + + + + + + + + Get calls Get(Positions posIndex), + Set calls SetLocation(Positions locIndex, Location locValue) + + + + + + + true if all locations are Null. + + + + + true if any locations are Null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An BinTree (or "Binary Interval Tree") + is a 1-dimensional version of a quadtree. + It indexes 1-dimensional intervals (which may + be the projection of 2-D objects on an axis). + It supports range searching + (where the range may be a single point). + + + + This structure is dynamic - + new items can be added at any time, + and it will support deletion of items + (although this is not currently implemented). + + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + This index is different to the Interval Tree of Edelsbrunner + or the Segment Tree of Bentley. + + + + + Ensure that the Interval for the inserted item has non-zero extents. + Use the current minExtent to pad it, if necessary. + + + + + + + + + + + + + + + + + Removes a single item from the tree. + + itemEnv the Envelope of the item to be removed + the item to remove + true if the item was found (and thus removed) + + + + + + + + + + + + + + + + + Queries the tree to find all candidate items which + may overlap the query interval. + If the query interval is null, all items in the tree are found. + min and max may be the same value. + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + + + + + + + + + + + + + + + + + Compute the total number of nodes in the tree. + + The number of nodes in the tree. + + + + A Key is a unique identifier for a node in a tree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node of a Bintree. + + + + + The base class for nodes in a Bintree. + + + + + Returns the index of the subnode that wholely contains the given interval. + If none does, returns -1. + + + + + + + + + + + + Subnodes are numbered as follows: + 0 | 1 + . + + + + + + + + + + + + + + + + + + + + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + Removes a single item from this subtree. + + The envelope containing the item + The item to remove + true if the item was found and removed + + + + + + + + + Gets whether this node is prunable + + + + + Gets whether this node has any children + + + + + + + + + + Gets whether this node has any subnodes + + + + + + + + + + + + + + + Creates a node + + The interval of the node item + A new node + + + + Creates a larger node, that contains both and + If is null, a node for is created. + + The original node + The additional interval + A new node + + + + Creates a new node instance + + The node's interval + The node's level + + + + + + + + + + + Returns the subnode containing the envelope. + Creates the node if + it does not already exist. + + + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subnode for the index. + If it doesn't exist, create it. + + + + + + + + + + + + Gets the node's + + + + + The root node of a single Bintree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the tree this is the root of. + + + + + + + Insert an item which is known to be contained in the tree rooted at + the given Node. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + The root node matches all searches. + + + + + + MonotoneChains are a way of partitioning the segments of a linestring to + allow for fast searching of intersections. + + + + They have the following properties: + + the segments within a monotone chain never intersect each other + the envelope of any contiguous subset of the segments in a monotone chain + is equal to the envelope of the endpoints of the subset. + + + + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows an efficient + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + One of the goals of this implementation of MonotoneChains is to be + as space and time efficient as possible. One design choice that aids this + is that a MonotoneChain is based on a subarray of a list of points. + This means that new arrays of points (potentially very large) do not + have to be allocated. + + MonotoneChains support the following kinds of queries: + + Envelope selectdetermine all the segments in the chain which + intersect a given envelope. + Overlapdetermine all the pairs of segments in two chains whose + envelopes overlap. + + + + This implementation of MonotoneChains uses the concept of internal iterators + ( and ) + to return the resultsets for the above queries. + This has time and space advantages, since it + is not necessary to build lists of instantiated objects to represent the segments + returned by the query. + Queries made in this manner are thread-safe. + + + + + + + + + + + + + + + Gets the line segment starting at + + The index of the segment + The line segment to extract to + + + + Determine all the line segments in the chain whose envelopes overlap + the searchEnvelope, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the select action on chain segments + which it can determine are not in the search envelope. + However, it *may* call the select action on segments + which do not intersect the search envelope. + This saves on the overhead of checking envelope intersection + each time, since clients may be able to do this more efficiently. + + The search envelope + The select action to execute on selected segments + + + + + + + + + + + + + Determine all the line segments in two chains which may overlap, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the overlap action on chain segments + which it can determine do not overlap. + However, it *may* call the overlap action on segments + which do not actually interact. + This saves on the overhead of checking intersection + each time, since clients may be able to do this more efficiently. + + The monotone chain + The overlap action to execute on selected segments + + + + + + + + + + + + + + + Gets or sets the Id + + + + + Gets the chain's context + + + + + Gets the chain's envelope + + + + + Gets the start index + + + + + Gets the end index of the underlying linestring + + + + + Return the subsequence of coordinates forming this chain. + Allocates a new array to hold the Coordinates. + + + + + Constructs s + for sequences of s. + + + + + Only static methods! + + + + + + + + + + + + + + + + + + + Return a list of the MonotoneChains + for the given list of coordinates. + + + + + + + Return an array containing lists of start/end indexes of the monotone chains + for the given list of coordinates. + The last entry in the array points to the end point of the point array, + for use as a sentinel. + + + + + + Finds the index of the last point in a monotone chain + starting at a given point. + Any repeated points (0-length segments) will be included + in the monotone chain returned. + + The coordinates + The start index + + The index of the last point in the monotone chain starting at start. + + + + + The action for the internal iterator for performing + overlap queries on a MonotoneChain. + + + + + This envelope is used during the MonotoneChain search process. + + + + + This envelope is used during the MonotoneChain search process. + + + + + + + + + + + + + + + This function can be overridden if the original chains are needed. + + + The index of the start of the overlapping segment from mc1. + + The index of the start of the overlapping segment from mc2. + + + + This is a convenience function which can be overridden to obtain the actual + line segments which overlap. + + + + + + + A visitor for nodes and items in an index. + + + + + + + + + + + A static index on a set of 1-dimensional intervals, + using an R-Tree packed based on the order of the interval midpoints. + + + It supports range searching, + where the range is an interval of the real line (which may be a single point). + A common use is to index 1-dimensional intervals which + are the projection of 2-D objects onto an axis of the coordinate system. + + This index structure is static + - items cannot be added or removed once the first query has been made. + The advantage of this characteristic is that the index performance + can be optimized based on a fixed set of items. + + Martin Davis + + + + + Adds an item to the index which is associated with the given interval + + The lower bound of the item interval + The upper bound of the item interval + The item to insert + if the index has already been queried + + + + Search for intervals in the index which intersect the given closed interval + and apply the visitor to them. + + The lower bound of the query interval + The upper bound of the query interval + The visitor to pass any matched items to + + + + The basic insertion and query operations supported by classes + implementing spatial index algorithms. + A spatial index typically provides a primary filter for range rectangle queries. A + secondary filter is required to test for exact intersection. Of course, this + secondary filter may consist of other tests besides intersection, such as + testing other kinds of spatial relationships. + + + + + Adds a spatial item with an extent specified by the given Envelope to the index. + + + + + Queries the index for all items whose extents intersect the given search Envelope + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A list of the items found by the query. + + + + Queries the index for all items whose extents intersect the given search , + and applies an to them. + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A visitor object to apply to the items found. + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + A node of a , which represents one or more points in the same location. + + The type of the object + dskea + + + + Creates a new KdNode. + + coordinate of point + coordinate of point + A data objects to associate with this node + + + + Creates a new KdNode. + + The point location of new node + A data objects to associate with this node + + + + Gets x-ordinate of this node + + + + + Gets y-ordinate of this node + + + + + Gets the location of this node + + + + + Gets the user data object associated with this node. + + + + + Gets or sets the left node of the tree + + + + + Gets or sets the right node of the tree + + + + + Gets the number of inserted points that are coincident at this location. + + + + + Gets whether more than one point with this value have been inserted (up to the tolerance) + + + + + + An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. + + + This implementation supports detecting and snapping points which are closer + than a given distance tolerance. + If the same point (up to tolerance) is inserted + more than once , it is snapped to the existing node. + In other words, if a point is inserted which lies within the tolerance of a node already in the index, + it is snapped to that node. + When a point is snapped to a node then a new node is not created but the count of the existing node + is incremented. + If more than one node in the tree is within tolerance of an inserted point, + the closest and then lowest node is snapped to. + + The type of the user data object + David Skea + Martin Davis + + + + Converts a collection of s to an array of s. + + A collection of nodes + An array of the coordinates represented by the nodes + + + + Converts a collection of {@link KdNode}s + to an array of s, + specifying whether repeated nodes should be represented + by multiple coordinates. + + a collection of nodes + true if repeated nodes should + be included multiple times + An array of the coordinates represented by the nodes + + + + Creates a new instance of a KdTree with a snapping tolerance of 0.0. + (I.e. distinct points will not be snapped) + + + + + Creates a new instance of a KdTree with a snapping distance + tolerance. Points which lie closer than the tolerance to a point already + in the tree will be treated as identical to the existing point. + + The tolerance distance for considering two points equal + + + + Inserts a new point in the kd-tree, with no data. + + The point to insert + The kdnode containing the point + + + + Inserts a new point into the kd-tree. + + The point to insert + A data item for the point + + A new KdNode if a new point is inserted, else an existing + node is returned with its counter incremented. This can be checked + by testing returnedNode.getCount() > 1. + + + + + Finds the node in the tree which is the best match for a point + being inserted. + The match is made deterministic by returning the lowest of any nodes which + lie the same distance from the point. + There may be no match if the point is not within the distance tolerance of any + existing node. + + The point being inserted + + + the best matching node + null if no match was found + + + + + + Inserts a point known to be beyond the distance tolerance of any existing node. + The point is inserted at the bottom of the exact splitting path, + so that tree shape is deterministic. + + The point to insert + + + The data for the point + The created node + + + + + + Performs a range search of the points in the index. + + The range rectangle to query + + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection of the KdNodes found + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection to accumulate the result nodes into + + + + Performs a nearest neighbor search of the points in the index. + + The point to search the nearset neighbor for + + + + Tests whether the index contains any items. + + + + + DoubleBits manipulates Double numbers + by using bit manipulation and bit-field extraction. + For some operations (such as determining the exponent) + this is more accurate than using mathematical operations + (which suffer from round-off error). + The algorithms and constants in this class + apply only to IEEE-754 double-precision floating point format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This computes the number of common most-significant bits in the mantissa. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + The number of common most-significant mantissa bits. + + + + A representation of the Double bits formatted for easy readability. + + + + + + + + + + Determines the exponent for the number. + + + + + Determines the exponent for the number. + + + + + Provides a test for whether an interval is + so small it should be considered as zero for the purposes of + inserting it into a binary tree. + The reason this check is necessary is that round-off error can + cause the algorithm used to subdivide an interval to fail, by + computing a midpoint value which does not lie strictly between the + endpoints. + + + + + This value is chosen to be a few powers of 2 less than the + number of bits available in the double representation (i.e. 53). + This should allow enough extra precision for simple computations to be correct, + at least for comparison purposes. + + + + + Only static methods! + + + + + Computes whether the interval [min, max] is effectively zero width. + I.e. the width of the interval is so much less than the + location of the interval that the midpoint of the interval cannot be + represented precisely. + + + + + A Key is a unique identifier for a node in a quadtree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a node of a Quadtree. Nodes contain + items which have a spatial extent corresponding to the node's position + in the quadtree. + + + + + The base class for nodes in a Quadtree. + + + + + Gets the index of the subquad that wholly contains the given envelope. + If none does, returns -1. + + The index of the subquad that wholly contains the given envelope
+ or -1 if no subquad wholly contains the envelope
+
+ + + + + + + + subquads are numbered as follows: + 2 | 3 + --+-- + 0 | 1 + + + + + + + + + + + Removes a single item from this subtree. + + The envelope containing the item. + The item to remove. + true if the item was found and removed. + + + + Insert items in this into the parameter! + + IList for adding items. + Parameter IList with this items. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the subquad containing the envelope . + Creates the subquad if + it does not already exist. + + The envelope to search for + The subquad containing the search envelope. + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subquad for the index. + If it doesn't exist, create it. + + + + + + + + + + + + + + + + + + A Quadtree is a spatial index structure for efficient range querying + of items bounded by 2D rectangles.
+ s can be indexed by using their s.
+ Any type of object can also be indexed, as long as it has an extent that can be + represented by an . + + This Quadtree index provides a primary filter + for range rectangle queries. The various query methods return a list of + all items which may intersect the query rectangle. Note that + it may thus return items which do not in fact intersect the query rectangle. + A secondary filter is required to test for actual intersection + between the query rectangle and the envelope of each candidate item. + The secondary filter may be performed explicitly, + or it may be provided implicitly by subsequent operations executed on the items + (for instance, if the index query is followed by computing a spatial predicate + between the query geometry and tree items, + the envelope intersection check is performed automatically. + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + + This data structure is also known as an MX-CIF quadtree + following the terminology usage of Samet and others. +
+
+ + + Ensure that the envelope for the inserted item has non-zero extents. + Use the current minExtent to pad the envelope, if necessary. + + + + + + + minExtent is the minimum envelope extent of all items + inserted into the tree so far. It is used as a heuristic value + to construct non-zero envelopes for features with zero X and/or Y extent. + Start with a non-zero extent, in case the first feature inserted has + a zero extent in both directions. This value may be non-optimal, but + only one feature will be inserted with this value. + + + + + Constructs a Quadtree with zero items. + + + + + + + + + + + + Removes a single item from the tree. + + The Envelope of the item to be removed. + The item to remove. + true if the item was found (and thus removed). + + + + Queries the tree and returns items which may lie in the given search envelope. + + + Precisely, the items that are returned are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be returned as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not returned - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A List of items which may intersect the search envelope + + + + Queries the tree and visits items which may lie in the given search envelope. + + + Precisely, the items that are visited are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be visited as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not visited - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A visitor object which is passed the visited items + + + + Return a list of all items in the Quadtree. + + + + + + + + + + + Returns the number of levels in the tree. + + + + + Tests whether the index contains any items. + + + + + Returns the number of items in the tree. + + + + + QuadRoot is the root of a single Quadtree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the quadtree this is the root of. + + + + + Insert an item which is known to be contained in the tree rooted at + the given QuadNode root. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + + + + + A node of an . A node is one of: + + empty + an interior node containing child s + a leaf node containing data items (s). + + A node stores the bounds of its children, and its level within the index tree. + + + + + Constructs an AbstractNode at the given level in the tree + + + 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Returns a representation of space that encloses this Boundable, + preferably not much bigger than this Boundable's boundary yet fast to + test for intersection with the bounds of other Boundables. The class of + object returned depends on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other + object (for other subclasses of AbstractSTRtree). + + + + + Adds either an AbstractNode, or if this is a leaf node, a data object + (wrapped in an ItemBoundable). + + + + + + Returns either child s, or if this is a leaf node, real data (wrapped + in s). + + + + + Gets the bounds of this node + + + + + Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Gets the count of the s at this node. + + + + + Tests whether there are any s at this node. + + + + + Base class for STRtree and SIRtree. STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + This implementation is based on s rather than just s, + because the STR algorithm operates on both nodes and + data, both of which are treated as s. + + + + + Set to null when index is built, to avoid retaining memory. + + + + Constructs an AbstractSTRtree with the specified maximum number of child + nodes that a node may have. + + + + + + Creates parent nodes, grandparent nodes, and so forth up to the root + node, for the data that has been inserted into the tree. Can only be + called once, and thus can be called only after all of the data has been + inserted into the tree. + + + + + + + + + + + + Sorts the childBoundables then divides them into groups of size M, where + M is the node capacity. + + + + + + + Creates the levels higher than the given level. + + The level to build on. + the level of the Boundables, or -1 if the boundables are item + boundables (that is, below level 0). + The root, which may be a ParentNode or a LeafNode. + + + + Also builds the tree, if necessary. + + + + + + Gets a tree structure (as a nested list) + corresponding to the structure of the items and nodes in this tree. + The returned Lists contain either Object items, + or Lists which correspond to subtrees of the tree + Subtrees which do not contain any items are not included. + Builds the tree if necessary. + + a List of items and/or Lists + + + + Removes an item from the tree. + (Builds the tree, if necessary.) + + + + + Returns the maximum number of child nodes that a node may have. + + + + + Tests whether the index contains any items. + This method does not build the index, + so items can still be inserted after it has been called. + + + + + Gets the number of elements in the tree + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + For STRtrees, the bounds will be Envelopes; + for SIRtrees, Intervals; + for other subclasses of AbstractSTRtree, some other class. + + The bounds of one spatial object. + The bounds of another spatial object. + Whether the two bounds intersect. + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Boundable wrapper for a non-Boundable spatial object. Used internally by + AbstractSTRtree. + + + + + + + + + + + + The bounds + + + + + The item + + + + + One-dimensional version of an STR-packed R-tree. SIR stands for + "Sort-Interval-Recursive". STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an SIRtree with the default (10) node capacity. + + + + + Constructs an SIRtree with the given maximum number of child nodes that + a node may have. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + + Returns items whose bounds intersect the given value. + + + + + + Returns items whose bounds intersect the given bounds. + + Possibly equal to x2. + Possibly equal to x1. + + + + + + + + + + + + + + + + + + + + + + + + + + + A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. + For two-dimensional spatial data. + The STR packed R-tree is simple to implement and maximizes space + utilization; that is, as many leaves as possible are filled to capacity. + Overlap between nodes is far less than in a basic R-tree. However, once the + tree has been built (explicitly or on the first call to #query), items may + not be added or removed. + Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an STRtree with the default (10) node capacity. + + + + + Constructs an STRtree with the given maximum number of child nodes that + a node may have. + + The minimum recommended capacity setting is 4. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates the parent level for the given child level. First, orders the items + by the x-values of the midpoints, and groups them into vertical slices. + For each slice, orders the items by the y-values of the midpoints, and + group them into runs of size M (the node capacity). For each run, creates + a new (parent) node. + + + + + + + + + + + + + + + + + + + + + + + + + Must be sorted by the x-value of the envelope midpoints. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + + + + + + + Finds the two nearest items in the tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + A distance metric applicable to the items in this tree + The pair of the nearest items + + + + Finds the item in this tree which is nearest to the given , + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + The query does not have to be + contained in the tree, but it does + have to be compatible with the + distance metric. + + The envelope of the query item + The item to find the nearest neighbour of + A distance metric applicable to the items in this tree and the query item + The nearest item in this tree + + + + Finds the two nearest items from this tree + and another tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + The result value is a pair of items, + the first from this tree and the second + from the argument tree. + + Another tree + A distance metric applicable to the items in the trees + The pair of the nearest items, one from each tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ProjectionEvents are ordered first by their x-value, and then by their eventType. + It is important that Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sweepline implements a sorted index on a set of intervals. + It is used to compute all overlaps between the interval in the index. + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a sequence of s in WKT format from a text file. + + The geometries in the file may be separated by any amount of whitespace and newlines. + + Martin Davis + + + + + Creates a new given the to read from and a to use to parse the geometries. + + the to read from + the geometry reader to use + + + + Creates a new , given the name of the file to read from. + + The name of the file to read from + The geometry reader to use + + + + Creates a new , given a to read with. + + The stream reader of the file to read from + The geometry reader to use + + + + Reads a sequence of geometries. + + + + If an offset is specified, geometries read up to the offset count are skipped. + If a limit is specified, no more than geometries are read. + + The list of geometries read + + + + Tests if reader is at EOF. + + + + + Gets/Sets the maximum number of geometries to read. + + + + + Gets/Sets the number of geometries to skip before reading. + + + + + Finds if two sets of s intersect. + + + Uses indexing for fast performance and to optimize repeated tests + against a target set of lines. + Short-circuited to return as soon an intersection is found. + + Immutable and thread-safe. + + + + + Creates an intersection finder against a given set of segment strings. + + The segment strings to search for intersections + + + + Tests for intersections with a given set of target {@link SegmentString}s. + + The SegmentStrings to test + true if an intersection was found + + + + Tests for intersections with a given set of target s. + using a given SegmentIntersectionDetector. + + The SegmentStrings to test + The intersection detector to use + true if the detector reports intersections + + + Gets the segment set intersector used by this class. + This allows other uses of the same underlying indexed structure. + + + + Intersects two sets of s using a index based + on s and a . + + Thread-safe and immutable. + + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of indexed segments. + + + + + + + Gets the index constructed over the base segment strings + + NOTE: To retain thread-safety, treat returned value as immutable + + + + Segment overlap action class + + + + + Creates an instance of this class using the provided + + The segment intersector to use + + + + Detects and records an intersection between two s, + if one exists. Only a single intersection is recorded. + + + This strategy can be configured to search for proper intersections. + In this case, the presence of any intersection will still be recorded, + but searching will continue until either a proper intersection has been found + or no intersections are detected. + + + + + Creates an intersection finder using a + + + + + Creates an intersection finder using a given + + The LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected. + + + Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). + + + + + Gets or sets whether processing must continue until a proper intersection is found + + + + + Gets or sets whether processing can terminate once any intersection is found. + + + + + Tests whether an intersection was found. + + + + + Tests whether a proper intersection was found. + + + + + Tests whether a non-proper intersection was found. + + + + + Gets the computed location of the intersection. Due to round-off, the location may not be exact. + + + + Gets the endpoints of the intersecting segments. + + An array of the segment endpoints (p00, p01, p10, p11) + + + + Tests whether processing can terminate, + because all required information has been obtained + (e.g. an intersection of the desired type has been detected). + + + + + Utility methods for processing s + + Martin Davis + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Converts a collection of s into a . + The geometry will be either a + or a (possibly empty). + + A collection of . + A geometry factory + A or a . + + + + Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. + These kinds of geometries are useful as a more complex geometry for testing algorithms. + + + Martin Davis + + + + + Computes various kinds of common geometric shapes. + Allows various ways of specifying the location and extent of the shapes, + as well as number of line segments used to form them. + + + + + Create a shape factory which will create shapes using the default GeometryFactory. + + + + + Create a shape factory which will create shapes using the given GeometryFactory. + + The factory to use. + + + + Creates a rectangular Polygon. + + A rectangular polygon. + + + + Creates a circular Polygon. + + A circular polygon. + + + + Creates an elliptical Polygon. + If the supplied envelope is square the + result will be a circle. + + An an ellipse or circle. + + + + Creates a squircular . + + a squircle + + + + Creates a supercircular + of a given positive power. + + a supercircle + + + + Creates a elliptical arc, as a LineString. + + The arc is always created in a counter-clockwise direction. + + Start angle in radians + Size of angle in radians + + + + + Creates an elliptical arc polygon. + + + The polygon is formed from the specified arc of an ellipse + and the two radii connecting the endpoints to the centre of the ellipse. + + Start angle in radians + Size of angle in radians + An elliptical arc polygon + + + + Gets/Sets the location of the shape by specifying the base coordinate + (which in most cases is the + lower left point of the envelope containing the shape). + + + + + Gets/Sets the location of the shape by specifying the centre of + the shape's bounding box. + + + + + Gets or sets the envelope of the shape + + + + + Gets/Sets the total number of points in the created Geometry. + + + + + Gets/Sets the size of the extent of the shape in both x and y directions. + + + + + Gets/Sets the width of the shape. + + + + + Gets/Sets the height of the shape. + + + + + Gets/Sets the rotation angle, in radians, to use for the shape. + The rotation is applied relative to the centre of the shape. + + + + + Creates a factory which will create sine stars using the default + + + + + Creates a factory which will create sine stars using the given + + The factory to use + + + + Generates the geometry for the sine star + + The geometry representing the sine star + + + Gets/Sets the number of arms in the star + + + + Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. + + Value should be between 0.0 and 1.0 + + + + Extends the class to allow reading values in the BigEndian format. + + + While extends + adding methods for reading integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for reading values in the BigEndian format. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + encoding is null. + The stream does not support reading, the stream is null, or the stream is already closed. + + + + Reads a 2-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by two bytes. + + + A 2-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 2-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by two bytes. + + + A 2-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by four bytes. + + + A 4-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by eight bytes. + + + An 8-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a string from the current stream. + The string is prefixed with the length, encoded as an integer seven bits at a time. + + The string being read. + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a decimal value from the current stream + and advances the current position of the stream by sixteen bytes. + + + A decimal value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Extends the class to allow writing values in the BigEndian format. + + + While extends + adding methods for writing integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for writing values in the BigEndian format. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The supplied stream. + output is null. + + The stream does not support writing, or the stream is already closed. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + output or encoding is null. + + The stream does not support writing, or the stream is already closed. + + + + Writes a two-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a two-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes a length-prefixed string to this stream in the current encoding + of the , + and advances the current position of the stream in accordance + with the encoding used and the specific characters being written to the stream. + + The value to write. + The stream is closed. + An I/O error occurs. + value is null. + + + + Writes a decimal value to the current stream and advances the stream position by sixteen bytes. + + The decimal value to write. + The stream is closed. + An I/O error occurs. + + + + Reads a GML document and creates a representation of the features based on NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + + + + Initialize reader with a standard . + + + + + Initialize reader with the given . + + + + + Read a GML document and returns relative . + + + + + + + Reads the coordinate. + + The reader. + + + + + Extract a from a x,y string value. + + + + + + + Extract a from a pos entity string value. + + + + + + + Extract a from a x,y string value. + + + + + builder. + + + + + Writes the GML representation of the features of NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + Thanks to rstuven for improvements :) + + + + + + Returns an XmlReader with feature informations. + Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. + + + + + + + Writes a GML feature into a generic Stream, such a FileStream or other streams. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formatter for double values of coordinates + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Converts a Well-Known Binary byte data to a Geometry. + + + The reader repairs structurally-invalid input + (specifically, LineStrings and LinearRings which contain + too few points have vertices added, + and non-closed rings are closed). + s + + + + Converts a hexadecimal string to a byte array. + The hexadecimal digit symbols are case-insensitive. + + A string containing hex digits + An array of bytes with the value of the hex string + + + true if structurally invalid input should be reported rather than repaired. + At some point this could be made client-controllable. + + + + Initialize reader with a standard . + + + + + Initialize reader with the given GeometryFactory. + + + + + + Reads a in binary WKB format from an array of s. + + The byte array to read from + The geometry read + if the WKB data is ill-formed. + + + + Reads a in binary WKB format from an . + + The stream to read from + The geometry read + if the WKB data is ill-formed. + + + + + + + + + + + + + + + + + Function to read a coordinate sequence. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to form a ring. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to serve a line string. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to convert from to + + The coordinate system + The corresponding + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Function to determine whether an ordinate should be handled or not. + + + + + + + The builder. + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + WKB Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + Point with Z coordinate. + + + + + LineString with Z coordinate. + + + + + Polygon with Z coordinate. + + + + + MultiPoint with Z coordinate. + + + + + MultiLineString with Z coordinate. + + + + + MultiPolygon with Z coordinate. + + + + + GeometryCollection with Z coordinate. + + + + + Point with M ordinate value. + + + + + LineString with M ordinate value. + + + + + Polygon with M ordinate value. + + + + + MultiPoint with M ordinate value. + + + + + MultiLineString with M ordinate value. + + + + + MultiPolygon with M ordinate value. + + + + + GeometryCollection with M ordinate value. + + + + + Point with Z coordinate and M ordinate value. + + + + + LineString with Z coordinate and M ordinate value. + + + + + Polygon with Z coordinate and M ordinate value. + + + + + MultiPoint with Z coordinate and M ordinate value. + + + + + MultiLineString with Z coordinate and M ordinate value. + + + + + MultiPolygon with Z coordinate and M ordinate value. + + + + + GeometryCollection with Z coordinate and M ordinate value. + + + + + Writes a Well-Known Binary byte data representation of a Geometry. + + + WKBWriter stores X,Y,Z values if is not , + otherwise value is discarded and only X,Y are stored. + + + + Converts a byte array to a hexadecimal string. + A byte array + + + Converts a byte array to a hexadecimal string. + A byte array + + + + Initializes writer with LittleIndian byte order. + + + + + Initializes writer with the specified byte order. + + Encoding type + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + M values, present or not, should be emitted + + + + Writes a WKB representation of a given point. + + + + + + + Writes a WKB representation of a given point. + + + + + + + + + + + + + + + Writes LittleIndian ByteOrder. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets or sets whether the value should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Standard byte size for each complex point. + Each complex point (LineString, Polygon, ...) contains: + 1 byte for ByteOrder and + 4 bytes for WKBType. + 4 bytes for SRID value + + + + + Gets a value whether or not EWKB featues may be used. + EWKB features are + 0x80000000 flag if geometry's z-ordinate values are written + 0x40000000 flag if geometry's m-ordinate values are written + 0x20000000 flag if geometry's SRID value is written + + + + + Converts a Well-Known Text string to a Geometry. + + The WKTReader allows + extracting Geometry objects from either input streams or + internal strings. This allows it to function as a parser to read Geometry + objects from text blocks embedded in other data formats (e.g. XML). + + The Well-known + Text format is defined in the + OpenGIS Simple Features Specification for SQL . + + NOTE: There is an inconsistency in the SFS. + The WKT grammar states that MultiPoints are represented by + MULTIPOINT ( ( x y), (x y) ), + but the examples show MultiPoints as MULTIPOINT ( x y, x y ). + Other implementations follow the latter syntax, so NTS will adopt it as well. + A WKTReader is parameterized by a GeometryFactory, + to allow it to create Geometry objects of the appropriate + implementation. In particular, the GeometryFactory will + determine the PrecisionModel and SRID that is used. + The WKTReader will convert the input numbers to the precise + internal representation. + + reads also non-standard "LINEARRING" tags. + + + + + + Creates a WKTReader that creates objects using a basic GeometryFactory. + + + + + Creates a WKTReader that creates objects using the given + GeometryFactory. + + The factory used to create Geometrys. + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + A Reader which will return a "Geometry Tagged Text" + string (see the OpenGIS Simple Features Specification). + + A Geometry read from reader. + + + + + Returns the next array of Coordinates in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next element returned by the stream should be "(" (the + beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". + + + if set to true skip extra parenthesis around coordinates. + + + The next array of Coordinates in the + stream, or an empty array if "EMPTY" is the next element returned by + the stream. + + + + + + + + + + + + + + + + + + + + Returns the next number in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a number. + + The next number in the stream. + if the next token is not a valid number + + + + Returns the next "EMPTY" or "(" in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be "EMPTY" or "(". + + + The next "EMPTY" or "(" in the stream as uppercase text. + + + + Returns the next ")" or "," in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")" or ",". + + + The next ")" or "," in the stream. + + + + Returns the next ")" in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")". + + + The next ")" in the stream. + + + + Returns the next word in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a word. + + The next word in the stream as uppercase text. + + + + Creates a Geometry using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Geometry Tagged Text. + + A Geometry specified by the next token + in the stream. + + + + Creates a Point using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Point Text. + + + A Point specified by the next token in + the stream. + + + + Creates a LineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + + A LineString specified by the next + token in the stream. + + + + Creates a LinearRing using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + A LinearRing specified by the next + token in the stream. + + + + Creates a MultiPoint using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <MultiPoint Text. + + + + A MultiPoint specified by the next + token in the stream. + + + + Creates an array of Points having the given Coordinates. + + + The Coordinates with which to create the Points + + The factory to create the points + + Points created using this WKTReader + s GeometryFactory. + + + + + Creates a Polygon using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a Polygon Text. + + + + A Polygon specified by the next token + in the stream. + + + + + Creates a MultiLineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiLineString Text. + + + + A MultiLineString specified by the + next token in the stream. + + + + Creates a MultiPolygon using the next token in the stream. + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiPolygon Text. + + + + A MultiPolygon specified by the next + token in the stream, or if if the coordinates used to create the + Polygon shells and holes do not form closed linestrings. + + + + Creates a GeometryCollection using the next token in the + stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <GeometryCollection Text. + + + + A GeometryCollection specified by the + next token in the stream. + + + + Gets or sets the factory to create geometries + + + + + Gets or sets the default SRID + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Outputs the textual representation of a . + The outputs coordinates rounded to the precision + model. No more than the maximum number of necessary decimal places will be + output. + The Well-known Text format is defined in the OpenGIS Simple Features + Specification for SQL. + A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does + not define a special tag for LinearRings. The standard tag to use is + "LINESTRING". + + + + + Generates the WKT for a Point specified by a . + + The point coordinate. + The WKT + + + + Generates the WKT for a N-point LineString specified by a . + + The sequence to write. + The WKT + + + Generates the WKT for a LINESTRING + specified by a {@link CoordinateSequence}. + + @param seq the sequence to write + + @return the WKT string + + + + Generates the WKT for a LineString specified by two s. + + The first coordinate. + The second coordinate. + The WKT + + + + Creates the NumberFormatInfo used to write doubles + with a sufficient number of decimal places. + + + The PrecisionModel used to determine + the number of decimal places to write. + + + A NumberFormatInfo that write doubles + without scientific notation. + + + + + Returns a String of repeated characters. + + The character to repeat. + The number of times to repeat the character. + A string of characters. + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Stream to write into + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + + A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + + A Geometry Tagged Text string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process + + + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification). + + + + + Converts a Geometry to <Geometry Tagged Text format, + then appends it to the writer. + + /he Geometry to process. + + /he output writer to append to. + + + + Converts a Coordinate to Point Tagged Text format, + then appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a LineString to <LineString Tagged Text + format, then appends it to the writer. + + The LineString to process. + + The output writer to append to. + + + + Converts a LinearRing to <LinearRing Tagged Text + format, then appends it to the writer. + + The LinearRing to process. + + The output writer to append to. + + + + Converts a Polygon to Polygon Tagged Text format, + then appends it to the writer. + + The Polygon to process. + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Tagged Text + format, then appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to MultiLineString Tagged + Text format, then appends it to the writer. + + The MultiLineString to process. + + The output writer to append to. + + + + Converts a MultiPolygon to MultiPolygon Tagged Text + format, then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollection + Tagged Text format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + Converts a Coordinate to Point Text format, then + appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + Appends the i'th coordinate from the sequence to the writer + the to process + the index of the coordinate to write + writer the output writer to append to + + + + + Converts a Coordinate to Point format, then appends + it to the writer. + + The Coordinate to process. + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a to a . + + The to convert. + + The as a . + + + + Converts a to <LineString Text> format, then appends it to the writer + + + + + Converts a LineString to <LineString Text format, then + appends it to the writer. + + The LineString to process. + + + The output writer to append to. + + + + Converts a Polygon to Polygon Text format, then + appends it to the writer. + + The Polygon to process. + + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Text format, then + appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to <MultiLineString Text + format, then appends it to the writer. + + The MultiLineString to process. + + + The output writer to append to. + + + + Converts a MultiPolygon to <MultiPolygon Text format, + then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollectionText + format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + + + + + + + + + + + + + + + + + Gets/sets whther the output woll be formatted + + + + + Gets/sets the maximum number of coordinates per line written in formatted output. + + If the provided coordinate number is < 0, coordinates will be written all on one line. + + + Gets/sets the tab size to use for indenting. + If the size is non-positive + + + + Extracts the subline of a linear between + two s on the line. + + + + + Computes the subline of a between + two s on the line. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The line to use as the baseline. + The start location. + The end location. + The extracted subline. + + + + Initializes a new instance of the class. + + + + + + Extracts a subline of the input. + If is minor that , + the linear geometry computed will be reversed. + + The start location. + The end location. + A linear geometry. + + + + + + + + + + + Assumes input is valid + (e.g. minor or equals to ). + + + + + + + + Supports linear referencing along a linear + using the length along the line as the index. + Negative length values are taken as measured in the reverse direction + from the end of the geometry. + Out-of-range index values are handled by clamping + them to the valid range of values. + Non-simple lines (i.e. which loop back to cross or touch + themselves) are supported. + + + + + Constructs an object which allows a linear + to be linearly referenced using length as an index. + + The linear geometry to reference along. + + + + Computes the for the point + on the line at the given index. + If the index is out of range the first or last point on the + line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the lies before the , + the computed geometry is reversed. + + + + + + + + + + + + + + + Computes the minimum index for a point on the line. + If the line is not simple (i.e. loops back on itself) + a single point may have more than one possible index. + In this case, the smallest index is returned. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The minimum index of the point. + + + + + Finds the index for a point on the line + which is greater than the given index. + If no such index exists, returns . + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The value the returned index must be greater than. + The index of the point greater than the given minimum index. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline.. + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + + + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line + by clamping the given index to the valid range of index values + + A valid index value + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Finds the nearest index along the linear + to a given after the specified minimum index. + If possible the location returned will be strictly + greater than the . + If this is not possible, the value returned + will equal . + (An example where this is not possible is when + = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + + + + + + + + + + + + + + + + + + Computes the for a given length + along a linear + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + + + + + Computes the for a + given length along a linear . + + The linear geometry to use. + The length index of the location. + The for the length. + + + + Computes the for a + given length along a linear , + with control over how the location + is resolved at component endpoints. + + The linear geometry to use + The length index of the location + If true lengths are resolved to the lowest possible index + + + + Computes the length for a given + on a linear . + + The linear geometry to use. + The index of the location. + The length for the . + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest possible location value. + + The length index. + The corresponding . + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest or highest possible location value, + depending on the value of resolveLower + + The length index + + The corresponding . + + + + + + + + + + + + + + + + + + Builds a linear geometry ( or ) + incrementally (point-by-point). + + + + + Creates an instance of this class. + + The geometry factory to use. + + + + Adds a point to the current line. + + The to add. + + + + Adds a point to the current line. + + The to add. + If true, allows the insertions of repeated points. + + + + Terminate the current . + + + + + + + + + + + + Builds and returns the . + + + + + + Allows invalid lines to be fixed rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + Allows invalid lines to be ignored rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + + + + + + An iterator over the components and coordinates of a linear geometry + (s and s. + + + + + + + + + + + + Invariant: currentLine <> null if the iterator is pointing at a valid coordinate + + + + + Creates an iterator initialized to the start of a linear . + + The linear geometry to iterate over. + if is not + + + + Creates an iterator starting at a on a linear . + + The linear geometry to iterate over. + The location to start at. + if is not + + + + Creates an iterator starting at + a component and vertex in a linear . + + The linear geometry to iterate over. + The component to start at. + The vertex to start at. + if is not + + + + + + + + + Tests whether there are any vertices left to iterator over. + Specifically, HasNext() returns true if the + current state of the iterator represents a valid location + on the linear geometry. + + true if there are more vertices to scan. + + + + Jump to the next element of the iteration. + + + + + Checks whether the iterator cursor is pointing to the + endpoint of a component . + + + + + The component index of the vertex the iterator is currently at. + + + + + The vertex index of the vertex the iterator is currently at. + + + + + Gets the component the iterator is current at. + + + + + Gets the first of the current segment + (the coordinate of the current vertex). + + + + + Gets the second of the current segment + (the coordinate of the next vertex). + If the iterator is at the end of a line, null is returned. + + + + + Represents a location along a or .
+ The referenced geometry is not maintained within this location, + but must be provided for operations which require it. + Various methods are provided to manipulate the location value + and query the geometry it references. +
+
+ + + Gets a location which refers to the end of a linear . + + The linear geometry. + A new LinearLocation. + + + + Computes the of a point a given fraction + along the line segment (p0, p1). + + + + If the fraction is greater than 1.0 the last + point of the segment is returned. + If the fraction is less than or equal to 0.0 the first point + of the segment is returned. + + The Z ordinate is interpolated from the Z-ordinates of the given points, + if they are specified. + + The first point of the line segment. + The last point of the line segment. + The length to the desired point. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + If true, ensures the individual values are locally valid. + + + + Creates a new location equal to a given one. + + A linear location + + + + Ensures the individual values are locally valid. + Does not ensure that the indexes are valid for + a particular linear geometry. + + + + + Ensures the indexes are valid for a given linear . + + A linear geometry. + + + + Snaps the value of this location to + the nearest vertex on the given linear , + if the vertex is closer than . + + A linear geometry. + The minimum allowable distance to a vertex. + + + + Gets the length of the segment in the given + Geometry containing this location. + + A linear geometry. + The length of the segment. + + + + Sets the value of this location to + refer to the end of a linear geometry. + + The linear geometry to use to set the end. + + + + Gets the along the + given linear which is + referenced by this location. + + A linear geometry. + The at the location. + + + + Gets a representing the segment of the given linear which contains this location. + + A linear geometry + the LineSegment containing the location + + + + Tests whether this location refers to a valid + location on the given linear . + + A linear geometry. + true if this location is valid. + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + is not the same type as this instance. + + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + + + Compares this object with the specified index values for order. + + The component index. + The segment index. + The segment fraction. + + A negative integer, zero, or a positive integer as this LineStringLocation + is less than, equal to, or greater than the specified locationValues. + + + + + Compares two sets of location values for order. + + The first component index. + The first segment index. + The first segment fraction. + The second component index. + The second segment index. + The second segment fraction. + + A negative integer, zero, or a positive integer + as the first set of location values is less than, equal to, + or greater than the second set of locationValues. + + + + + Tests whether two locations are on the same segment in the parent . + + A location on the same geometry + true if the locations are on the same segment of the parent geometry + + + + Tests whether this location is an endpoint of + the linear component it refers to. + + The linear geometry referenced by this location + True if the location is a component endpoint + + + + Converts a linear location to the lowest equivalent location index. + The lowest index has the lowest possible component and segment indices. + Specifically: + * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) + * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned + If the location index is already the lowest possible value, the original location is returned. + + The linear geometry referenced by this location. + The lowest equivalent location. + + + + Copies this location. + + A copy of this location. + + + + Gets the component index for this location. + + + + + Gets the segment index for this location. + + + + + Gets the segment fraction for this location. + + + + + Tests whether this location refers to a vertex: + returns true if the location is a vertex. + + + + + Supports linear referencing along a linear + using s as the index. + + + + + Constructs an object which allows linear referencing along + a given linear . + + The linear geometry to reference alo + + + + Computes the for the point on the line at the given index. + If the is out of range, + the first or last point on the line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point + on the line at the given index, offset by the given distance. + If the index is out of range the first or last point on the + line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment + (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The index of the start of the interval. + The index of the end of the interval. + The linear interval between the indices. + + + + Computes the index for a given point on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The index of the point. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline. + + + + Finds the index for a point on the line which is greater than the given index. + If no such index exists, returns . + + + + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + + + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + + A point on the line + The value the returned index must be greater than + The index of the point greater than the given minimum index + + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + A point on the line. + The index of the point. + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line by clamping + the given index to the valid range of index values. + + + A valid index value. + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + Determines the location of a subline along a linear . + The location is reported as a pair of s. + NOTE: Currently this algorithm is not guaranteed to + return the correct substring in some situations where + an endpoint of the test line occurs more than once in the input line. + (However, the common case of a ring is always handled correctly). + + + + + + + + + + + + + Initializes a new instance of the class. + + The linear geom. + + + + + + + + + + + Computes the of the point + on a linear nearest a given . + The nearest point is not necessarily unique; this class + always computes the nearest point closest + to the start of the geometry. + + + + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Find the nearest along the linear + to a given after the specified minimum . + If possible the location returned will be strictly greater than the . + If this is not possible, the value returned will equal . + (An example where this is not possible is when = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + Represents a list of contiguous line segments, + and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + An interface for classes which represent a sequence of contiguous line segments. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + + + + + Gets/Sets the user-defined data for this segment string. + + + + + Points that make up ISegmentString + + + + + Size of Coordinate Sequence + + + + + States whether ISegmentString is closed + + + + + Creates a new segment string from a list of vertices. + + the vertices of the segment string + the user-defined data of this segment string (may be null) + + + + Gets the octant of the segment starting at vertex index + + the index of the vertex starting the segment. Must not be the last index in the vertex list + octant of the segment at the vertex + + + Gets the user-defined data for this segment string. + + + + + Validates that a collection of s is correctly noded. + Indexing is used to improve performance. + + + + In the most common use case, validation stops after a single + non-noded intersection is detected, + but the class can be requested to detect all intersections + by using the property. + + The validator does not check for a-b-a topology collapse situations. + + The validator does not check for endpoint-interior vertex intersections. + This should not be a problem, since the JTS noders should be + able to compute intersections between vertices correctly. + + + The client may either test the condition, + or request that a suitable be thrown. + + + + + + Creates a new noding validator for a given set of linework. + + A collection of s + + + + Returns an error message indicating the segments containing the intersection. + + an error message documenting the intersection location + + + + Checks for an intersection and throws + a TopologyException if one is found. + + if an intersection is found + + + + Gets or sets whether all intersections should be found. + + + + + Gets a list of all intersections found. + + Intersections are represented as s. + List is empty if none were found. + + + + + + Checks for an intersection and reports if one is found. + + + + + An interface for classes which support adding nodes to a segment string. + + + + Adds an intersection node for a given point and segment to this segment string. + + the location of the intersection + the index of the segment containing the intersection + + + + + + + + Creates an intersection finder which tests if there is at least one interior intersection. + Uses short-circuiting for efficient performance. + The intersection found is recorded. + + A line intersector. + A intersection finder which tests if there is at least one interior intersection. + + + + Creates an intersection finder which finds all interior intersections. + The intersections are recorded for later inspection. + + A line intersector. + a intersection finder which finds all interior intersections. + + + + Creates an intersection finder which counts all interior intersections. + The intersections are note recorded to reduce memory usage. + + A line intersector. + a intersection finder which counts all interior intersections. + + + + Creates an intersection finder which finds an interior intersection if one exists + + the LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + Tests whether a segment in a is an end segment. + (either the first or last). + + a segment string + the index of a segment in the segment string + true if the segment is an end segment + + + + Gets/Sets whether all intersections should be computed. + + When this is false (the default value), the value of + is true after the first intersection is found. + Default is false. + + + + + + Gets/Sets whether intersection points are recorded. + + If the only need is to count intersection points, this can be set to false. + Default is true. + + + + + + Gets/Sets whether only end segments should be tested for interior intersection. + This is a performance optimization that may be used if + the segments have been previously noded by an appropriate algorithm. + It may be known that any potential noding failures will occur only in + end segments. + + + + + Tests whether an intersection was found. + + + + + Gets the intersections found. + + A list of . + + + + Gets the count of intersections found. + + The intersection count. + + + + Gets the computed location of the intersection. + Due to round-off, the location may not be exact. + + + + + Gets the endpoints of the intersecting segments. + + + + + Computes the possible intersections between two line segments in s + and adds them to each string + using . + + + + + + + + + + + + These variables keep track of what types of intersections were + found during ALL edges that have been intersected. + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning and end segments. + + + + + + + + + + This method is called by clients + of the class to process + intersections for two segments of the being intersected.
+ Note that some clients (such as MonotoneChain") may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Returns the proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire , since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the . + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this . + + + + + An interior intersection is an intersection which is + in the interior of some segment. + + + + + Always process all intersections + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + This class is obsolete. + Use instead. + + + + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Nodes a set of s completely. + The set of s is fully noded; + i.e. noding is repeated until no further intersections are detected. + + Iterated noding using a precision model is not guaranteed to converge, + due to roundoff error. This problem is detected and an exception is thrown. + Clients can choose to rerun the noding using a lower precision model. + + + + + + Computes all intersections between segments in a set of s. + Intersections found are represented as s and added to the + s in which they occur. + As a final step in the noding a new set of segment strings split at the nodes may be returned. + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Fully nodes a list of s, i.e. peforms noding iteratively + until no intersections are found between segments. + Maintains labelling of edges correctly through the noding. + + A collection of SegmentStrings to be noded. + If the iterated noding fails to converge. + + + + Node the input segment strings once + and create the split edges between the nodes. + + + + + + + Gets/Sets the maximum number of noding iterations performed before + the noding is aborted. Experience suggests that this should rarely need to be changed + from the default. The default is . + + + + + Nodes a set of s using a index based + on s and a . + The used should be something that supports + envelope (range) queries efficiently (such as a Quadtree" + or . + + + + + Base class for s which make a single pass to find intersections. + This allows using a custom + (which for instance may simply identify intersections, rather than insert them). + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Gets/sets the to use with this noder. + A will normally add intersection nodes + to the input segment strings, but it may not - it may + simply record the presence of intersections. + However, some s may require that intersections be added. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The + + + + + + + + + + + + + Validates that a collection of s is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Creates a new validator for the given collection + of s. + + The seg strings. + + + + Checks whether the supplied segment strings + are correctly noded. Throws an exception if they are not. + + + + + Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). + + + + + Checks all pairs of segments for intersections at an interior point of a segment. + + + + + Checks for intersections between an endpoint of a segment string + and an interior vertex of another segment string + + + + + Octants in the Cartesian plane. + Octants are numbered as follows: + + \2|1/ + 3 \|/ 0 + ---+-- + 4 /|\ 7 + /5|6\ + + If line segments lie along a coordinate axis, the octant is the lower of the two possible values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Methods for computing and working with of the Cartesian plane. + + + + + Returns the octant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + + + + + Returns the octant of a directed line segment from p0 to p1. + + + + + + + + Allows comparing arrays in an orientation-independent way. + + + + + Creates a new } + for the given array. + + + + + + Computes the canonical orientation for a coordinate array. + + + + true if the points are oriented forwards
+ or falseif the points are oriented in reverse. +
+
+ + + Compares two s for their relative order. + + + + -1 this one is smaller;
+ 0 the two objects are equal;
+ 1 this one is greater. +
+
+ + + + + + + + + + + + + Wraps a and transforms its input into the integer domain. + This is intended for use with Snap-Rounding noders, + which typically are only intended to work in the integer domain. + Offsets can be provided to increase the number of digits of available precision. + + Clients should be aware that rescaling can involve loss of precision, + which can cause zero-length line segments to be created. + These in turn can cause problems when used to build a planar graph. + This situation should be checked for and collapsed segments removed if necessary. + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an intersection point between two s. + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + -1 this SegmentNode is located before the argument location;
+ 0 this SegmentNode is at the argument location;
+ 1 this SegmentNode is located after the argument location. +
+
+ + + + + + + + + Gets the giving the location of this node. + + + + + + + + + + + A list of the s present along a noded . + + + + + Initializes a new instance of the class. + + The edge. + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + The SegmentIntersection found or added. + + + + Returns an iterator of SegmentNodes. + + An iterator of SegmentNodes. + + + + Adds nodes for the first and last points of the edge. + + + + + Adds nodes for any collapsed edge pairs. + Collapsed edge pairs can be caused by inserted nodes, or they can be + pre-existing in the edge vertex list. + In order to provide the correct fully noded semantics, + the vertex at the base of a collapsed pair must also be added as a node. + + + + + Adds nodes for any collapsed edge pairs + which are pre-existing in the vertex list. + + + + + + Adds nodes for any collapsed edge pairs caused by inserted nodes + Collapsed edge pairs occur when the same coordinate is inserted as a node + both before and after an existing edge vertex. + To provide the correct fully noded semantics, + the vertex must be added as a node as well. + + + + + + + + + + + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the provided argument list + (this is so a single list can be used to accumulate all split edges + for a set of s). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + Gets the list of coordinates for the fully noded segment string, + including all original segment string vertices and vertices + introduced by nodes in this list. + Repeated coordinates are collapsed. + + An array of s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not implemented. + + This method is not implemented. + + + + + + + + + + + + + + + + + + + + Implements a robust method of comparing the relative position of two points along the same segment. + The coordinates are assumed to lie "near" the segment. + This means that this algorithm will only return correct results + if the input coordinates have the same precision and correspond to rounded values + of exact coordinates lying on the segment. + + + + + Compares two s for their relative position along a segment + lying in the specified . + + + + + + -1 if node0 occurs first, or
+ 0 if the two nodes are equal, or
+ 1 if node1 occurs first. +
+
+ + + + + + + + + + + + + + + + + + + Represents a list of contiguous line segments, and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + s can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + Gets the s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A collection of NodedSegmentStrings representing the substrings + + + + Adds the noded s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A list which will collect the NodedSegmentStrings representing the substrings + + + + Creates a new segment string from a list of vertices. + + The vertices of the segment string. + The user-defined data of this segment string (may be null). + + + + + + + + + + + Gets the octant of the segment starting at vertex index. + + + The index of the vertex starting the segment. + Must not be the last index in the vertex list + + The octant of the segment at the vertex + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an for intersection intIndex. + An intersection that falls exactly on a vertex + of the is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + + + + + + + + Gets/Sets the user-defined data for this segment string. + + + + + + + + + + + + + + + + + + + + + + + + + + Dissolves a noded collection of s to produce + a set of merged linework with unique segments. + + + A custom merging strategy + can be supplied. + This strategy will be called when two identical (up to orientation) + strings are dissolved together. + The default merging strategy is simply to discard one of the merged strings. + + A common use for this class is to merge noded edges + while preserving topological labelling. + This requires a custom merging strategy to be supplied + to merge the topology labels appropriately. + + + + + + Creates a dissolver with a user-defined merge strategy. + + + + + + Creates a dissolver with the default merging strategy. + + + + + Dissolve all s in the input . + + + + + + + + + + + + + Dissolve the given . + + + + + + + + + Gets the collection of dissolved (i.e. unique) s + + + + + A merging strategy which can be used to update the context data of s + which are merged during the dissolve process. + + mbdavis + + + + Updates the context data of a + when an identical (up to orientation) one is found during dissolving. + + The segment string to update. + The segment string being dissolved. + + true if the strings are in the same direction, + false if they are opposite. + + + + + Nodes a set of s by + performing a brute-force comparison of every segment to every other one. + This has n^2 performance, so is too slow for use on large numbers of segments. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Nodes the linework in a list of s using Snap-Rounding + to a given . + + The input coordinates are expected to be rounded + to the given precision model. + This class does not perform that function. + GeometryPrecisionReducer" may be used to do this. + + This class does not dissolve the output linework, + so there may be duplicate linestrings in the output. + Subsequent processing (e.g. polygonization) may require + the linework to be unique. Using UnaryUnion is one way + to do this (although this is an inefficient approach). + + + + + Creates a new noder which snap-rounds to a grid specified by the given + + The precision model for the grid to snap-round to. + + + + Nodes the linework of a set of Geometrys using SnapRounding. + + A collection of Geometrys of any type + A list of LineStrings representing the noded linework of the input + + + + Gets or sets whether noding validity is checked after noding is performed. + + + + + Implements a "hot pixel" as used in the Snap Rounding algorithm. + A hot pixel contains the interior of the tolerance square and the boundary + minus the top and right segments. + The hot pixel operations are all computed in the integer domain + to avoid rounding problems. + + + + + Initializes a new instance of the class. + + The coordinate at the center of the hot pixel + The scale factor determining the pixel size + THe intersector to use for testing intersection with line segments + + + + Returns a "safe" envelope that is guaranteed to contain the hot pixel. + The envelope returned will be larger than the exact envelope of the pixel. + + An envelope which contains the pixel + + + + + + + + + + + + + + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + The first coordinate of the line segment to test + The second coordinate of the line segment to test + true if the line segment intersects this hot pixel. + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + + + + + + + + + + + + + + Tests whether the segment p0-p1 intersects the hot pixel tolerance square. + Because the tolerance square point set is partially open (along the + top and right) the test needs to be more sophisticated than + simply checking for any intersection. + However, it can take advantage of the fact that the hot pixel edges + do not lie on the coordinate grid. + It is sufficient to check if any of the following occur: + - a proper intersection between the segment and any hot pixel edge. + - an intersection between the segment and BOTH the left and bottom hot pixel edges + (which detects the case where the segment intersects the bottom left hot pixel corner). + - an intersection between a segment endpoint and the hot pixel coordinate. + + + + + + + + Test whether the given segment intersects + the closure of this hot pixel. + This is NOT the test used in the standard snap-rounding + algorithm, which uses the partially closed tolerance square instead. + This routine is provided for testing purposes only. + + + + + + + + Adds a new node (equal to the snap pt) to the specified segment + if the segment passes through the hot pixel + + + + true if a node was added to the segment + + + + Gets the coordinate this hot pixel is based at. + + + + + "Snaps" all s in a containing + s to a given . + + + + + Initializes a new instance of the class. + + + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + The edge containing the vertex, if applicable, or null. + + true if a node was added for this pixel. + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + true if a node was added for this pixel. + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + Uses Snap Rounding to compute a rounded, + fully noded arrangement from a set of s. + Implements the Snap Rounding technique described in + papers by Hobby, Guibas and Marimont, and Goodrich et al. + Snap Rounding assumes that all vertices lie on a uniform grid; + hence the precision model of the input must be fixed precision, + and all the input vertices must be rounded to that precision. + + This implementation uses a monotone chains and a spatial index to + speed up the intersection tests. + This implementation appears to be fully robust using an integer precision model. + It will function with non-integer precision models, but the + results are not 100% guaranteed to be correctly noded. + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + + Does NOT node the segStrings. + + + + A list of Coordinates for the intersections. + + + + Snaps segments to nodes created by segment intersections. + + + + + + Snaps segments to all vertices + + The list of segment strings to snap together + + + + Snaps segments to the vertices of a Segment String. + + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + A Collection of NodedSegmentStrings representing the substrings + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + A collection of NodedSegmentStrings + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + Does NOT node the segStrings. + + + + A list of s for the intersections. + + + + Computes nodes introduced as a result of snapping segments to snap points (hot pixels). + + + + + + + + + + + + + + Computes nodes introduced as a result of + snapping segments to vertices of other segments. + + The list of segment strings to snap together + + + + Performs a brute-force comparison of every segment in each . + This has n^2 performance. + + + + + + + Computes the boundary of a . + Allows specifying the to be used. + This operation will always return a of the appropriate + dimension for the boundary (even if the input geometry is empty). + The boundary of zero-dimensional geometries (Points) is + always the empty . + + Martin Davis + + + + A map which maintains the edges in sorted order around the node. + + + + + Stores an integer count, for use as a Map entry. + + Martin Davis + + + + Builds the buffer geometry for a given input geometry and precision model. + Allows setting the level of approximation for circular arcs, + and the precision model in which to carry out the computation. + + + When computing buffers in floating point double-precision + it can happen that the process of iterated noding can fail to converge (terminate). + In this case a will be thrown. + Retrying the computation in a fixed precision + can produce more robust results. + + + + Compute the change in depth as an edge is crossed from R to L + + + Creates a new BufferBuilder + + + + Inserted edges are checked to see if an identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + + + + Completes the building of the input subgraphs by depth-labelling them, + and adds them to the PolygonBuilder. + + + The subgraph list must be sorted in rightmost-coordinate order. + + the subgraphs to build + the PolygonBuilder which will build the final polygons + + + + Gets the standard result for an empty buffer. + Since buffer always returns a polygonal result, this is chosen to be an empty polygon. + + The empty result geometry + + + + Sets the precision model to use during the curve computation and noding, + if it is different to the precision model of the Geometry. + + + If the precision model is less than the precision of the Geometry precision model, + the Geometry must have previously been rounded to that precision. + + + + + Sets the to use during noding. + This allows choosing fast but non-robust noding, or slower + but robust noding. + + + + + Simplifies a buffer input line to remove concavities with shallow depth. + + + + The most important benefit of doing this + is to reduce the number of points and the complexity of + shape which will be buffered. + It also reduces the risk of gores created by + the quantized fillet arcs (although this issue + should be eliminated in any case by the + offset curve generation logic). + + + A key aspect of the simplification is that it + affects inside (concave or inward) corners only. + Convex (outward) corners are preserved, since they + are required to ensure that the generated buffer curve + lies at the correct distance from the input geometry. + + + Another important heuristic used is that the end segments + of the input are never simplified. This ensures that + the client buffer code is able to generate end caps faithfully. + + + No attempt is made to avoid self-intersections in the output. + This is acceptable for use for generating a buffer offset curve, + since the buffer algorithm is insensitive to invalid polygonal + geometry. However, + this means that this algorithm + cannot be used as a general-purpose polygon simplification technique. + + + Martin Davis + + + + Simplify the input coordinate list. + If the distance tolerance is positive, + concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, + concavities on the RIGHT side of the line are simplified. + + The coordinate list to simplify + simplification distance tolerance to use + The simplified coordinate list + + + + Simplify the input coordinate list. + + + If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. + + Simplification distance tolerance to use + + The simplified coordinates list + + + + + Uses a sliding window containing 3 vertices to detect shallow angles + in which the middle vertex can be deleted, since it does not + affect the shape of the resulting buffer in a significant way. + + + + + + Finds the next non-deleted index, or the end of the point array if none + + The start index to search from + The next non-deleted index, if any
+ or _inputLine.Length if there are no more non-deleted indices +
+
+ + + Checks for shallowness over a sample of points in the given section. + This helps to prevent the siplification from incrementally + "skipping" over points which are in fact non-shallow. + + A coordinate of section + A coordinate of section + The start index of section + The end index of section + The tolerated distance + + + + Computes the buffer of a geometry, for both positive and negative buffer distances. + + + + In GIS, the positive (or negative) buffer of a geometry is defined as + the Minkowski sum (or difference) of the geometry + with a circle of radius equal to the absolute value of the buffer distance. + In the CAD/CAM world buffers are known as offset curves. + In morphological analysis the + operation of positive and negative buffering + is referred to as erosion and dilation + + + The buffer operation always returns a polygonal result. + The negative or zero-distance buffer of lines and points is always an empty . + + + Since true buffer curves may contain circular arcs, + computed buffer polygons are only approximations to the true geometry. + The user can control the accuracy of the approximation by specifying + the number of linear segments used to approximate arcs. + This is specified via + or . + + + The of a linear buffer may be specified. + The following end cap styles are supported: +
    +
  • - the usual round end caps
  • +
  • - end caps are truncated flat at the line ends
  • +
  • - end caps are squared off at the buffer distance beyond the line ends
  • +
+
+ + The of the corners in a buffer may be specified. + The following join styles are supported: +
    +
  • - the usual round join
  • +
  • - corners are "sharp" (up to a distance limit})
  • +
  • - corners are beveled (clipped off)
  • +
+
+ + The buffer algorithm can perform simplification on the input to increase performance. + The simplification is performed a way that always increases the buffer area + (so that the simplified input covers the original input). + The degree of simplification can be specified with , + with a used otherwise. + Note that if the buffer distance is zero then so is the computed simplify tolerance, + no matter what the simplify factor. + +
+
+ + + A number of digits of precision which leaves some computational "headroom" + for floating point operations. + + + This value should be less than the decimal precision of double-precision values (16). + + + + + Compute a scale factor to limit the precision of + a given combination of Geometry and buffer distance. + The scale factor is determined by + the number of digits of precision in the (geometry + buffer distance), + limited by the supplied value. + + The scale factor is based on the absolute magnitude of the (geometry + buffer distance). + since this determines the number of digits of precision which must be handled. + + the Geometry being buffered + the buffer distance + the max # of digits that should be allowed by + the precision determined by the computed scale factor + + a scale factor for the buffer computation + + + + Computes the buffer of a geometry for a given buffer distance. + + the geometry to buffer + the buffer distance + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the buffer parameters to use + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the end cap style to use + the buffer of the input geometry + + + + Initializes a buffer computation for the given geometry + + the geometry to buffer + + + + Initializes a buffer computation for the given geometry + with the given set of parameters + + the geometry to buffer + the buffer parameters to use + + + + Returns the buffer computed for a geometry for a given buffer distance. + + the buffer distance + the buffer of the input geometry + + + + Specifies the end cap style of the generated buffer. + The styles supported are , , and . + The default is . + + + + + Sets the number of segments used to approximate a angle fillet + + + + + A value class containing the parameters which + specify how a buffer should be constructed. + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + Martin Davis + + + + The default number of facets into which to divide a fillet of 90 degrees. + A value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + + + + + The default mitre limit + Allows fairly pointy mitres. + + + + + The default simplify factor. + Provides an accuracy of about 1%, which matches + the accuracy of the parameter. + + + + + Creates a default set of parameters + + + + + Creates a set of parameters with the given quadrantSegments value. + + The number of quadrant segments to use + + + + Creates a set of parameters with the + given quadrantSegments and endCapStyle values. + + the number of quadrant segments to use + the end cap style to use + + + + Creates a set of parameters with the + given parameter values. + + the number of quadrant segments to use + the end cap style to use + the join style to use + the mitre limit to use + + + + Computes the maximum distance error due to a given level of approximation to a true arc. + + The number of segments used to approximate a quarter-circle + The error of approximation + + + + Gets/sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. + QuadrantSegments = 0joins are beveled + QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| + + For round joins, QuadrantSegments determines the maximum + error in the approximation to the true buffer curve. + The default value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + The error is always less than the buffer distance + (in other words, the computed buffer curve is always inside the true + curve). + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , + , and + . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), + and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + A connected subset of the graph of + DirectedEdges and Nodes. + Its edges will generate either + a single polygon in the complete buffer, with zero or more holes, or + one or more connected holes. + + + + + + + + + + Creates the subgraph consisting of all edges reachable from this node. + Finds the edges in the graph and the rightmost coordinate. + + A node to start the graph traversal from. + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + A node known to be in the subgraph. + + + + Adds the argument node and all its out edges to the subgraph + + The node to add. + The current set of nodes being traversed. + + + + + + + + + + + + + + + Compute depths for all dirEdges via breadth-first traversal of nodes in graph. + + Edge to start processing with. + + + + + + + + + + + + + + + + Find all edges whose depths indicates that they are in the result area(s). + Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + BufferSubgraphs are compared on the x-value of their rightmost Coordinate. + This defines a partial ordering on the graphs such that: + g1 >= g2 - Ring(g2) does not contain Ring(g1) + where Polygon(g) is the buffer polygon that is built from g. + This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to + be built before holes. + + + + + + + + + + + + + + + Gets the rightmost coordinate in the edges of the subgraph. + + + + + Computes the raw offset curve for a + single component (ring, line or point). + A raw offset curve line is not noded - + it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded + to a given . + + + + + This method handles single points as well as LineStrings. + LineStrings are assumed not to be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + The vertices of the line to offset + The offset distance + A Coordinate array representing the curve
+ or null if the curve is empty +
+
+ + + This method handles the degenerate cases of single points and lines, + as well as rings. + + A Coordinate array representing the curve
+ or null if the curve is empty
+
+ + + Computes the distance tolerance to use during input + line simplification. + + The buffer distance + The simplification tolerance + + + + Gets the buffer parameters being used to generate the curve. + + + + + Generates segments which form an offset curve. + Supports all end cap and join options + provided for buffering. + This algorithm implements various heuristics to + produce smoother, simpler curves which are + still within a reasonable tolerance of the + true curve. + + Martin Davis + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + The Closing Segment Length Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + Add last offset point + + + + + Adds the offset points for an outside (convex) turn + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point , terminating a line segment coming from + + + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments + around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. + Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc + between two specified angles. + The start and end point for the fillet are not added - + the caller must add them if required. + + Is -1 for a angle, 1 for a angle + The radius of the fillet + + + + Creates a circle around a point + + + + + Creates a square around a point + + + + + Gets whether the input has a narrow concave angle + (relative to the offset distance). + In this case the generated offset curve will contain self-intersections + and heuristic closing segments. + This is expected behaviour in the case of buffer curves. + For pure offset curves, + the output needs to be further treated + before it can be used. + + + + + A dynamic list of the vertices in a constructed offset curve. + Automatically removes adjacent vertices + which are closer than a given tolerance. + + Martin Davis + + + The distance below which two adjacent points on the curve + are considered to be coincident. + This is chosen to be a small fraction of the offset distance. + + + + Tests whether the given point is redundant + relative to the previous + point in the list (up to tolerance). + + + true if the point is redundant + + + + Computes the raw offset curve for a single component (ring, line or point). + + + A raw offset curve line is not noded - it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded to the required precision model. + + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + Use a value which results in a potential distance error which is + significantly less than the error due to + the quadrant segment discretization. + For QS = 8 a value of 100 is reasonable. + This should produce a maximum of 1% distance error. + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The Closing Segment Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + + This method handles single points as well as lines. + Lines are assumed to not be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + a List of Coordinate[] + + + + This method handles the degenerate cases of single points and lines, as well as rings. + + a List of Coordinate[] + + + Computes the distance tolerance to use during input + line simplification. + + @param distance the buffer distance + @return the simplification tolerance + + + + Adds the offset points for an outside (convex) turn + + + + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Add last offset point + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment () the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point p1, terminating a line segment coming from p0 + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + The base point + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + + + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc between two specified angles. + + + The start and end point for the fillet are not added - the caller must add them if required. + + The point around which to add the fillet points + The start angle (in radians) + The end angle (in radians) + Is -1 for a CW angle, 1 for a CCW angle + The radius of the fillet + + + + Adds a CW circle around a point + + + + + Adds a CW square around a point + + + + + Creates all the raw offset curves for a buffer of a Geometry. + Raw curves need to be noded together and polygonized to form the final buffer area. + + + + + + + + + + + + + Computes the set of raw offset curves for the buffer. + Each offset curve has an attached {Label} indicating + its left and right location. + + A Collection of SegmentStrings representing the raw buffer curves. + + + + Creates a {SegmentString} for a coordinate list which is a raw offset curve, + and adds it to the list of buffer curves. + The SegmentString is tagged with a Label giving the topology of the curve. + The curve may be oriented in either direction. + If the curve is oriented CW, the locations will be: + Left: Location.Exterior. + Right: Location.Interior. + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + + + + + + + + + + + + + Adds an offset curve for a polygon ring. + The side and left and right topological location arguments + assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged and the side flipped. + + The coordinates of the ring (must not contain repeated points). + The distance at which to create the buffer. + The side of the ring on which to construct the buffer line. + The location on the L side of the ring (if it is CW). + The location on the R side of the ring (if it is CW). + + + + The ringCoord is assumed to contain no repeated points. + It may be degenerate (i.e. contain only 1, 2, or 3 points). + In this case it has no area, and hence has a minimum diameter of 0. + + + + + + + + Tests whether a triangular ring would be eroded completely by the given + buffer distance. + This is a precise test. It uses the fact that the inner buffer of a + triangle converges on the inCentre of the triangle (the point + equidistant from all sides). If the buffer distance is greater than the + distance of the inCentre from a side, the triangle will be eroded completely. + This test is important, since it removes a problematic case where + the buffer distance is slightly larger than the inCentre distance. + In this case the triangle buffer curve "inverts" with incorrect topology, + producing an incorrect hole in the buffer. + + + + + + + + A list of the vertices in a constructed offset curve. + + Automatically removes close adjacent vertices. + Martin Davis + + + + Function to add a point + + + The point is only added if evaluates to false. + + The point to add. + + + + Tests whether the given point duplicates the previous point in the list (up to tolerance) + + The point to test + true if the point duplicates the previous point + + + + Automatically closes the ring (if it not alread is). + + + + + Gets/Sets the precision model to use when adding new points. + + + + + The distance below which two adjacent points on the curve are considered to be coincident. + + This is chosen to be a small fraction of the offset distance. + + + + Gets the Coordinates for the curve. + + + + + A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, + and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Locates a subgraph inside a set of subgraphs, + in order to determine the outside depth of the subgraph. + The input subgraphs are assumed to have had depths + already calculated for their edges. + + + + + + + + + + + + + + + + + + Finds all non-horizontal segments intersecting the stabbing line. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + A List of {DepthSegments} intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the list of dirEdges. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the input dirEdge. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + A segment from a directed edge which has been assigned a depth value + for its sides. + + + + + + + + + + + + Defines a comparison operation on DepthSegments + which orders them left to right. + Assumes the segments are normalized. + + The definition of ordering is: + + -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). + 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). + 0 : if the segments are identical + + + + Known Bugs: + + The logic does not obey the contract. + This is acceptable for the intended usage, but may cause problems if used with some + utilities in the .Net standard library (e.g. . + + + A DepthSegment + The comparison value + + + + Compare two collinear segments for left-most ordering. + If segs are vertical, use vertical ordering for comparison. + If segs are equal, return 0. + Segments are assumed to be directed so that the second coordinate is >= to the first + (e.g. up and to the right). + + A segment to compare. + A segment to compare. + + + + + + + + + + Finds the approximate maximum distance from a buffer curve to + the originating geometry. + + The approximate maximum distance is determined by testing + all vertices in the buffer curve, as well + as midpoints of the curve segments. + Due to the way buffer curves are constructed, this + should be a very close approximation. + This is similar to the Discrete Oriented Hausdorff distance + from the buffer curve to the input. + + mbdavis + + + + Validates that a given buffer curve lies an appropriate distance + from the input generating it. + + + Useful only for round buffers (cap and join). + Can be used for either positive or negative distances. + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + mbdavis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + + Checks that two geometries are at least a minumum distance apart. + + A geometry + A geometry + The minimum distance the geometries should be separated by + + + + Checks that the furthest distance from the buffer curve to the input + is less than the given maximum distance. + + + This uses the Oriented Hausdorff distance metric. It corresponds to finding + the point on the buffer curve which is furthest from some point on the input. + + A geometry + A geometry + The maximum distance that a buffer result can be from the input + + + + Gets a geometry which indicates the location and nature of a validation failure. + + The indicator is a line segment showing the location and size + of the distance discrepancy. + + + A geometric error indicator + or null, if no error was found + + + + Validates that the result of a buffer operation + is geometrically correct, within a computed tolerance. + + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + This test may be (much) more expensive than the original buffer computation. + + Martin Davis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + Checks whether the geometry buffer is valid, and returns an error message if not. + + + + + An appropriate error message
+ or nullif the buffer is valid
+ +
+ + + Gets the error message + + + + + Gets the error location + + + + + Gets a geometry which indicates the location and nature of a validation failure. + + If the failure is due to the buffer curve being too far or too close + to the input, the indicator is a line segment showing the location and size + of the discrepancy. + + + A geometric error indicator
+ or null, if no error was found
+
+ + + Computes the Euclidean distance (L2 metric) from a Point to a Geometry. + Also computes two points which are separated by the distance. + + + + + Contains a pair of points and the distance between them. + Provides methods to update with a new point pair with + either maximum or minimum distance. + + + + + Initializes the points, avoiding recomputing the distance. + + The first point + The second point + The distance between and + + + + A wrapper which + projects 3D coordinates into one of the + three Cartesian axis planes, + using the standard orthonormal projection + (i.e. simply selecting the appropriate ordinates into the XY ordinates). + The projected data is represented as 2D coordinates. + + Martin Davis + + + + Creates a wrapper projecting to the XY plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the XZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the YZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Find two points on two 3D s which lie within a given distance, + or else are the nearest points on the geometries (in which case this also + provides the distance between the geometries). + + 3D geometries have vertex Z ordinates defined. + 3D s are assumed to lie in a single plane (which is enforced if not actually the case). + 3D s and s may have any configuration. + + The distance computation also finds a pair of points in the input geometries + which have the minimum distance between them. If a point lies in the interior + of a line segment, the coordinate computed is a close approximation to the + exact point. + + The algorithms used are straightforward O(n^2) comparisons. This worst-case + performance could be improved on by using Voronoi techniques or spatial + indexes. + + 1.13 + + + + Compute the distance between the nearest points of two geometries. + + A geometry + A geometry + The distance between the geometries + + + + Test whether two geometries lie within a given distance of each other. + + A geometry + A geometry + The distance to test + true if g0.distance(g1) <= + + + + Compute the the nearest points of two geometries. The points are + presented in the same order as the input Geometries. + + A geometry + A geometry + The nearest points in the geometries + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + The distance on which to terminate the search + + + + Report the distance between the nearest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty
+ Thrown if either input geometry is null. +
+ + + Report the coordinates of the nearest points in the input geometries. The + points are presented in the same order as the input Geometries. + + A pair of s of the nearest points + + + + Gets the locations of the nearest points in the input geometries. The + locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points + + + + Finds the index of the "most polygonal" input geometry. + This optimizes the computation of the best-fit plane, + since it is cached only for the left-hand geometry. + + The index of the most polygonal geometry + + + + Convenience method to create a Plane3DPolygon + + + + + Computes distance between two polygons. + + + To compute the distance, compute the distance + between the rings of one polygon and the other polygon, + and vice-versa. + If the polygons intersect, then at least one ring must + intersect the other polygon. + Note that it is NOT sufficient to test only the shell rings. + A counter-example is a "figure-8" polygon A + and a simple polygon B at right angles to A, with the ring of B + passing through the holes of A. + The polygons intersect, + but A's shell does not intersect B, and B's shell does not intersect A. + + + Compute distance between a polygon and the rings of another. + + + Computes a point at a distance along a segment + specified by two relatively proportional values. + The fractional distance along the segment is d0/(d0+d1). + + @param p0 + start point of the segment + @param p1 + end point of the segment + @param d0 + proportional distance from start point to computed point + @param d1 + proportional distance from computed point to end point + @return the computed point + + + + Models a polygon lying in a plane in 3-dimensional Cartesian space. + The polygon representation is supplied + by a , + containing coordinates with XYZ ordinates. + 3D polygons are assumed to lie in a single plane. + The plane best fitting the polygon coordinates is + computed and is represented by a . + + Martin Davis + + + + Computes an average normal vector from a list of polygon coordinates. + Uses Newell's method, which is based + on the fact that the vector with components + equal to the areas of the projection of the polygon onto + the Cartesian axis planes is normal. + + @param seq the sequence of coordinates for the polygon + @return a normal vector + + + Computes a point which is the average of all coordinates + in a sequence. + If the sequence lies in a single plane, + the computed point also lies in the plane. + + @param seq a coordinate sequence + @return a Coordinate with averaged ordinates + + + + A ConnectedElementPointFilter extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list. The elements of the list are + com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + Returns a list containing a point from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. The elements of the list + are com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + + + + + + + + + + + + + Extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list + + + + + Returns a list containing a Coordinate from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. + + + + + + + + + + + + + + + + + Computes the distance and + closest points between two Geometrys. + The distance computation finds a pair of points in the input geometries + which have minimum distance between them. These points may + not be vertices of the geometries, but may lie in the interior of + a line segment. In this case the coordinate computed is a close + approximation to the exact point. + The algorithms used are straightforward O(n^2) + comparisons. This worst-case performance could be improved on + by using Voronoi techniques. + + + + + Compute the distance between the closest points of two geometries. + + A Geometry. + Another Geometry. + The distance between the geometries. + + + + Test whether two geometries lie within a given distance of each other. + + + + + + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + The distance on which to terminate the search. + + + + Report the distance between the closest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty.
+ if either input geometry is null +
+ + + Report the coordinates of the closest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the closest points. + + + + Report the locations of the closest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the closest points. + + + + Report the coordinates of the nearest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the nearest points. + + + + Report the locations of the nearest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points. + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes distance between facets (lines and points) of input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a sequence of facets (points or line segments) of a + specified by a subsequence of a . + + Martin Davis + + + + Creates a new section based on a CoordinateSequence. + + The sequence holding the points in the section + The index of the start point + The index of the end point + 1 + + + + Creates a new sequence for a single point from a CoordinateSequence. + + The sequence holding the points in the facet sequence + the index of the point + + + + Gets the coordinate at the given index + + The index + The coordinate at the given index + + + + Computes the distance to another facet sequence + + The other facet sequence + The distance between this and . + + + + Gets the envelope of this facet sequence + + + + + Gets the number of coordinates in this facet sequence + + + + + Tests if this facet sequence consists of only one point + + + + + Utility class to build facet sequencs STRtrees- + + + + + + + + + + + + Creates facet sequences from a given geometry + + The geometry + A list of s + + + + Represents the location of a point on a Geometry. + Maintains both the actual point location + (which may not be exact, if the point is not a vertex) + as well as information about the component + and segment index where the point occurs. + Locations inside area Geometrys will not have an associated segment index, + so in this case the segment index will have the sentinel value of . + + + + + A special value of segmentIndex used for locations inside area geometries. + These locations are not located on a segment, + and thus do not have an associated segment index. + + + + + Constructs a GeometryLocation specifying a point on a point, as well as the + segment that the point is on (or if the point is not on a segment). + + The component of the geometry containing the point + The segment index of the location, or + The coordinate of the location + + + + Constructs a GeometryLocation specifying a point inside an area point. + + The component of the geometry containing the point + The coordinate of the location + + + + Returns the geometry component on (or in) which this location occurs. + + + + + Returns the segment index for this location. If the location is inside an + area, the index will have the value . + + + + + Returns the of this location. + + + + + Tests whether this location represents a point inside an area geometry. + + + + + Computes the distance between the facets (segments and vertices) + of two s + using a Branch-and-Bound algorithm. + The Branch-and-Bound algorithm operates over a + traversal of R-trees built + on the target and possibly also the query geometries. + + This approach provides the following benefits: + + + Performance is improved due to the effects of the R-tree index + and the pruning due to the Branch-and-Bound approach + + The spatial index on the target geometry can be cached + to allow reuse in an incremental query situation. + + Using this technique can be much more performant + than using + when one or both input geometries are large, + or when evaluating many distance computations against + a single geometry. + + + This class is not thread-safe. + + Martin Davis + + + + + Computes the distance between two geometries using the indexed approach. + + + For geometries with many segments or points, + this can be faster than using a simple distance + algorithm. + + A geometry + A geometry + The distance between the two geometries + + + + Creates a new distance-finding instance for a given target . + + + + Distances will be computed to all facets of the input geometry. + The facets of the geometry are the discrete segments and points + contained in its components. + + In the case of and inputs, + this is equivalent to computing the conventional distance. + + In the case of inputs, this is equivalent + to computing the distance to the polygons boundaries. + + + A Geometry, which may be of any type. + + + + Computes the distance from the base geometry to the given geometry. + + The geometry to compute the distance to. + The computed distance + + + * Tests whether the base geometry lies within + * a specified distance of the given geometry. + * + //* @param g the geomtry to test + //* @param maximumDistance the maximum distance to test + //* @return true if the geometry lies with the specified distance + + + + The base class for operations that require s. + + + + + + + + + + The operation args into an array so they can be accessed by index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether a is simple. + In general, the SFS specification of simplicity + follows the rule: + + + A Geometry is simple if and only if the only self-intersections are at boundary points. + + + + + Simplicity is defined for each } subclass as follows: + + Valid geometries are simple by definition, so + IsSimple trivially returns true.
+ (Note: this means that IsSimple cannot be used to test + for (invalid) self-intersections in Polygons. + In order to check if a Polygonal geometry has self-intersections, + use ).
+ geometries are simple if and only if they do not self-intersect at interior points + (i.e. points other than boundary points). + This is equivalent to saying that no two linear components satisfy the SFS + predicate. + Zero-dimensional () geometries are simple if and only if they have no + repeated points. + Empty s are always simple by definition. +
+ For geometries the evaluation of simplicity + can be customized by supplying a + to define how boundary points are determined. + The default is the SFS-standard . + Note that under the Mod-2 rule, closed LineStrings (rings) + will never satisfy the touches predicate at their endpoints, since these are + interior points, not boundary points. + If it is required to test whether a set of LineStrings touch + only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. + For example, this can be used to validate that a set of lines form a topologically valid + linear network. +
+
+ + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + + + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + The geometry to test + + + + Creates a simplicity checker using a given + + The geometry to test + The rule to use + + + + Tests whether the geometry is simple. + + true if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + A MultiPoint is simple if it has no repeated points. + + + + + Computes simplicity for polygonal geometries. + Polygonal geometries are simple if and only if + all of their component rings are simple. + + A Polygonal geometry + true if the geometry is simple + + + Semantics for GeometryCollection is + simple iff all components are simple. + A GeometryCollection + true if the geometry is simple + + + + For all edges, check if there are any intersections which are NOT at an endpoint. + The Geometry is not simple if there are intersections not at endpoints. + + + + + + Tests that no edge intersection is the endpoint of a closed line. + This ensures that closed lines are not touched at their endpoint, + which is an interior point according to the Mod-2 rule + To check this we compute the degree of each endpoint. + The degree of endpoints of closed lines + must be exactly 2. + + + + + Add an endpoint to the map, creating an entry for it if none exists. + + + + + + + + Gets a coordinate for the location where the geometry fails to be simple. + (i.e. where it has a non-boundary self-intersection). + must be called before this location is accessed + + a coordinate for the location of the non-boundary self-intersection + or null if the geometry is simple + + + + + + + + + Creates an instance of this class + + The endpoint + + + + A sequence of LineMergeDirectedEdges forming one of the lines that will + be output by the line-merging process. + + + + + Constructs an EdgeString with the given factory used to convert this EdgeString + to a LineString. + + + + + + Adds a directed edge which is known to form part of this line. + + + + + + Converts this EdgeString into a LineString. + + + + + + + + + + A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. + + + + + Represents a directed edge in a PlanarGraph. A DirectedEdge may or + may not have a reference to a parent Edge (some applications of + planar graphs may not require explicit Edge objects to be created). Usually + a client using a PlanarGraph will subclass DirectedEdge + to add its own application-specific data and methods. + + + + + The base class for all graph component classes. + Maintains flags of use in generic graph algorithms. + Provides two flags: + marked - typically this is used to indicate a state that persists + for the course of the graph's lifetime. For instance, it can be + used to indicate that a component has been logically deleted from the graph. + visited - this is used to indicate that a component has been processed + or visited by an single graph algorithm. For instance, a breadth-first traversal of the + graph might use this to indicate that a node has already been traversed. + The visited flag may be set and cleared many times during the lifetime of a graph. + + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Finds the first + in a set + which has the specified state. + + A to scan. + The state to test. + The first found, or null if none found. + + + + Tests if a component has been visited during the course of a graph algorithm. + + + + + Gets/Sets the visited flag for this component. + + + + + Tests if a component has been marked at some point during the processing + involving this graph. + + + + + Gets/Sets the marked flag for this component. + + + + + Tests whether this component has been removed from its containing graph. + + + + + Gets or sets user defined data for this component + + + + + Returns a List containing the parent Edge (possibly null) for each of the given + DirectedEdges. + + + + + + + Constructs a DirectedEdge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Writes a detailed string representation of this DirectedEdge to the given PrintStream. + + + + + + Removes this directed edge from its containing graph. + + + + + Returns this DirectedEdge's parent Edge, or null if it has none. + Associates this DirectedEdge with an Edge (possibly null, indicating no associated + Edge). + + + + + Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's + orientation lies. + + + + + Returns a point to which an imaginary line is drawn from the from-node to + specify this DirectedEdge's orientation. + + + + + Returns whether the direction of the parent Edge (if any) is the same as that + of this Directed Edge. + + + + + Returns the node from which this DirectedEdge leaves. + + + + + Returns the node to which this DirectedEdge goes. + + + + + Returns the coordinate of the from-node. + + + + + Returns the angle that the start of this DirectedEdge makes with the + positive x-axis, in radians. + + + + + Returns the symmetric DirectedEdge -- the other DirectedEdge associated with + this DirectedEdge's parent Edge. + Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite + direction. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeDirectedEdge connecting the from node to the to node. + + + + + specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the directed edge that starts at this directed edge's end point, or null + if there are zero or multiple directed edges starting there. + + + + + An edge of a LineMergeGraph. The marked field indicates + whether this Edge has been logically deleted from the graph. + + + + + Represents an undirected edge of a {PlanarGraph}. An undirected edge + in fact simply acts as a central point of reference for two opposite + DirectedEdges. + Usually a client using a PlanarGraph will subclass Edge + to add its own application-specific data and methods. + + + + + The two DirectedEdges associated with this Edge. + + + + + Constructs an Edge whose DirectedEdges are not yet set. Be sure to call + SetDirectedEdges(DirectedEdge, DirectedEdge). + + + + + Constructs an Edge initialized with the given DirectedEdges, and for each + DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds + this Edge to its from-Node. + + + + + + + Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the + Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. + + + + + + + Returns one of the DirectedEdges associated with this Edge. + + 0 or 1. + + + + + Returns the DirectedEdge that starts from the given node, or null if the + node is not one of the two nodes associated with this Edge. + + + + + + + If node is one of the two nodes associated with this Edge, + returns the other node; otherwise returns null. + + + + + + + Removes this edge from its containing graph. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeEdge with vertices given by the specified LineString. + + + + + + Returns the LineString specifying the vertices of this edge. + + + + + A planar graph of edges that is analyzed to sew the edges together. The + marked flag on com.vividsolutions.planargraph.Edges + and com.vividsolutions.planargraph.Nodes indicates whether they have been + logically deleted from the graph. + + + + + Represents a directed graph which is embeddable in a planar surface. + This class and the other classes in this package serve as a framework for + building planar graphs for specific algorithms. This class must be + subclassed to expose appropriate methods to construct the graph. This allows + controlling the types of graph components ({DirectedEdge}s, + Edges and Nodes) which can be added to the graph. An + application which uses the graph framework will almost always provide + subclasses for one or more graph components, which hold application-specific + data and graph algorithms. + + + + + + + + + + + + + + + + + + + + Returns the at the given location, or null if no was there. + + The location + The node found
+ or null if this graph contains no node at the location +
+
+ + + Adds a node to the map, replacing any that is already at that location. + Only subclasses can add Nodes, to ensure Nodes are of the right type. + + + The added node. + + + + Adds the Edge and its DirectedEdges with this PlanarGraph. + Assumes that the Edge has already been created with its associated DirectEdges. + Only subclasses can add Edges, to ensure the edges added are of the right class. + + + + + + Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, + to ensure the edges added are of the right class. + + + + + + Returns an IEnumerator over the Nodes in this PlanarGraph. + + + + + + Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they + were added. + + + + + + Returns an Iterator over the Edges in this PlanarGraph, in the order in which they + were added. + + + + + + Removes an Edge and its associated DirectedEdges from their from-Nodes and + from this PlanarGraph. Note: This method does not remove the Nodes associated + with the Edge, even if the removal of the Edge reduces the degree of a + Node to zero. + + + + + + Removes a from its from- and from this PlanarGraph. + + + This method does not remove the s associated with the DirectedEdge, + even if the removal of the DirectedEdge reduces the degree of a Node to zero. + + + + + + Removes a node from the graph, along with any associated DirectedEdges and + Edges. + + + + + + Returns all Nodes with the given number of Edges around it. + + + + + + + Returns the Nodes in this PlanarGraph. + + + + + Returns the Edges that have been added to this PlanarGraph. + + + + + Adds an Edge, DirectedEdges, and Nodes for the given LineString representation + of an edge. + + + + + + + + + + + + Sews together a set of fully noded LineStrings. + + + Sewing stops at nodes of degree 1 + or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, + in which case a node is simply chosen as a starting point. The direction of each + merged LineString will be that of the majority of the LineStrings from which it + was derived. + + Any dimension of Geometry is handled -- the constituent linework is extracted to + form the edges. The edges must be correctly noded; that is, they must only meet + at their endpoints. The LineMerger will still run on incorrectly noded input + but will not form polygons from incorrected noded edges. + + NOTE:once merging has been performed, no more + + + + + Adds a Geometry to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the LineStrings built by the merging process. + + + + + + + + + + + + + + + + + + + + + + + + Builds a sequence from a set of s, + so that they are ordered end to end. + A sequence is a complete non-repeating list of the linear + components of the input. Each linestring is oriented + so that identical endpoints are adjacent in the list. + + + The input linestrings may form one or more connected sets. + The input linestrings should be correctly noded, or the results may + not be what is expected. + The output of this method is a single , + containing the ordered linestrings in the sequence. + + + The sequencing employs the classic 'Eulerian path' graph algorithm. + Since Eulerian paths are not uniquely determined, further rules are used to + make the computed sequence preserve as much as possible of the input ordering. + Within a connected subset of lines, the ordering rules are: + - If there is degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If there is a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + + + Not all arrangements of lines can be sequenced. + For a connected set of edges in a graph, + Euler's Theorem states that there is a sequence containing each edge once + if and only if there are no more than 2 nodes of odd degree. + If it is not possible to find a sequence, the + property will return false. + + + + + + Tests whether a is sequenced correctly. + s are trivially sequenced. + s are checked for correct sequencing. + Otherwise, IsSequenced is defined + to be true for geometries that are not lineal. + + The to test. + + true if the is sequenced or is not lineal. + + + + + Adds a of s to be sequenced. + May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be extracted. + + A of geometries to add. + + + + Adds a to be sequenced. + May be called multiple times. + Any dimension of may be added; + the constituent linework will be extracted. + + + + + + Tests whether the arrangement of linestrings has a valid sequence. + + true if a valid sequence exists. + + + + Returns the or + built by the sequencing process, if one exists. + + The sequenced linestrings, + or null if a valid sequence does not exist. + + + + Tests whether a complete unique path exists in a graph + using Euler's Theorem. + + The containing the edges. + true if a sequence exists. + + + + Finds an for an unvisited edge (if any), + choosing the which preserves orientation, if possible. + + The to examine. + + The found, + or null if none were unvisited. + + + + + Computes a version of the sequence which is optimally + oriented relative to the underlying geometry. + + Heuristics used are: + - If the path has a degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If the path has a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + (NOTE: in this case could orient the sequence according to the majority of the + linestring orientations). + + + A of s. + + A of s oriented appropriately. + + + + + Reverse the sequence. + This requires reversing the order of the s, + and flipping each as well. + + + A enumeration of s, + in sequential order. + + The reversed sequence. + + + + Builds a geometry ( or ) + representing the sequence. + + + An enumeration of s of s + with s as their parent edges. + + + The sequenced geometry, or null if no sequence exists. + + + + + A private implementation for + + + + + Initializes a new instance of the class. + + The sequencer. + + + + Performs an operation with or on + + + A to which the filter is applied. + + + + + Nodes a set of edges. + Takes one or more sets of edges and constructs a + new set of edges consisting of all the split edges created by + noding the input edges together. + + + + + + + + + + + + + + + + + + + + + + Forms NTS LineStrings out of a the graph of DirectedEdges + created by an OverlayOp. + + + + + + + + + + + + + + + + + A list of the LineStrings in the result of the specified overlay operation. + + + + + Find and mark L edges which are "covered" by the result area (if any). + L edges at nodes which also have A edges can be checked by checking + their depth at that node. + L edges at nodes which do not have A edges can be checked by doing a + point-in-polygon test with the previously computed result areas. + + + + + + + + + + + + + + + + + + + Collect edges from Area inputs which should be in the result but + which have not been included in a result area. + This happens ONLY: + during an intersection when the boundaries of two + areas touch in a line segment + OR as a result of a dimensional collapse. + + + + + + + + + + + + + + + + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A ring of edges which may contain nodes of degree > 2. + A MaximalEdgeRing may represent two different spatial entities: + a single polygon possibly containing inversions (if the ring is oriented CW) + a single hole possibly containing exversions (if the ring is oriented CCW) + If the MaximalEdgeRing represents a polygon, + the interior of the polygon is strongly connected. + These are the form of rings used to define polygons under some spatial data models. + However, under the OGC SFS model, MinimalEdgeRings are required. + A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the + BuildMinimalRings() method. + + + + + + + + + + + + + + + + + + + + + + + + + + For all nodes in this EdgeRing, + link the DirectedEdges at the node to form minimalEdgeRings + + + + + + + + + + + A ring of edges with the property that no node + has degree greater than 2. These are the form of rings required + to represent polygons under the OGC SFS spatial data model. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates nodes for use in the PlanarGraphs constructed during + overlay operations. + + + + + + + + + + + + The spatial functions supported by this class. + These operations implement various bool combinations of the resultants of the overlay. + + + + + The code for the Intersection overlay operation + + + + + The code for the Union overlay operation + + + + + The code for the Difference overlay operation + + + + + The code for the Symmetric Difference overlay operation + + + + + Computes the geometric overlay of two s. The overlay + can be used to determine any bool combination of the geometries. + + + + + Computes an overlay operation + for the given geometry arguments. + + The first geometry argument + The second geometry argument + The code for the desired overlay operation + The result of the overlay operation + Thrown if a robustness problem is encountered. + + + + Tests whether a point with a given topological + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + The topological label of the point + The code for the overlay operation to test + true if the label locations correspond to the overlayOpCode + + + + Tests whether a point with given s + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + the code for the location in the first geometry + the code for the location in the second geometry + the code for the overlay operation to test + true if the locations correspond to the overlayOpCode. + + + + Constructs an instance to compute a single overlay operation + for the given geometries. + + The first geometry argument + The second geometry argument + + + + Gets the result of the overlay for a given overlay operation. + + Note: this method can be called once only. + + The code of the overlay operation to perform + The computed result geometry + Thrown if a robustness problem is encountered + + + + Insert an edge from one of the noded input graphs. + Checks edges that are inserted to see if an + identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + The edge to insert + + + + Update the labels for edges according to their depths. + For each edge, the depths are first normalized. + Then, if the depths for the edge are equal, + this edge must have collapsed into a line edge. + If the depths are not equal, update the label + with the locations corresponding to the depths + (i.e. a depth of 0 corresponds to a Location of Exterior, + a depth of 1 corresponds to Interior) + + + + + If edges which have undergone dimensional collapse are found, + replace them with a new edge which is a L edge + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a previously computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Compute initial labelling for all DirectedEdges at each node. + In this step, DirectedEdges will acquire a complete labelling + (i.e. one with labels for both Geometries) + only if they + are incident on a node which has edges for both Geometries + + + + + For nodes which have edges from only one Geometry incident on them, + the previous step will have left their dirEdges with no labelling for the other + Geometry. However, the sym dirEdge may have a labelling for the other + Geometry, so merge the two labels. + + + + + Incomplete nodes are nodes whose labels are incomplete. + (e.g. the location for one Geometry is null). + These are either isolated nodes, + or nodes which have edges from only a single Geometry incident on them. + Isolated nodes are found because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + When each node labelling is completed, the labelling of the incident + edges is updated, to complete their labelling as well. + + + + + Label an isolated node with its relationship to the target point. + + + + + Find all edges whose label indicates that they are in the result area(s), + according to the operation being performed. Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + If both a dirEdge and its sym are marked as being in the result, cancel + them out. + + + + + Tests if a point node should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Line or Area geometry. + + + + Tests if an L edge should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Area geometry. + + + + true if the coord is located in the interior or boundary of + a point in the list. + + + + + Creates an empty result geometry of the appropriate dimension, + based on the given overlay operation and the dimensions of the inputs. + The created geometry is always an atomic geometry, + not a collection. + + The empty result is constructed using the following rules: + + - result has the dimension of the lowest input dimension + - result has the dimension of the highest input dimension + - result has the dimension of the left-hand input + - result has the dimension of the highest input dimension + (since symDifference is the union of the differences). + + + The overlay operation being performed + An input geometry + An input geometry + The geometry factory being used for the operation + An empty atomic geometry of the appropriate dimension + + + + Disable + when an intersection is made (), + so performances are dramatically improved but failures are not managed. + + + Use ay your own risk! + + + + + Gets the graph constructed to compute the overlay. + + + + + Constructs Points from the nodes of an overlay graph. + + + + + + + + + + + + + + + + + A list of the Points in the result of the specified overlay operation. + + + + + + + + + + + + This method simplifies the resultant Geometry by finding and eliminating + "covered" points. + A point is covered if it is contained in another element Geometry + with higher dimension (e.g. a point might be contained in a polygon, + in which case the point can be eliminated from the resultant). + + + + + + + Forms Polygons out of a graph of {DirectedEdge}s. + The edges to use are marked as being in the result Area. + + + + + + + + + + + Add a complete graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + Add a set of edges and nodes, which form a graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + + For all DirectedEdges in result, form them into MaximalEdgeRings. + + + + + + + + + + + + + + + + This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, + and tests whether they form a Polygon. This is the case if there is a single shell + in the list. In this case the shell is returned. + The other possibility is that they are a series of connected holes, in which case + no shell is returned. + + The shell EdgeRing, if there is one
or + null, if all the rings are holes.
+
+ + + This method assigns the holes for a Polygon (formed from a list of + MinimalEdgeRings) to its shell. + Determining the holes for a MinimalEdgeRing polygon serves two purposes: + it is faster than using a point-in-polygon check later on. + it ensures correctness, since if the PIP test was used the point + chosen might lie on the shell, which might return an incorrect result from the + PIP test. + + + + + + + For all rings in the input list, + determine whether the ring is a shell or a hole + and add it to the appropriate list. + Due to the way the DirectedEdges were linked, + a ring is a shell if it is oriented CW, a hole otherwise. + + + + + + + + This method determines finds a containing shell for all holes + which have not yet been assigned to a shell. + These "free" holes should + all be properly contained in their parent shells, so it is safe to use the + findEdgeRingContaining method. + (This is the case because any holes which are NOT + properly contained (i.e. are connected to their + parent shell) would have formed part of a MaximalEdgeRing + and been handled in a previous step). + + + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
or + null if no containing EdgeRing is found.
+
+ + + + + + + + + + Checks the current set of shells (with their associated holes) to + see if any of them contain the point. + + + + + + + + + + + + Snaps the vertices and segments of a + to another Geometry's vertices. + A snap distance tolerance is used to control where snapping is performed. + Snapping one geometry to another can improve + robustness for overlay operations by eliminating + nearly-coincident edges + (which cause problems during noding and intersection calculation). + It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. + Too much snapping can result in invalid topology + beging created, so the number and location of snapped vertices + is decided using heuristics to determine when it + is safe to snap. + This can result in some potential snaps being omitted, however. + + Martin Davis + + + + Estimates the snap tolerance for a Geometry, taking into account its precision model. + + + The estimated snap tolerance + + + + + + + + + + + + + + + + + + + Snaps two geometries together with a given tolerance. + + + + + + + + + Snaps a geometry to itself. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. + + the geometry to snap + the snapping tolerance + whether the result should be made valid + a new snapped + + + + Creates a new snapper acting on the given geometry + + the geometry to snap + + + + Snaps the vertices in the component s + of the source geometry to the vertices of the given snap geometry. + + a geometry to snap the source to + + a new snapped Geometry + + + Snaps the vertices in the component s + of the source geometry to the vertices of the same geometry. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + The snapping tolerance + Whether the result should be made valid + The geometry snapped to itself + + + + + + + + + + + Computes the snap tolerance based on the input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snaps the vertices and segments of a + to a set of target snap vertices. + A snap distance tolerance is used to control where snapping is performed. + The implementation handles empty geometry and empty snap vertex sets. + + + + + Creates a new snapper using the points in the given + as target snap points. + + A LineString to snap (may be empty) + the snap tolerance to use + + + + Creates a new snapper using the given points + as source points to be snapped. + + + + + + + Snaps the vertices and segments of the source LineString + to the given set of snap points. + + the vertices to snap to + list of the snapped points + + + + Snap source vertices to vertices in the target. + + the points to snap + the points to snap to + + + + + + + + + + + + Snap segments of the source to nearby snap vertices. + Source segments are "cracked" at a snap vertex. + A single input segment may be snapped several times + to different snap vertices. + For each distinct snap vertex, at most one source segment + is snapped to. This prevents "cracking" multiple segments + at the same point, which would likely cause + topology collapse when being used on polygonal linework. + + The coordinates of the source linestring to snap + The target snap vertices + + + + Finds a src segment which snaps to (is close to) the given snap point + Only a single segment is selected for snapping. + This prevents multiple segments snapping to the same snap vertex, + which would almost certainly cause invalid geometry + to be created. + (The heuristic approach of snapping used here + is really only appropriate when + snap pts snap to a unique spot on the src geometry) + Also, if the snap vertex occurs as a vertex in the src coordinate list, + no snapping is performed. + + The point to snap to + The source segment coordinates + The index of the snapped segment
+ or -1 if no segment snaps to the snap point.
+
+ + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class only uses snapping + if an error is detected when running the standard JTS overlay code. + Errors detected include thrown exceptions + (in particular, ) + and invalid overlay computations. + + + + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class always uses snapping. + This is less performant than the standard JTS overlay code, + and may even introduce errors which were not present in the original data. + For this reason, this class should only be used + if the standard overlay code fails to produce a correct result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds the most likely of a point relative to + the polygonal components of a geometry, using a tolerance value. + + + If a point is not clearly in the Interior or Exterior, + it is considered to be on the Boundary. + In other words, if the point is within the tolerance of the Boundary, + it is considered to be on the Boundary; otherwise, + whether it is Interior or Exterior is determined directly. + + Martin Davis + + + + Extracts linework for polygonal components. + + The geometry from which to extract + A lineal geometry containing the extracted linework + + + + Extracts the LineStrings in the boundaries of all the polygonal elements in the target . + + Martin Davis + + + + Filters out all linework for polygonal elements + + + + + Gets the list of polygonal linework. + + + + + Generates points offset by a given distance from both sides of the midpoint of all segments in a . + + + + Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. + + + The input geometry may have any orientation for its rings, + but is + only meaningful if the orientation is known. + + + Martin Davis + + + Set the sides on which to generate offset points. + + @param doLeft + @param doRight + + + + Gets the computed offset points. + + + + + Generates the two points which are offset from the + midpoint of the segment (p0, p1) by the offsetDistance + + The first point of the segment to offset from. + The second point of the segment to offset from + + + + + + Validates that the result of an overlay operation is geometrically correct within a determined tolerance. + Uses fuzzy point location to find points which are + definitely in either the interior or exterior of the result + geometry, and compares these results with the expected ones. + + + This algorithm is only useful where the inputs are polygonal. + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + Martin Davis + + + + + Represents a ring of PolygonizeDirectedEdges which form + a ring of a polygon. The ring may be either an outer shell or a hole. + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
+ or null if no containing EdgeRing is found.
+
+ + + Finds a point in a list of points which is not contained in another list of points. + + The Coordinates to test. + An array of Coordinates to test the input points against. + A Coordinate from testPts which is not in pts,
+ or null.
+
+ + + Tests whether a given point is in an array of points. + Uses a value-based test. + + A Coordinate for the test point. + An array of Coordinates to test, + true if the point is in the array. + + + Traverses a ring of DirectedEdges, accumulating them into a list. + This assumes that all dangling directed edges have been removed + from the graph, so that there is always a next dirEdge. + + @param startDE the DirectedEdge to start traversing at + @return a List of DirectedEdges that form a ring + + + + + + + + + + Adds a DirectedEdge which is known to form part of this ring. + + The DirectedEdge to add. + + + + Computes whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + + + + Adds a hole to the polygon formed by this ring. + + The LinearRing forming the hole. + + + + Adds a hole to the polygon formed by this ring. + + the forming the hole. + + + + + + + + + + + + Updates the included status for currently non-included shells + based on whether they are adjacent to an included shell. + + + + + Gets a string representation of this object. + + + + + Tests whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + true if this ring is a hole. + + + + Computes and returns the Polygon formed by this ring and any contained holes. + + + + + Tests if the ring formed by this edge ring is topologically valid. + + true if the ring is valid. + + + + Computes and returns the list of coordinates which are contained in this ring. + The coordinatea are computed once only and cached. + + + + + Gets the coordinates for this ring as a LineString. + Used to return the coordinates in this ring + as a valid point, when it has been detected that the ring is topologically + invalid. + + + + + Returns this ring as a LinearRing, or null if an Exception occurs while + creating it (such as a topology problem). Details of problems are written to + standard output. + + + + + Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. + + + + + Gets a value indicating whether this ring has a shell assigned to it. + + + + + Tests whether this ring is an outer hole. + A hole is an outer hole if it is not contained by a shell. + + + + + Tests whether this ring is an outer shell. + + + + + Gets or sets a value indicating whether this ring has been processed. + + + + + Compares EdgeRings based on their envelope, + using the standard lexicographic ordering. + This ordering is sufficient to make edge ring sorting deterministic. + + mbdavis + + + + A DirectedEdge of a PolygonizeGraph, which represents + an edge of a polygon formed by the graph. + May be logically deleted from the graph by setting the marked flag. + + + + + Constructs a directed edge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the identifier attached to this directed edge. + Attaches an identifier to this directed edge. + + + + + Returns the next directed edge in the EdgeRing that this directed edge is a member of. + Sets the next directed edge in the EdgeRing that this directed edge is a member of. + + + + + Returns the ring of directed edges that this directed edge is + a member of, or null if the ring has not been set. + + + + + Gets/Sets the ring of directed edges that this directed edge is + a member of. + + + + + An edge of a polygonization graph. + + + + + + + + + + + + + + + + Represents a planar graph of edges that can be used to compute a + polygonization, and implements the algorithms to compute the + EdgeRings formed by the graph. + The marked flag on DirectedEdges is used to indicate that a directed edge + has be logically deleted from the graph. + + + + + + + + + + + + + + + + + + + + Deletes all edges at a node. + + + + + + Create a new polygonization graph. + + + + + + Add a LineString forming an edge of the polygon graph. + + The line to add. + + + + + + + + + + + + + + + + Convert the maximal edge rings found by the initial graph traversal + into the minimal edge rings required by NTS polygon topology rules. + + The list of start edges for the edgeRings to convert. + + + + Finds all nodes in a maximal edgering which are self-intersection nodes + + + + + The list of intersection nodes found, + or null if no intersection nodes were found. + + + + + Computes the minimal EdgeRings formed by the edges in this graph. + + A list of the{EdgeRings found by the polygonization process. + + + + Finds and labels all edgerings in the graph. + The edge rings are labeling with unique integers. + The labeling allows detecting cut edges. + + A List of the DirectedEdges in the graph. + A List of DirectedEdges, one for each edge ring found. + + + + Finds and removes all cut edges from the graph. + + A list of the LineStrings forming the removed cut edges. + + + + + + + + + + + + + + + + + Computes the next edge pointers going CCW around the given node, for the + given edgering label. + This algorithm has the effect of converting maximal edgerings into minimal edgerings + + + + + + + + + + + + + + Marks all edges from the graph which are "dangles". + Dangles are which are incident on a node with degree 1. + This process is recursive, since removing a dangling edge + may result in another edge becoming a dangle. + In order to handle large recursion depths efficiently, + an explicit recursion stack is used. + + A List containing the s that formed dangles. + + + + Traverses the polygonized edge rings in the graph + and computes the depth parity (odd or even) + relative to the exterior of the graph. + + If the client has requested that the output + be polygonally valid, only odd polygons will be constructed. + + + + + Traverses all connected edges, computing the depth parity of the associated polygons. + + + + + + Polygonizes a set of s which contain linework that + represents the edges of a planar graph. + + + All types of Geometry are accepted as input; + the constituent linework is extracted as the edges to be polygonized. + The processed edges must be correctly noded; that is, they must only meet + at their endpoints. Polygonization will accept incorrectly noded input + but will not form polygons from non-noded edges, + and reports them as errors. + + The Polygonizer reports the follow kinds of errors: + Dangles - edges which have one or both ends which are not incident on another edge endpoint + Cut Edges - edges which are connected at both ends but which do not form part of polygon + Invalid Ring Lines - edges which form rings which are invalid + (e.g. the component lines contain a self-intersection). + + Polygonization supports extracting only polygons which form a valid polygonal geometry. + The set of extracted polygons is guaranteed to be edge-disjoint. + This is useful for situations where it is known that the input lines form a + valid polygonal geometry. + + + + + + The default polygonizer output behavior + + + + + Default linestring adder. + + + + + Creates a polygonizer with the same + as the input Geometrys. + The output mask is + + + + + + Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. + + true if only polygons which form a valid polygonal geometry are to be extracted + + + + Adds a collection of s to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used. + + A list of Geometrys with linework to be polygonized. + + + + Adds a to the linework to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used + + A Geometry with linework to be polygonized. + + + + Adds a to the graph of polygon edges. + + The to add. + + + + Gets the list of polygons formed by the polygonization. + + + + + Gets a geometry representing the polygons formed by the polygonization. + If a valid polygonal geometry was extracted the result is a geometry. + + A geometry containing the polygons + + + + Gets the list of dangling lines found during polygonization. + + + + + Gets the list of cut edges found during polygonization. + + + + + Gets the list of lines forming invalid rings found during polygonization. + + + + + Performs the polygonization, if it has not already been carried out. + + + + + For each outer hole finds and includes a single outer shell. + This seeds the travesal algorithm for finding only polygonal shells. + + The list of shell EdgeRings + + + + Allows disabling the valid ring checking, + to optimize situations where invalid rings are not expected. + + The default is true + + + + Adds every linear element in a into the polygonizer graph. + + + + + Filters all geometry instances + + The geometry instance + + + + Optimized implementation of spatial predicate "contains" + for cases where the first Geometry is a rectangle. + As a further optimization, + this class can be used directly to test many geometries against a single rectangle. + + + + + + + + + + + + + Create a new contains computer for two geometries. + + A rectangular geometry. + + + + + + + + + + + + + + + + + + + + + + + + + Tests if a point is contained in the boundary of the target rectangle. + + the point to test + true if the point is contained in the boundary + + + + Tests if a linestring is completely contained in the boundary of the target rectangle. + + the linestring to test + true if the linestring is contained in the boundary + + + + Tests if a line segment is contained in the boundary of the target rectangle. + + an endpoint of the segment + an endpoint of the segment + true if the line segment is contained in the boundary + + + I + Implementation of the Intersects spatial predicate + optimized for the case where one is a rectangle. + + + This class works for all input geometries, including s. + + As a further optimization, this class can be used in batch style + to test many geometries against a single rectangle. + + + + + Crossover size at which brute-force intersection scanning + is slower than indexed intersection detection. + Must be determined empirically. Should err on the + safe side by making value smaller rather than larger. + + + + + Tests whether a rectangle intersects a given geometry. + + A rectangular polygon + A geometry of any kind + true if the geometries intersect. + + + + Create a new intersects computer for a rectangle. + + A rectangular polygon. + + + + Tests whether the given Geometry intersects the query rectangle. + + The Geometry to test (may be of any type) + true if an intersection must occur + or false if no conclusion about intersection can be made + + + + Tests whether it can be concluded that a rectangle intersects a geometry, + based on the relationship of the envelope(s) of the geometry. + + Martin Davis + + + + Creates an instance of this class using the provided Envelope + + The query envelope + + + + + + + + + + + + + + + + Reports whether it can be concluded that an intersection occurs, + or whether further testing is required. + + true if an intersection must occur
+ or false if no conclusion about intersection can be made
+
+ + + A visitor which tests whether it can be + concluded that a geometry contains a vertex of + a query geometry. + + Martin Davis + + + + + + + + + + + + + + + + + + + + + + Gets a value indicating whether it can be concluded that a corner point of the rectangle is + contained in the geometry, or whether further testing is required. + + true if a corner point is contained + or false if no conclusion about intersection can be made + + + + + A visitor to test for intersection between the query rectangle and the line segments of the geometry. + + Martin Davis + + + + Creates a visitor for checking rectangle intersection with segments + + the query rectangle + + + Reports whether any segment intersection exists. + true if a segment intersection exists or + false if no segment intersection exists + + + + Tests if any line segments in two sets of intersect. + Optimized for use when at least one input is of small size. + Short-circuited to return as soon an intersection is found. + + + + + + + + + + + + + + + + + + + + + An EdgeEndBuilder creates EdgeEnds for all the "split edges" + created by the intersections determined for an Edge. + Computes the EdgeEnds which arise from a noded Edge. + + + + + + + + + + + + Creates stub edges for all the intersections in this + Edge (if any) and inserts them into the graph. + + + + + + + Create a EdgeStub for the edge before the intersection eiCurr. + The previous intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the previous point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiPrev may be null. + + + + + + + + + Create a StubEdge for the edge after the intersection eiCurr. + The next intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the next point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiNext may be null. + + + + + + + + + A collection of EdgeStubs which obey the following invariant: + They originate at the same node and have the same direction. + Contains all EdgeEnds which start at the same point and are parallel. + + + + + + + + + + + + + + + + + + + + + + + + This computes the overall edge label for the set of + edges in this EdgeStubBundle. It essentially merges + the ON and side labels for each edge. + These labels must be compatible + + + + + + Compute the overall ON location for the list of EdgeStubs. + (This is essentially equivalent to computing the self-overlay of a single Geometry) + edgeStubs can be either on the boundary (eg Polygon edge) + OR in the interior (e.g. segment of a LineString) + of their parent Geometry. + In addition, GeometryCollections use the to determine + whether a segment is on the boundary or not. + Finally, in GeometryCollections it can occur that an edge is both + on the boundary and in the interior (e.g. a LineString segment lying on + top of a Polygon edge.) In this case the Boundary is given precendence. + These observations result in the following rules for computing the ON location: + if there are an odd number of Bdy edges, the attribute is Bdy + if there are an even number >= 2 of Bdy edges, the attribute is Int + if there are any Int edges, the attribute is Int + otherwise, the attribute is Null. + + + + + + + Compute the labelling for each side + + + + + + To compute the summary label for a side, the algorithm is: + FOR all edges + IF any edge's location is Interior for the side, side location = Interior + ELSE IF there is at least one Exterior attribute, side location = Exterior + ELSE side location = Null + Note that it is possible for two sides to have apparently contradictory information + i.e. one edge side may indicate that it is in the interior of a point, while + another edge side may indicate the exterior of the same point. This is + not an incompatibility - GeometryCollections may contain two Polygons that touch + along an edge. This is the reason for Interior-primacy rule above - it + results in the summary label having the Geometry interior on both sides. + + + + + + + Update the IM with the contribution for the computed label for the EdgeStubs. + + + + + + + + + + + + + + + + + An ordered list of EdgeEndBundles around a RelateNode. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + Insert a EdgeEnd in order in the list. + If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is + added to the bundle. Otherwise, a new EdgeEndBundle is created + to contain the EdgeEnd. + + + + + + Update the IM with the contribution for the EdgeStubs around the node. + + + + + + Computes the topological relationship between two Geometries. + RelateComputer does not need to build a complete graph structure to compute + the IntersectionMatrix. The relationship between the geometries can + be computed by simply examining the labelling of edges incident on each node. + RelateComputer does not currently support arbitrary GeometryCollections. + This is because GeometryCollections can contain overlapping Polygons. + In order to correct compute relate on overlapping Polygons, they + would first need to be noded and merged (if not explicitly, at least + implicitly). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + For all intersections on the edges of a Geometry, + label the corresponding node IF it doesn't already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + If the Geometries are disjoint, we need to enter their dimension and + boundary dimension in the Ext rows in the IM + + + + + + + + + + + Update the IM with the sum of the IMs for each component. + + + + + + Processes isolated edges by computing their labelling and adding them + to the isolated edges list. + Isolated edges are guaranteed not to touch the boundary of the target (since if they + did, they would have caused an intersection to be computed and hence would + not be isolated). + + + + + + + Label an isolated edge of a graph with its relationship to the target point. + If the target has dim 2 or 1, the edge can either be in the interior or the exterior. + If the target has dim 0, the edge must be in the exterior. + + + + + + + + Isolated nodes are nodes whose labels are incomplete + (e.g. the location for one Geometry is null). + This is the case because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A RelateNode is a Node that maintains a list of EdgeStubs + for the edges that are incident on it. + + + + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + Update the IM with the contribution for the EdgeEnds incident on this node. + + + + + + Used by the NodeMap in a RelateNodeGraph to create RelateNodes. + + + + + + + + + + + + Implements the simple graph of Nodes and EdgeEnd which is all that is + required to determine topological relationships between Geometries. + Also supports building a topological graph of a single Geometry, to + allow verification of valid topology. + It is not necessary to create a fully linked + PlanarGraph to determine relationships, since it is sufficient + to know how the Geometries interact locally around the nodes. + In fact, this is not even feasible, since it is not possible to compute + exact intersection points, and hence the topology around those nodes + cannot be computed robustly. + The only Nodes that are created are for improper intersections; + that is, nodes which occur at existing vertices of the Geometries. + Proper intersections (e.g. ones which occur between the interior of line segments) + have their topology determined implicitly, without creating a Node object + to represent them. + + + + + + + + + + + + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + Precondition: edge intersections have been computed. + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule). + + + + + + + + + + + + + Implements the SFS relate() generalized spatial predicate on two s. +
+ The class supports specifying a custom + to be used during the relate computation. +
+ + If named spatial predicates are used on the result + of the RelateOp, the result may or not be affected by the + choice of BoundaryNodeRule, depending on the exact nature of the pattern. + For instance, is insensitive + to the choice of BoundaryNodeRule, + whereas is affected by the rule chosen. + + Note: custom Boundary Node Rules do not (currently) + affect the results of other methods (such + as . The results of + these methods may not be consistent with the relationship computed by + a custom Boundary Node Rule. + +
+ + + Computes the for the spatial relationship + between two s, using the default (OGC SFS) Boundary Node Rule + + A geometry to test + A geometry to test + The IntersectonMatrix for the spatial relationship between the geometries + + + + Computes the for the spatial relationship + between two s, using the specified Boundary Node Rule + + A geometry to test + A geometry to test + The Boundary Node Rule to use + The IntersectonMatrix for the spatial relationship between the geometries + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + The Boundary Node Rule to use + + + + Gets the IntersectionMatrix for the spatial relationship + between the input geometries. + + + + + Provides an efficient method of unioning a collection of + geometrys. + The geometries are indexed using a spatial index, + and unioned recursively in index order. + For geometries with a high degree of overlap, + this has the effect of reducing the number of vertices + early in the process, which increases speed + and robustness. + + This algorithm is faster and more robust than + the simple iterated approach of + repeatedly unioning each polygon to a result geometry. + + The buffer(0) trick is sometimes faster, but can be less robust and + can sometimes take a long time to complete. + This is particularly the case where there is a high degree of overlap + between the polygons. In this case, buffer(0) is forced to compute + with all line segments from the outset, + whereas cascading can eliminate many segments + at each stage of processing. + The best situation for using buffer(0) is the trivial case + where there is no overlap between the input geometries. + However, this case is likely rare in practice. + + Martin Davis + + + + The effectiveness of the index is somewhat sensitive + to the node capacity. + Testing indicates that a smaller capacity is better. + For an STRtree, 4 is probably a good number (since + this produces 2x2 "squares"). + + + + Computes the union of + a collection of s. + + A collection of s. + + + + + Creates a new instance to union + the given collection of s. + + A collection of s + + + + Computes the union of the input geometries. + + + + This method discards the input geometries as they are processed. + In many input cases this reduces the memory retained + as the operation proceeds. + Optimal memory usage is achieved + by disposing of the original input collection + before calling this method. + + The union of the input geometries, + or null if no input geometries were provided + + if this method is called more than once + + + + Unions a list of geometries + by treating the list as a flattened binary tree, + and performing a cascaded union on the tree. + + The list of geometries to union + The union of the list + + + + Unions a section of a list using a recursive binary union on each half + of the section. + + The list of geometries containing the section to union + The start index of the section + The index after the end of the section + The union of the list section + + + + Gets the element at a given list index, or + null if the index is out of range. + + The list of geometries + The index + The geometry at the given index or + null if the index is out of range + + + + Reduces a tree of geometries to a list of geometries + by recursively unioning the subtrees in the list. + + A tree-structured list of geometries + A list of Geometrys + + + + Computes the union of two geometries, + either or both of which may be null. + + A Geometry + A Geometry + The union of the input(s) or + null if both inputs are null + + + + Unions two polygonal geometries, restricting computation + to the envelope intersection where possible. + The case of MultiPolygons is optimized to union only + the polygons which lie in the intersection of the two geometry's envelopes. + Polygons outside this region can simply be combined with the union result, + which is potentially much faster. + This case is likely to occur often during cascaded union, and may also + occur in real world data (such as unioning data for parcels on different street blocks). + + A polygonal geometry + A polygonal geometry + The intersection of the envelopes of the inputs + The union of the inputs + + + + Encapsulates the actual unioning of two polygonal geometries. + + + + Computes a containing only components. + Extracts the s from the input + and returns them as an appropriate geometry. + + If the input is already Polygonal, it is returned unchanged. + + A particular use case is to filter out non-polygonal components + returned from an overlay operation. + + The geometry to filter + A polygonal geometry + + + + Computes the union of a geometry with + another arbitrary . + Does not copy any component geometries. + + + + + + + + Unions a Collection of s or a single Geometry (which may be a ) together. + + + + By using this special-purpose operation over a collection of geometries + it is possible to take advantage of various optimizations to improve performance. + + + Heterogeneous s are fully supported. + + + The result obeys the following contract: + + Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). + Unioning a set of s has the effect of fully noding + and dissolving the input linework. + In this context "fully noded" means that there will be + an endpoint or node in the result + for every endpoint or line segment crossing in the input. + "Dissolved" means that any duplicate (e.g. coincident) line segments or portions + of line segments will be reduced to a single line segment in the output. + This is consistent with the semantics of the + operation. + If merged linework is required, the class can be used. + Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). + + + UnaryUnion always operates on the individual components of MultiGeometries. + So it is possible to use it to "clean" invalid self-intersecting MultiPolygons + (although the polygon components must all still be individually valid.) + + + + mbdavis + + + + + Computes the geometric union of a + + A collection of geometries + The union of the geometries, + or null if the input is empty + + + + Computes the geometric union of a + If no input geometries were provided but a was provided, + an empty is returned. + + A collection of geometries + The geometry factory to use if the collection is empty + The union of the geometries + or an empty GEOMETRYCOLLECTION + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + The union of the elements of the geometry + or an empty GEOMETRYCOLLECTION + + + + Constructs a unary union operation for an enumeration + of s, using the + of the input geometries. + + An enumeration of geometries + + + + Constructs a unary union operation for an enumeration + of s. + If no input geometries were provided but a was provided, + + An enumeration of geometries + The geometry factory to use if the enumeration is empty + + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + + + + Gets the union of the input geometries. + If no input geometries were provided but a was provided, + an empty is returned. + Otherwise, the return value is null + + + A Geometry containing the union + or an empty if no geometries were provided in the input, + or null if not GeometryFactory was provided + + + + + Computes the union of two geometries, either of both of which may be null. + + + + + The union of the input(s) + or null if both inputs are null + + + + + Computes a unary union with no extra optimization, and no short-circuiting. + + + Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. + + A geometry + The union of the input geometry + + + + Experimental code to union MultiPolygons with processing limited to the elements which actually interact. + + Not currently used, since it doesn't seem to offer much of a performance advantage. + mbdavis + + + + This class tests that the interior of an area + ( or ) + is connected. An area Geometry is invalid if the interior is disconnected. + This can happen if: + - a shell self-intersects, + - one or more holes form a connected chain touching a shell at two different points, + - one or more holes form a ring around a subset of the interior. + If a disconnected situation is found the location of the problem is recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form s in graph into Minimal EdgeRings. + (Minimal Edgerings must be used, because only they are guaranteed to provide + a correct isHole computation). + + + + + + + Mark all the edges for the edgeRings corresponding to the shells of the input polygons. + Only ONE ring gets marked for each shell - if there are others which remain unmarked + this indicates a disconnected interior. + + + + + + + + + + + + + + + + + + + + Check if any shell ring has an unvisited edge. + A shell ring is a ring which is not a hole and which has the interior + of the parent area on the RHS. + (Note that there may be non-hole rings with the interior on the LHS, + since the interior of holes will also be polygonized into CW rings + by the LinkAllDirectedEdges() step). + + + true if there is an unvisited edge in a non-hole ring. + + + + + + + + + Checks that a {GeometryGraph} representing an area + (a Polygon or MultiPolygon ) + is consistent with the SFS semantics for area geometries. + Checks include: + Testing for rings which self-intersect (both properly and at nodes). + Testing for duplicate rings. + If an inconsistency if found the location of the problem is recorded. + + + + + + + + + + + Returns the intersection point, or null if none was found. + + + + + + + + + + Check all nodes to see if their labels are consistent. + If any are not, return false. + + + + + Checks for two duplicate rings in an area. + Duplicate rings are rings that are topologically equal + (that is, which have the same sequence of points up to point order). + If the area is topologically consistent (determined by calling the + isNodeConsistentArea, + duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. + (This is because topologically consistent areas cannot have two rings sharing + the same line segment, unless the rings are equal). + The start point of one of the equal rings will be placed in invalidPoint. + Returns true if this area Geometry is topologically consistent but has two duplicate rings. + + + + Tests whether any of a set of {@link LinearRing}s are + nested inside another ring in the set, using a spatial + index to speed up the comparisons. + + @version 1.7 + + + + Implements the algorithsm required to compute the + method for s. + See the documentation for the various geometry types for a specification of validity. + + + + + Checks whether a coordinate is valid for processing. + Coordinates are valid iff their x and y ordinates are in the + range of the floating point representation. + + The coordinate to validate. + true if the coordinate is valid. + + + + Find a point from the list of testCoords + that is NOT a node in the edge for the list of searchCoords. + + + + + The point found, or null if none found. + + + If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). + + + + + + + + + + + + + + + + Checks validity of a Point. + + + + + + Checks validity of a MultiPoint. + + + + + + Checks validity of a LineString. + Almost anything goes for lineStrings! + + + + + + Checks validity of a LinearRing. + + + + + + Checks the validity of a polygon and sets the validErr flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there is no ring which self-intersects (except of course at its endpoints). + This is required by OGC topology rules (but not by other models + such as ESRI SDE, which allow inverted shells and exverted holes). + + + + + + Check that a ring does not self-intersect, except at its endpoints. + Algorithm is to count the number of times each node along edge occurs. + If any occur more than once, that must be a self-intersection. + + + + + Tests that each hole is inside the polygon shell. + This routine assumes that the holes have previously been tested + to ensure that all vertices lie on the shell or inside it. + A simple test of a single point in the hole can be used, + provide the point is chosen such that it does not lie on the + boundary of the shell. + + The polygon to be tested for hole inclusion. + A GeometryGraph incorporating the polygon. + + + + Tests that no hole is nested inside another hole. + This routine assumes that the holes are disjoint. + To ensure this, holes have previously been tested + to ensure that: + They do not partially overlap + (checked by checkRelateConsistency). + They are not identical + (checked by checkRelateConsistency). + + + + + Tests that no element polygon is wholly in the interior of another element polygon. + Preconditions: + Shells do not partially overlap. + Shells do not touch along an edge. + No duplicate rings exists. + This routine relies on the fact that while polygon shells may touch at one or + more vertices, they cannot touch at ALL vertices. + + + + + Check if a shell is incorrectly nested within a polygon. This is the case + if the shell is inside the polygon shell, but not inside a polygon hole. + (If the shell is inside a polygon hole, the nesting is valid.) + The algorithm used relies on the fact that the rings must be properly contained. + E.g. they cannot partially overlap (this has been previously checked by + CheckRelateConsistency). + + + + + This routine checks to see if a shell is properly contained in a hole. + It assumes that the edges of the shell and hole do not + properly intersect. + + + + + + null if the shell is properly contained, or + a Coordinate which is not inside the hole if it is not. + + + + + + + + + + + + Gets/Sets whether polygons using Self-Touching Rings to form + holes are reported as valid. + If this flag is set, the following Self-Touching conditions + are treated as being valid: + - The shell ring self-touches to create a hole touching the shell. + - A hole ring self-touches to create two holes touching at a point. + + + The default (following the OGC SFS standard) + is that this condition is not valid (false). + + + This does not affect whether Self-Touching Rings + disconnecting the polygon interior are considered valid + (these are considered to be invalid under the SFS, and many other + spatial models as well). + This includes "bow-tie" shells, + which self-touch at a single point causing the interior to be disconnected, + and "C-shaped" holes which self-touch at a single point causing an island to be formed. + + + States whether geometry with this condition is valid. + + + + Computes the validity of the geometry, + and returns true if it is valid. + + + + + Computes the validity of the geometry, + and if not valid returns the validation error for the geometry, + or null if the geometry is valid. + + The validation error, if the geometry is invalid
+ or null if the geometry is valid
+
+ + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a Quadtree + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the appropriate checks for repeated points + (consecutive identical coordinates) as defined in the + NTS spec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a simple O(n^2) + comparison. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a SweepLineIndex + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about the nature and location of + a validation error. + + + + + Not used. + + + + + No longer used: + repeated points are considered valid as per the SFS. + + + + + Indicates that a hole of a polygon lies partially + or completely in the exterior of the shell. + + + + + Indicates that a hole lies + in the interior of another hole in the same polygon. + + + + + Indicates that the interior of a polygon is disjoint + (often caused by set of contiguous holes splitting + the polygon into two parts). + + + + + Indicates that two rings of a polygonal geometry intersect. + + + + + Indicates that a ring self-intersects. + + + + + Indicates that a polygon component of a + lies inside another polygonal component. + + + + + Indicates that a polygonal geometry + contains two rings which are identical. + + + + + Indicates that either: + - A contains a single point. + - A contains 2 or 3 points. + + + + + Indicates that the X or Y ordinate of + a is not a valid + numeric value (e.g. ). + + + + + Indicates that a ring is not correctly closed + (the first and the last coordinate are different). + + + + + Contains information about the nature and location of a Geometry + validation error. + + + + + These messages must synch up with the indexes above + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds all connected s of a . + + + + + Initializes a new instance of the class. + + The . + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + + + + + + Adds the argument node and all its out edges to the subgraph. + + + + + + + + A sorted collection of DirectedEdges which leave a Node + in a PlanarGraph. + + + + + The underlying list of outgoing DirectedEdges. + + + + + Adds a new member to this DirectedEdgeStar. + + + + + + Drops a member of this DirectedEdgeStar. + + + + + + Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the zero-based index of the given DirectedEdge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the remainder when i is divided by the number of edges in this + DirectedEdgeStar. + + + + + + + Returns the on the left-hand + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + + + Returns the on the right-hand (CW) + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + Returns the number of edges around the Node associated with this DirectedEdgeStar. + + + + + Returns the coordinate for the node at wich this star is based. + + + + + Returns the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + A node in a PlanarGraph is a location where 0 or more Edges + meet. A node is connected to each of its incident Edges via an outgoing + DirectedEdge. Some clients using a PlanarGraph may want to + subclass Node to add their own application-specific + data and methods. + + + + + Returns all Edges that connect the two nodes (which are assumed to be different). + + + + + + + + The location of this Node. + + + + + The collection of DirectedEdges that leave this Node. + + + + + Constructs a Node with the given location. + + + + + + Constructs a Node with the given location and collection of outgoing DirectedEdges. + + + + + + + Adds an outgoing DirectedEdge to this Node. + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Removes a incident on this node. Does not change the state of the directed edge. + + + + + Removes this node from its containing graph. + + + + + + + + + + + Returns the location of this Node. + + + + + Returns the collection of DirectedEdges that leave this Node. + + + + + Returns the number of edges around this Node. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + Adds a node to the map, replacing any that is already at that location. + + + The added node. + + + + Removes the Node at the given location, and returns it (or null if no Node was there). + + + + + + + Returns the Node at the given location, or null if no Node was there. + + + + + + + Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the number of Nodes in this NodeMap. + + + + + A subgraph of a . + A subgraph may contain any subset of s + from the parent graph. + It will also automatically contain all s + and s associated with those edges. + No new objects are created when edges are added - + all associated components must already exist in the parent graph. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new subgraph of the given . + + + + + + Gets the which this subgraph is part of. + + + + + + Adds an to the subgraph. + The associated s and s are also added. + + The to add. + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph. + + + + + + Tests whether an is contained in this subgraph. + + The to test. + true if the is contained in this subgraph. + + + + Determines the maximum number of common most-significant + bits in the mantissa of one or numbers. + Can be used to compute the double-precision number which + is represented by the common bits. + If there are no common bits, the number computed is 0.0. + + + + + Computes the bit pattern for the sign and exponent of a + double-precision number. + + + The bit pattern for the sign and exponent. + + + + This computes the number of common most-significant bits in the mantissas + of two double-precision numbers. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + /// + The number of common most-significant mantissa bits. + + + + Zeroes the lower n bits of a bitstring. + + The bitstring to alter. + the number of bits to zero. + The zeroed bitstring. + + + + Extracts the i'th bit of a bitstring. + + The bitstring to extract from. + The bit to extract. + The value of the extracted bit. + + + + + + + + + + A representation of the Double bits formatted for easy readability + + + + + + + + + + + + Provides versions of Geometry spatial functions which use + common bit removal to reduce the likelihood of robustness problems. + In the current implementation no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + Client classes should check the validity of the returned result themselves. + + + + + Creates a new instance of class, which reshifts result Geometrys. + + + + + Creates a new instance of class, specifying whether + the result Geometrys should be reshifted. + + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry, to be subtracted from the first. + The Geometry representing the set-theoretic difference of the input Geometries. + + + Computes the set-theoretic symmetric difference of two geometries, + using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer a point, using enhanced precision. + + The Geometry to buffer. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + If required, returning the result to the orginal precision if required. + In this current implementation, no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + + The result Geometry to modify. + The result Geometry with the required precision. + + + + Computes a copy of the input Geometry with the calculated common bits + removed from each coordinate. + + The Geometry to remove common bits from. + A copy of the input Geometry with common bits removed. + + + + Computes a copy of each input Geometrys with the calculated common bits + removed from each coordinate. + + A Geometry to remove common bits from. + A Geometry to remove common bits from. + + An array containing copies + of the input Geometry's with common bits removed. + + + + + Removes common most-significant mantissa bits + from one or more s. + + The CommonBitsRemover "scavenges" precision + which is "wasted" by a large displacement of the geometry + from the origin. + For example, if a small geometry is displaced from the origin + by a large distance, + the displacement increases the significant figures in the coordinates, + but does not affect the relative topology of the geometry. + Thus the geometry can be translated back to the origin + without affecting its topology. + In order to compute the translation without affecting + the full precision of the coordinate values, + the translation is performed at the bit level by + removing the common leading mantissa bits. + + If the geometry envelope already contains the origin, + the translation procedure cannot be applied. + In this case, the common bits value is computed as zero. + + If the geometry crosses the Y axis but not the X axis + (and mutatis mutandum), + the common bits for Y are zero, + but the common bits for X are non-zero. + + + + + Add a point to the set of geometries whose common bits are + being computed. After this method has executed the + common coordinate reflects the common bits of all added + geometries. + + A Geometry to test for common bits. + + + + Removes the common coordinate bits from a Geometry. + The coordinates of the Geometry are changed. + + The Geometry from which to remove the common coordinate bits. + The shifted Geometry. + + + + Adds the common coordinate bits back into a Geometry. + The coordinates of the Geometry are changed. + + The Geometry to which to add the common coordinate bits. + + + + The common bits of the Coordinates in the supplied Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate sequence + + + + Reduces the precision of the s in a + to match the supplied . + + + Uses . + The input is modified in-place, so + it should be cloned beforehand if the + original should not be modified. + + mbdavis + + + + Creates a new precision reducer filter. + + The PrecisionModel to use + + + + Rounds the Coordinates in the sequence to match the PrecisionModel + + + + + Always runs over all geometry components. + + + + + Always reports that the geometry has changed + + + + + Provides versions of Geometry spatial functions which use + enhanced precision techniques to reduce the likelihood of robustness problems. + + + + + Only static methods! + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic difference of the input Geometries. + + + + Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer of a Geometry, using enhanced precision. + This method should no longer be necessary, since the buffer algorithm + now is highly robust. + + The first Geometry. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + Reduces the precision of a + according to the supplied , + ensuring that the result is topologically valid. + + + + + Convenience method for doing precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + and preserving polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Convenience method for doing pointwise precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + but NOT preserving valid polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Duplicates a geometry to one that uses a different PrecisionModel, + without changing any coordinate values. + + The geometry to duplicate + The precision model to use + The geometry value with a new precision model + + + Gets or sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + The default is to remove collapsed components. + + + + + /// Gets or sets whether the of the new reduced Geometry + will be changed to be the supplied to + specify the precision reduction. + + The default is to not change the precision model + + + + + Gets or sets whether the precision reduction will be done + in pointwise fashion only. + Pointwise precision reduction reduces the precision + of the individual coordinates only, but does + not attempt to recreate valid topology. + This is only relevant for geometries containing polygonal components. + + + + + Computes the Minimum Clearance of a . + + The Minimum Clearance is a measure of + what magnitude of perturbation of + the vertices of a geometry can be tolerated + before the geometry becomes topologically invalid. + The smaller the Minimum Clearance distance, + the less vertex pertubation the geometry can tolerate + before becoming invalid. + + + The concept was introduced by Thompson and Van Oosterom + [TV06], based on earlier work by Milenkovic [Mi88]. + + The Minimum Clearance of a geometry G + is defined to be the value r + such that "the movement of all points by a distance + of r in any direction will + guarantee to leave the geometry valid" [TV06]. + An equivalent constructive definition [Mi88] is that + r is the largest value such: + + No two distinct vertices of G are closer than r. + No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint + + The following image shows an example of the Minimum Clearance + of a simple polygon. + +
+ + If G has only a single vertex (i.e. is a + ), the value of the minimum clearance + is . + + If G is a or geometry, + then in fact no amount of perturbation + will render the geometry invalid. + In this case a Minimum Clearance is still computed + based on the vertex and segment distances + according to the constructive definition. + + It is possible for no Minimum Clearance to exist. + For instance, a with all members identical + has no Minimum Clearance + (i.e. no amount of perturbation will cause + the member points to become non-identical). + Empty geometries also have no such distance. + The lack of a meaningful MinimumClearance distance is detected + and suitable values are returned by + and . + + The computation of Minimum Clearance utilizes + the + method to provide good performance even for + large inputs. + + An interesting note is that for the case of s, + the computed Minimum Clearance line + effectively determines the Nearest Neighbours in the collection. +

References

+ + [Mi88] Milenkovic, V. J., + Verifiable implementations of geometric algorithms + using finite precision arithmetic. + in Artificial Intelligence, 377-401. 1988 + [TV06] Thompson, Rod and van Oosterom, Peter, + Interchange of Spatial Data-Inhibiting Factors, + Agile 2006, Visegrad, Hungary. 2006 + +
+ /// Martin Davis +
+ + + Computes the Minimum Clearance distance for + the given Geometry. + + The input geometry + The minimum clearance + + + + Gets a LineString containing two points + which are at the Minimum Clearance distance + for the given Geometry. + + The input geometry + The value of the minimum clearance distance
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + Creates an object to compute the Minimum Clearance for the given Geometry + + The input geometry + + + + Gets the Minimum Clearance distance. + If no distance exists + (e.g. in the case of two identical points) + is returned. + + + The value of the minimum clearance distance
+ or if no Minimum Clearance distance exists +
+
+ + + Gets a LineString containing two points + which are at the Minimum Clearance distance. + If no distance could be found + (e.g. in the case of two identical points) + LINESTRING EMPTY is returned. + + The value of the minimum clearance distance,
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + + Reduces the precision of the coordinates of a Geometry + according to the supplied {PrecisionModel}, without + attempting to preserve valid topology. + + + In case of geometries, + the topology of the resulting geometry may be invalid if + topological collapse occurs due to coordinates being shifted. + It is up to the client to check this and handle it if necessary. + Collapses may not matter for some uses. An example + is simplifying the input to the buffer algorithm. + The buffer algorithm does not depend on the validity of the input point. + + + + + Convenience method for doing precision reduction on a single geometry, + with collapses removed and keeping the geometry precision model the same. + + The reduced geometry + + + + + + + + + + + + + + + + + Sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + + + + + Gets/Sets whether the PrecisionModel of the new reduced Geometry + will be changed to be the PrecisionModel supplied to + specify the precision reduction. + The default is to not change the precision model. + + + + + + + + + + + + + + + + + + + + + + + + Computes the minimum clearance of a geometry or + set of geometries. + The Minimum Clearance is a measure of + what magnitude of perturbation of its vertices can be tolerated + by a geometry before it becomes topologically invalid. + + This class uses an inefficient O(N^2) scan. + It is primarily for testing purposes. + + + Martin Davis + + + + Gets or sets the total number of points in the created . + The created geometry will have no more than this number of points, + unless more are needed to create a valid geometry. + + + + + The height of an equilateral triangle of side one + + + + + Creates random point sets contained in a + region defined by either a rectangular or a polygonal extent. + + mbdavis + + + + Create a shape factory which will create shapes using the default + . + + + + + Create a shape factory which will create shapes using the given + + + The factory to use + + + + Sets a polygonal mask. + + if the mask is not polygonal + + + + Creates random point sets where the points + are constrained to lie in the cells of a grid. + + mbdavis + + + + Create a builder which will create shapes using the default + . + + + + + Create a builder which will create shapes using the given + . + + The factory to use + + + + Gets the containing the generated point + + A MultiPoint + + + + Gets or sets whether generated points are constrained to lie + within a circle contained within each grid cell. + This provides greater separation between points + in adjacent cells. + + The default is to not be constrained to a circle. + + + + + Gets or sets the fraction of the grid cell side which will be treated as + a gutter, in which no points will be created. + + The provided value is clamped to the range [0.0, 1.0]. + + + + + Simplifies a line (sequence of points) using + the standard Douglas-Peucker algorithm. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a using the Douglas-Peucker algorithm. + + + Ensures that any polygonal geometries returned are valid. + Simple lines are not guaranteed to remain simple after simplification. + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + Note that in general D-P does not preserve topology - + e.g. polygons can be split, collapse to lines or disappear + holes can be created or disappear, + and lines can cross. + To simplify point while preserving topology use TopologySafeSimplifier. + (However, using D-P is significantly faster). + + KNOWN BUGS: + In some cases the approach used to clean invalid simplified polygons + can distort the output geometry severely. + + + + + + Simplifies a geometry using a given tolerance. + + The geometry to simplify. + The tolerance to use. + A simplified version of the geometry. + + + + Creates a simplifier for a given geometry. + + The geometry to simplify. + + + + Gets the simplified geometry. + + The simplified geometry. + + + + The distance tolerance for the simplification. + + + All vertices in the simplified geometry will be within this + distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" + to have valid topology. + + + The caller may choose to disable this because: + + valid topology is not required + fixing topology is a relative expensive operation + in some pathological cases the topology fixing operation may either fail or run for too long + + The default is to fix polygon topology. + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a polygon, fixing it if required. + + + + + + + + Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. + + null if the simplification results in a degenerate ring + + + + + + + + + + + + Creates a valid area point from one that possibly has + bad topology (i.e. self-intersections). + Since buffer can handle invalid topology, but always returns + valid point, constructing a 0-width buffer "corrects" the + topology. + Note this only works for area geometries, since buffer always returns + areas. This also may return empty geometries, if the input + has no actual area. + + An area point possibly containing self-intersections. + A valid area point. + + + + An index of LineSegments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemVisitor subclass to reduce volume of query results. + + + + + + + + + + + + + + + + + + + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + A LineSegment which is tagged with its location in a Geometry. + Used to index the segments in a point and recover the segment locations + from the index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a collection of TaggedLineStrings, preserving topology + (in the sense that no new intersections are introduced). + This class is essentially just a container for the common + indexes used by . + + + + + Simplifies a collection of TaggedLineStrings. + + The collection of lines to simplify. + + + + Gets or sets the distance tolerance for the simplification.
+ Points closer than this tolerance to a simplified segment may + be removed. +
+
+ + + Represents a which can be modified to a simplified shape. + This class provides an attribute which specifies the minimum allowable length + for the modified result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a TaggedLineString, preserving topology + (in the sense that no new intersections are introduced). + Uses the recursive Douglas-Peucker algorithm. + + + + + Simplifies the given + using the distance tolerance specified. + + The linestring to simplify. + + + + Flattens a section of the line between + indexes and , + replacing them with a line between the endpoints. + The input and output indexes are updated + to reflect this. + + The start index of the flattened section. + The end index of the flattened section. + The new segment created. + + + + Tests whether a segment is in a section of a . + + + + + + + + + Remove the segs in the section of the line. + + + + + + + + Sets the distance tolerance for the simplification. + All vertices in the simplified geometry will be within this + distance of the original geometry. + + + + + Simplifies a point and ensures that + the result is a valid point having the + same dimension and number of components as the input, + and with the components having the same topological + relationship. + + If the input is a polygonal geometry + ( or ): + + The result has the same number of shells and holes as the input, + with the same topological structure + The result rings touch at no more than the number of touching points in the input + (although they may touch at fewer points). + The key implication of this statement is that if the + input is topologically valid, so is the simplified output. + + For linear geometries, if the input does not contain + any intersecting line segments, this property + will be preserved in the output. + + For all geometry types, the result will contain + enough vertices to ensure validity. For polygons + and closed linear geometries, the result will have at + least 4 vertices; for open linestrings the result + will have at least 2 vertices. + + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + The simplification uses a maximum-distance difference algorithm + similar to the Douglas-Peucker algorithm. + + +

KNOWN BUGS

+ + May create invalid topology if there are components which are small + relative to the tolerance value. + In particular, if a small hole is very near an edge, + it is possible for the edge to be moved by a relatively large tolerance value + and end up with the hole outside the result shell (or inside another hole). + Similarly, it is possible for a small polygon component to end up inside + a nearby larger polygon. + A workaround is to test for this situation in post-processing and remove + any invalid holes or polygons. + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A filter to add linear geometries to the linestring map + with the appropriate minimum size constraint. + Closed s (including s + have a minimum output size constraint of 4, + to ensure the output is valid. + For all other linestrings, the minimum size is 2 points. + + Martin Davis + + + + Filters linear geometries. + + A geometry of any type + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a using the Visvalingam-Whyatt area-based algorithm. + Ensures that any polygonal geometries returned are valid. Simple lines are not + guaranteed to remain simple after simplification. All geometry types are + handled. Empty and point geometries are returned unchanged. Empty geometry + components are deleted. + The simplification tolerance is specified as a distance. + This is converted to an area tolerance by squaring it. + + Known Bugs + * Not yet optimized for performance. + * Does not simplify the endpoint of rings. + To Do + * Allow specifying desired number of vertices in the output. + + + + Note that in general this algorithm does not preserve topology - e.g. polygons can be split, + collapse to lines or disappear holes can be created or disappear, and lines + can cross. + + 1.7 + + + + Simplifies a using a given tolerance. + + The to simplify. + The tolerance to use. + A simplified version of the . + + + + Creates a simplifier for a given . + + The to simplify. + + + + Gets the semplified . + + The semplified . + + + + Sets the distance tolerance for the simplification. All vertices in the + simplified will be within this distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" to have valid + topology. The caller may choose to disable this because: + * valid topology is not required. + * fixing topology is a relative expensive operation. + * in some pathological cases the topology fixing operation may either + fail or run for too long. + + The default is to fix polygon topology. + + + + Simplifies a , fixing it if required. + + + + + + + + Simplifies a . If the simplification results in a degenerate + ring, remove the component. + + + + null if the simplification results in a degenerate ring. + + + + Simplifies a , fixing it if required. + + + + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections. + A valid area geometry. + + + + A utility class which creates Conforming Delaunay Trianglulations + from collections of points and linear constraints, and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Sets the sites (point or vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + The site vertices do not have to contain the constraint + vertices as well; any site vertices which are + identical to a constraint vertex will be removed + from the site vertex set. + + The geometry from which the sites will be extracted. + + + + Gets the QuadEdgeSubdivision which models the computed triangulation. + + The subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + The geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the linear constraints to be conformed to. + All linear components in the input will be used as constraints. + The constraint vertices do not have to be disjoint from + the site vertices. + The constraints must not contain duplicate segments (up to orientation). + + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + + Creates a Conforming Delaunay Triangulation based on the given + unconstrained initial vertices. The initial vertex set should not contain + any vertices which appear in the constraint set. + + a collection of + the distance tolerance below which points are considered identical + + + + Sets the constraints to be conformed to by the computed triangulation. + The constraints must not contain duplicate segments (up to orientation). + The unique set of vertices (as es) + forming the constraints must also be supplied. + Supplying it explicitly allows the ConstraintVertexes to be initialized + appropriately(e.g. with external data), and avoids re-computing the unique set + if it is already available. + + list of the constraint {@link Segment}s + the set of unique es referenced by the segments + + + + Creates a vertex on a constraint segment + + the location of the vertex to create + the constraint segment it lies on + the new constraint vertex + + + + Inserts all sites in a collection + + a collection of ConstraintVertex + + + + Inserts a site into the triangulation, maintaining the conformal Delaunay property. + This can be used to further refine the triangulation if required + (e.g. to approximate the medial axis of the constraints, + or to improve the grading of the triangulation). + + the location of the site to insert + + + + Computes the Delaunay triangulation of the initial sites. + + + + + Enforces the supplied constraints into the triangulation. + + + if the constraints cannot be enforced + + + + Given a set of points stored in the kd-tree and a line segment defined by + two points in this set, finds a in the circumcircle of + the line segment, if one exists. This is called the Gabriel point - if none + exists then the segment is said to have the Gabriel condition. Uses the + heuristic of finding the non-Gabriel point closest to the midpoint of the + segment. + + the line segment + + A point which is non-Gabriel, + or null if no point is non-Gabriel + + + + + Gets or sets the to be + used during constraint enforcement. + Different splitting strategies may be appropriate + for special situations. + + the ConstraintSplitPointFinder to be used + + + + Gets the tolerance value used to construct the triangulation. + + a tolerance value + + + + Gets and sets the used to create new constraint vertices at split points. + + Allows the setting of a custom {@link ConstraintVertexFactory} to be used + to allow vertices carrying extra information to be created. + + + + + Gets the which represents the triangulation. + + + + + Gets the which contains the vertices of the triangulation. + + + + + Gets the sites (vertices) used to initialize the triangulation. + + + + + Gets the s which represent the constraints. + + + + + Gets the convex hull of all the sites in the triangulation, + including constraint vertices. + Only valid after the constraints have been enforced. + + the convex hull of the sites + + + + Indicates a failure during constraint enforcement. + + Martin Davis + 1.0 + + + + Creates a new instance with a given message. + + a string + + + + Creates a new instance with a given message and approximate location. + + a string + the location of the error + + + + Gets the approximate location of this error. + + a location + + + + An interface for strategies for determining the location of split points on constraint segments. + The location of split points has a large effect on the performance and robustness of enforcing a + constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, + especially at narrow constraint angles, since the split point will end up encroaching on the + segment containing the original encroaching point. With detailed knowledge of the geometry of the + constraints, it is sometimes possible to choose better locations for splitting. + + mbdavis + + + + Finds a point at which to split an encroached segment to allow the original segment to appear + as edges in a constrained Delaunay triangulation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + A vertex in a Constrained Delaunay Triangulation. + The vertex may or may not lie on a constraint. + If it does it may carry extra information about the original constraint. + + Martin Davis + + + + Models a site (node) in a . + The sites can be points on a line string representing a + linear site. + The vertex can be considered as a vector with a norm, length, inner product, cross + product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle + defined by this point and two others, etc.) are also defined in this class. + + It is common to want to attach user-defined data to + the vertices of a subdivision. + One way to do this is to subclass Vertex + to carry any desired information. + + David Skea + Martin Davis + + + + Creates an instance of this class using the given x- and y-ordinate valuse + + x-ordinate value + y-ordinate value + + + + Creates an instance of this class using the given x-, y- and z-ordinate values + + x-ordinate value + y-ordinate value + z-ordinate value + + + + Creates an instance of this class using a clone of the given . + + The coordinate + + + + Computes the cross product k = u X v. + + a vertex + returns the magnitude of u X v + + + + Computes the inner or dot product + + A vertex + The dot product u.v + + + + Computes the scalar product c(v) + + A vertex + The scaled vector + + + + Tests if this is inside the circle defined by the points a, b, c. This test uses simple + double-precision arithmetic, and thus may not be robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + true if this vertex is inside the circumcircle (a, b, c) + + + + Tests whether the triangle formed by this vertex and two + other vertices is in CCW orientation. + + a vertex + a vertex + true if the triangle is oriented CCW + + + + Computes the value of the ratio of the circumradius to shortest edge. If smaller than some + given tolerance B, the associated triangle is considered skinny. For an equal lateral + triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: + circumRadius/shortestEdge = 1/(2sin(theta)). + + second vertex of the triangle + third vertex of the triangle + ratio of circumradius to shortest edge. + + + + returns a new vertex that is mid-way between this vertex and another end point. + + the other end point. + the point mid-way between this and that. + + + + Computes the centre of the circumcircle of this vertex and two others. + + + + the Coordinate which is the circumcircle of the 3 points. + + + + For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate + a z value from the surrounding vertices. + + + + + Interpolates the Z-value (height) of a point enclosed in a triangle + whose vertices all have Z values. + The containing triangle must not be degenerate + (in other words, the three vertices must enclose a + non-zero area). + + The point to interpolate the Z value of + A vertex of a triangle containing the + A vertex of a triangle containing the + A vertex of a triangle containing the + The interpolated Z-value (height) of the point + + + + Computes the interpolated Z-value for a point p lying on the segment p0-p1 + + The point to interpolate the Z value of + A vertex of the segment is lying on + A vertex of the segment is lying on + The interpolated Z-value (height) of the point + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + Gets the z-ordinate value + + + + + Gets the coordinate + + + + + Creates a new constraint vertex + + the location of the vertex + + + + Merges the constraint data in the vertex other into this vertex. + This method is called when an inserted vertex is + very close to an existing vertex in the triangulation. + + the constraint vertex to merge + + + + Gets or sets whether this vertex lies on a constraint. + + true if the vertex lies on a constraint + + + + Gets or sets the external constraint object + + object which carries information about the constraint this vertex lies on + + + + An interface for factories which create a {@link ConstraintVertex} + + Martin Davis + + + + A utility class which creates Delaunay Trianglulations + from collections of points and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Extracts the unique s from the given . + + the geometry to extract from + a List of the unique Coordinates + + + + Converts all s in a collection to es. + + the coordinates to convert + a List of Vertex objects + + + + Computes the of a collection of s. + + a List of Coordinates + the envelope of the set of coordinates + + + + Sets the sites (vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + + the geometry from which the sites will be extracted. + + + + Sets the sites (vertices) which will be triangulated + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed triangulation. + + the subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + the geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + Computes a Delauanay Triangulation of a set of es, using an + incrementatal insertion algorithm. + + Martin Davis + 1.0 + + + + Creates a new triangulator using the given . + The triangulator uses the tolerance of the supplied subdivision. + + a subdivision in which to build the TIN + + + + Inserts all sites in a collection. The inserted vertices MUST be + unique up to the provided tolerance value. (i.e. no two vertices should be + closer than the provided tolerance value). They do not have to be rounded + to the tolerance grid, however. + + a Collection of Vertex + if the location algorithm fails to converge in a reasonable number of iterations + + + + Inserts a new point into a subdivision representing a Delaunay + triangulation, and fixes the affected edges so that the result is still a + Delaunay triangulation. + + a quadedge containing the inserted vertex + + + + A simple split point finder which returns the midpoint of the split segment. This is a default + strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. + Other points which could be used are: +
    +
  • The projection of the encroaching point on the segment
  • +
  • A point on the segment which will produce two segments which will not be further encroached
  • +
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • + point +
+
+ Martin Davis +
+ + + Gets the midpoint of the split segment + + + + + A strategy for finding constraint split points which attempts to maximise the length of the split + segments while preventing further encroachment. (This is not always possible for narrow angles). + + Martin Davis + + + + A basic strategy for finding split points when nothing extra is known about the geometry of + the situation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a split point which is the projection of the encroaching point on the segment + + The segment + The enchroaching point + A split point on the segment + + + + A framework to visit sets of edge-connected s in breadth-first order + + Martin Davis + 1.0 + + + + Called to initialize the traversal queue with a given set of s + + a collection of QuadEdgeTriangle + + + + Subclasses call this method to perform the visiting process. + + + + + An interface for classes which locate an edge in a + which either contains a given V + or is an edge of a triangle which contains V. + Implementors may utilized different strategies for + optimizing locating containing edges/triangles. + + Martin Davis + + + + Interface for classes which process triangles visited during travesals of a + + + Martin Davis + + + + Visits a triangle during a traversal of a . An implementation of + this method may perform processing on the current triangle. It must also decide whether a + neighbouring triangle should be added to the queue so its neighbours are visited. Often it + will perform processing on the neighbour triangle as well, in order to mark it as processed + (visited) and/or to determine if it should be visited. Note that choosing not to + visit the neighbouring triangle is the terminating condition for many traversal algorithms. + In particular, if the neighbour triangle has already been visited, it should not be visited + again. + + the current triangle being processed + the index of the edge in the current triangle being traversed + a neighbouring triangle next in line to visit + true if the neighbour triangle should be visited + + + + An interface for algorithms which process the triangles in a . + + Martin Davis + 1.0 + + + + + Locates s in a , + optimizing the search by starting in the + locality of the last edge found. + + Martin Davis + + + + Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. + The search starts from the last located edge amd proceeds on the general direction of v. + + + + + A class that represents the edge data structure which implements the quadedge algebra. + The quadedge algebra was described in a well-known paper by Guibas and Stolfi, + "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", + ACM Transactions on Graphics, 4(2), 1985, 75-123. + + Each edge object is part of a quartet of 4 edges, + linked via their Rot references. + Any edge in the group may be accessed using a series of operations. + Quadedges in a subdivision are linked together via their Next references. + The linkage between the quadedge quartets determines the topology + of the subdivision. + + + The edge class does not contain separate information for vertice or faces; a vertex is implicitly + defined as a ring of edges (created using the Next field). + + + David Skea + Martin Davis + + + + Creates a new QuadEdge quartet from o to d. + + the origin Vertex + the destination Vertex + the new QuadEdge quartet + + + + Creates a new QuadEdge connecting the destination of a to the origin of + b, in such a way that all three have the same left face after the + connection is complete. Additionally, the data pointers of the new edge + are set. + + the connected edge + + + + Splices two edges together or apart. + Splice affects the two edge rings around the origins of a and b, and, independently, the two + edge rings around the left faces of a and b. + In each case, (i) if the two rings are distinct, + Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it + into two separate pieces. Thus, Splice can be used both to attach the two edges together, and + to break them apart. + + an edge to splice + an edge to splice + + + + Turns an edge counterclockwise inside its enclosing quadrilateral. + + the quadedge to turn + + + + Quadedges must be made using {@link makeEdge}, + to ensure proper construction. + + + + + Gets the primary edge of this quadedge and its sym. + The primary edge is the one for which the origin + and destination coordinates are ordered + according to the standard ordering + + the primary quadedge + + + + Marks this quadedge as being deleted. + This does not free the memory used by + this quadedge quartet, but indicates + that this edge no longer participates + in a subdivision. + + + + + Sets the connected edge + + edge + + + + Tests if this quadedge and another have the same line segment geometry, + regardless of orientation. + + a quadege + true if the quadedges are based on the same line segment regardless of orientation + + + + Tests if this quadedge and another have the same line segment geometry + with the same orientation. + + a quadege + true if the quadedges are based on the same line segment + + + + Creates a representing the + geometry of this edge. + + a LineSegment + + + + Converts this edge to a WKT two-point LINESTRING indicating + the geometry of this edge. + + a String representing this edge's geometry + + + + Gets or sets the external data value for this edge. + + + an object containing external data + + + + + Tests whether this edge has been deleted. + + true if this edge has not been deleted. + + + + Gets the dual of this edge, directed from its right to its left. + + Gets or Sets the rotated edge + + + + Gets the dual of this edge, directed from its left to its right. + + Gets the inverse rotated edge. + + + + Gets the edge from the destination to the origin of this edge. + + Gets the sym of the edge. + + + + Gets the next CCW edge around the origin of this edge. + + Gets the next linked edge. + + + + Gets the next CW edge around (from) the origin of this edge. + + Gets the previous edge. + + + + Gets the next CCW edge around (into) the destination of this edge. + + Get the next destination edge. + + + + Gets the next CW edge around (into) the destination of this edge. + + Get the previous destination edge. + + + + Gets the CCW edge around the left face following this edge. + + Gets the next left face edge. + + + + Gets the CCW edge around the left face before this edge. + + Get the previous left face edge. + + + + Gets the edge around the right face ccw following this edge. + + Gets the next right face edge. + + + + Gets the edge around the right face ccw before this edge. + + Gets the previous right face edge. + + + + Gets or sets the vertex for the edge's origin + + Gets the origin vertex + + + + Gets or sets the vertex for the edge's destination + + Gets the destination vertex + + + + Gets the length of the geometry of this quadedge. + + Gets the length of the quadedge + + + + A class that contains the s representing a planar + subdivision that models a triangulation. + The subdivision is constructed using the + quadedge algebra defined in the classs . + All metric calculations + are done in the class. + In addition to a triangulation, subdivisions + support extraction of Voronoi diagrams. + This is easily accomplished, since the Voronoi diagram is the dual + of the Delaunay triangulation. + + Subdivisions can be provided with a tolerance value. Inserted vertices which + are closer than this value to vertices already in the subdivision will be + ignored. Using a suitable tolerance value can prevent robustness failures + from happening during Delaunay triangulation. + + + Subdivisions maintain a frame triangle around the client-created + edges. The frame is used to provide a bounded "container" for all edges + within a TIN. Normally the frame edges, frame connecting edges, and frame + triangles are not included in client processing. + + + David Skea + Martin Davis + + + + Gets the edges for the triangle to the left of the given . + + + + if the edges do not form a triangle + + + + Creates a new instance of a quad-edge subdivision based on a frame triangle + that encloses a supplied bounding box. A new super-bounding box that + contains the triangle is computed and stored. + + the bouding box to surround + the tolerance value for determining if two sites are equal + + + + Gets the collection of base s (one for every pair of + vertices which is connected). + + a collection of QuadEdges + + + + Sets the to use for locating containing triangles + in this subdivision. + + a QuadEdgeLocator + + + + Creates a new quadedge, recording it in the edges list. + + The origin vertex + The destination vertex + A new quadedge + + + + Creates a new QuadEdge connecting the destination of a to the origin of b, + in such a way that all three have the same left face after the connection + is complete. The quadedge is recorded in the edges list. + + A quadedge + A quadedge + A quadedge + + + + Deletes a quadedge from the subdivision. Linked quadedges are updated to + reflect the deletion. + + the quadedge to delete + + + + Locates an edge of a triangle which contains a location + specified by a Vertex v. + The edge returned has the + property that either v is on e, or e is an edge of a triangle containing v. + The search starts from startEdge amd proceeds on the general direction of v. + + + This locate algorithm relies on the subdivision being Delaunay. For + non-Delaunay subdivisions, this may loop for ever. + + the location to search for + an edge of the subdivision to start searching at + a QuadEdge which contains v, or is on the edge of a triangle containing v + + if the location algorithm fails to converge in a reasonable + number of iterations + + + + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the vertex to locate + a quadedge on the edge of a triangle which touches or contains the location
+ or null if no such triangle exists +
+
+ + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the Coordinate to locate + a quadedge on the edge of a triangle which touches or contains the location, + or null if no such triangle exists + + + + + Locates the edge between the given vertices, if it exists in the + subdivision. + + a coordinate + another coordinate + the edge joining the coordinates, if present, + or null if no such edge exists + + + + + Inserts a new site into the Subdivision, connecting it to the vertices of + the containing triangle (or quadrilateral, if the split point falls on an + existing edge). + + + + This method does NOT maintain the Delaunay condition. If desired, this must + be checked and enforced by the caller. + + + This method does NOT check if the inserted vertex falls on an edge. This + must be checked by the caller, since this situation may cause erroneous + triangulation + + + the vertex to insert + a new quad edge terminating in v + + + + Tests whether a QuadEdge is an edge incident on a frame triangle vertex. + + the edge to test + true if the edge is connected to the frame triangle + + + + Tests whether a QuadEdge is an edge on the border of the frame facets and + the internal facets. E.g. an edge which does not itself touch a frame + vertex, but which touches an edge which does. + + the edge to test + true if the edge is on the border of the frame + + + + Tests whether a vertex is a vertex of the outer triangle. + + the vertex to test + true if the vertex is an outer triangle vertex + + + + Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a + tolerance determined by the subdivision tolerance. + + a QuadEdge + a point + true if the vertex lies on the edge + + + + Tests whether a is the start or end vertex of a + , up to the subdivision tolerance distance. + + + + true if the vertex is a endpoint of the edge + + + + Gets the unique es in the subdivision, + including the frame vertices if desired. + + true if the frame vertices should be included + a collection of the subdivision vertices + + + + + Gets a collection of s whose origin + vertices are a unique set which includes + all vertices in the subdivision. + The frame vertices can be included if required. + + + This is useful for algorithms which require traversing the + subdivision starting at all vertices. + Returning a quadedge for each vertex + is more efficient than + the alternative of finding the actual vertices + using and then locating + quadedges attached to them. + + true if the frame vertices should be included + a collection of QuadEdge with the vertices of the subdivision as their origins + + + + Gets all primary quadedges in the subdivision. + A primary edge is a + which occupies the 0'th position in its array of associated quadedges. + These provide the unique geometric edges of the triangulation. + + true if the frame edges are to be included + a List of QuadEdges + + + + The quadedges forming a single triangle. + Only one visitor is allowed to be active at a + time, so this is safe. + + + + + Stores the edges for a visited triangle. Also pushes sym (neighbour) edges + on stack to visit later. + + + + + + the visited triangle edges,
+ or null if the triangle should not be visited (for instance, if it is outer) +
+
+ + + Gets a list of the triangles + in the subdivision, specified as + an array of the primary quadedges around the triangle. + + true if the frame triangles should be included + a List of QuadEdge[3] arrays + + + + Gets a list of the triangles in the subdivision, + specified as an array of the triangle es. + + true if the frame triangles should be included + a List of Vertex[3] arrays + + + + Gets the coordinates for each triangle in the subdivision as an array. + + true if the frame triangles should be included + a list of Coordinate[4] representing each triangle + + + + Gets the geometry for the edges in the subdivision as a + containing 2-point lines. + + the GeometryFactory to use + a IMultiLineString + + + + Gets the geometry for the triangles in a triangulated subdivision as a + of triangular s. + + the GeometryFactory to use + a GeometryCollection of triangular Polygons + + + + Gets the cells in the Voronoi diagram for this triangulation. + The cells are returned as a of s + + + The userData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a GeometryCollection of Polygons + + + + Gets a List of s for the Voronoi cells + of this triangulation. + + + The UserData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a List of Polygons + + + + Gets the Voronoi cell around a site specified + by the origin of a QuadEdge. + + + The userData of the polygon is set to be the + of the site. This allows attaching external + data associated with the site to this cell polygon. + + a quadedge originating at the cell site + a factory for building the polygon + a polygon indicating the cell extent + + + + Gets the vertex-equality tolerance value + used in this subdivision + + Gets the tolerance value + + + + Gets the envelope of the Subdivision (including the frame). + + Gets the envelope + + + + A TriangleVisitor which computes and sets the + circumcentre as the origin of the dual + edges originating in each triangle. + + mbdavis + + + + Models a triangle formed from s in a + which forms a triangulation. The class provides methods to access the + topological and geometric properties of the triangle and its neighbours in + the triangulation. Triangle vertices are ordered in CCW orientation in the + structure. + + + QuadEdgeTriangles support having an external data attribute attached to them. + Alternatively, this class can be subclassed and attributes can + be defined in the subclass. Subclasses will need to define + their own BuilderVisitor class + and CreateOn method. + + Martin Davis + 1.0 + + + + Creates s for all facets of a + representing a triangulation. + The data attributes of the s in the subdivision + will be set to point to the triangle which contains that edge. + This allows tracing the neighbour triangles of any given triangle. + + The QuadEdgeSubdivision to create the triangles on. + A List of the created QuadEdgeTriangles + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 Vertexes + the point to test + true if the point is contained in the triangle + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 QuadEdges + the point to test + true if the point is contained in the triangle + + + + Creates a new triangle from the given edges. + + An array of the edges of the triangle in CCW order + + + + Gets the vertices for this triangle. + + a new array containing the triangle vertices + + + + Gets the index for the given edge of this triangle + + a QuadEdge + the index of the edge in this triangle,
+ or -1 if the edge is not an edge of this triangle +
+
+ + + Gets the index for the edge that starts at vertex v. + + the vertex to find the edge for + the index of the edge starting at the vertex,
+ or -1 if the vertex is not in the triangle +
+
+ + + Tests whether this triangle is adjacent to the outside of the subdivision. + + true if the triangle is adjacent to the subdivision exterior + + + + Gets the triangles which are adjacent (include) to a + given vertex of this triangle. + + The vertex to query + A list of the vertex-adjacent triangles + + + + Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is + null + + an array containing the 3 neighbours of this triangle + + + + Gets or sets the external data value for this triangle. + + + + + Gets all edges which are incident on the origin of the given edge. + + the edge to start at + a List of edges which have their origin at the origin of the given + edge + + + + Algorithms for computing values and predicates + associated with triangles. + + + For some algorithms extended-precision + implementations are provided, which are more robust + (i.e. they produce correct answers in more cases). + Also, some more robust formulations of + some algorithms are provided, which utilize + normalization to the origin. + + Martin Davis + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + However, by using normalization to the origin + it provides improved robustness and increased performance. + Based on code by J.R.Shewchuk. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the + triangle is oriented counterclockwise. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This method uses more robust computation. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness, but a faster approach. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + a vertex of the triangle + a vertex of the triangle + a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + + + + + + + + + + + Computes the inCircle test using distance from the circumcentre. + Uses standard double-precision arithmetic. + + + In general this doesn't + appear to be any more robust than the standard calculation. However, there + is at least one case where the test point is far enough from the + circumcircle that this test gives the correct answer. +
+            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
+            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
+            
+
+ A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + The area of a triangle defined by the points a, b and c +
+ + + Checks if the computed value for isInCircle is correct, using + double-double precision arithmetic. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + + + + + Creates a new instance for the given ordinates. + + + + + Creates a new instance for the given ordinates, with associated external data. + + + + + Creates a new instance for the given points, with associated external data. + + the start point + the end point + an external data object + + + + Creates a new instance for the given points. + + the start point + the end point + + + + Determines whether two segments are topologically equal. + I.e. equal up to orientation. + + a segment + true if the segments are topologically equal + + + + Computes the intersection point between this segment and another one. + + a segment + the intersection point, or null if there is none + + + + Computes a string representation of this segment. + + a string + + + + Gets the start coordinate of the segment + + a Coordinate + + + + Gets the end coordinate of the segment + + a Coordinate + + + + Gets the start X ordinate of the segment + + the X ordinate value + + + + Gets the start Y ordinate of the segment + + the Y ordinate value + + + + Gets the start Z ordinate of the segment + + the Z ordinate value + + + + Gets the end X ordinate of the segment + + the X ordinate value + + + + Gets the end Y ordinate of the segment + + he Y ordinate value + + + + Gets the end Z ordinate of the segment + + the Z ordinate value + + + + Gets a LineSegment modelling this segment. + + a LineSegment + + + + Gets or sets the external data associated with this segment + + a data object + + + + Models a constraint segment which can be split in two in various ways, + according to certain geometric constraints. + + Martin Davis + + + + Computes the {@link Coordinate} that lies a given fraction along the line defined by the + reverse of the given segment. A fraction of 0.0 returns the end point of the + segment; a fraction of 1.0 returns the start point of the segment. + + the LineSegment + the fraction of the segment length along the line + the point at that distance + + + + Creates a map between the vertex s of a + set of s, + and the parent geometry, and transfers the source geometry + data objects to geometry components tagged with the coordinates. + + + This class can be used in conjunction with + to transfer data objects from the input site geometries + to the constructed Voronoi polygons. + + Martin Davis + + + + + Input is assumed to be a multiGeometry + in which every component has its userData + set to be a Coordinate which is the key to the output data. + The Coordinate is used to determine + the output data object to be written back into the component. + + + + + + A utility class which creates Voronoi Diagrams + from collections of points. + The diagram is returned as a of s, + representing the faces of the Voronoi diagram. + /// The faces are clipped to the larger of: + + + an envelope supplied by . + + + an envelope determined by the input sites. + + + The userData attribute of each face Polygon is set to + the Coordinate of the corresponding input site. + This allows using a Map to link faces to data associated with sites. + + Martin Davis + + + + Sets the sites (point or vertices) which will be diagrammed. + All vertices of the given geometry will be used as sites. + + geom the geometry from which the sites will be extracted. + + + + Sets the sites (point or vertices) which will be diagrammed + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed diagram. + + the subdivision containing the triangulation + + + + Gets the faces of the computed diagram as a + of s, clipped as specified. + + The attribute of each face is set to + the Coordinate of the corresponding input site. + This allows using a to link faces to data associated with sites. + + the geometry factory to use to create the output + a containg the face s of the diagram + + + + Sets the envelope to clip the diagram to. + The diagram will be clipped to the larger + of this envelope or an envelope surrounding the sites. + + the clip envelope. + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + tolerance the tolerance distance to use + + + + An alternative implementation of the priority queue abstract data type. + This allows us to do more than , which we + got from JTS. Ultimately, this queue enables scenarios that have more + favorable execution speed characteristics at the cost of less favorable + memory and usability characteristics. + + + The type of the priority for each queue node. + + + The type of data stored in the queue. + + + When enumerating over the queue, note that the elements will not be in + sorted order. To get at the elements in sorted order, use the copy + constructor and repeatedly elements from it. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to + copy from. + + + is . + + + + + Removes all nodes from this queue. + + + + + Determines whether the given node is contained within this queue. + + + The node to locate in the queue. + + + if is found in the + queue, otherwise . + + + + + Adds a given node to the queue with the given priority. + + + The node to add to the queue. + + + The priority for the node. + + + is . + + + + + Removes and returns the head of the queue. + + + The removed element. + + + + + Changes the priority of the given node. + + + The node whose priority to change. + + + The new priority for the node. + + + is . + + + + + Removes the given node from this queue if it is present. + + + The node to remove if present. + + + A value indicating whether the node was removed. + + + + + + + + + + + Gets the number of nodes currently stored in this queue. + + + + + Gets the node at the head of the queue. + This is the node whose compares + less than or equal to the priority of all other nodes in the queue. + + + + + A container for a prioritized node that sites in an + . + + + The type to use for the priority of the node in the queue. + + + The type to use for the data stored by the node in the queue. + + + + + Initializes a new instance of the class. + + + The to store in this node. + + + + + Gets the that is stored in this node. + + + + + Gets the of this node in the queue. + + + The queue may update this priority while the node is still in the queue. + + + + + Gets or sets the index of this node in the queue. + + + This should only be read and written by the queue itself. + It has no "real" meaning to anyone else. + + + + + A utility for making programming assertions. + + + + + + + + + + + + + + + + + + + + + A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. + + + + + + + + + + + + + + + + + + + Static utility class for casting objects + + + + + Cast function from arbitrary-type to + + The output type + The sequence of items to cast. + as an enumerable of + Thrown if cast cannot be performed + + + + Cast function from sub-type to super-type + + The output (super/base) type + The input (sub/derived) type + The sequence of items to cast. + as an enumerable of + + + + Cast function from super-type to sub-type + + The input (sub/derived) type + The output (super/base) type + The sequence of items to cast. + as an enumerable of + + + + Executes a transformation function on each element of a collection + and returns the results in a new List. + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Copies s in an array to an object array + + + + the source array + An array of objects + + + + + + + + + + + + + + + + + + + + + A CoordinateFilter that creates an array containing every coordinate in a Geometry. + + + + + Constructs a CoordinateArrayFilter. + + The number of points that the CoordinateArrayFilter will collect. + + + + + + + + + + Returns the Coordinates collected by this CoordinateArrayFilter. + + + + + CoordinateCompare is used in the sorting of arrays of Coordinate objects. + Implements a lexicographic comparison. + + + + + Compares two object and returns a value indicating whether one is less than, equal to or greater + than the other. + + First Coordinate object to compare. + Second Coordinate object to compare. + + <table cellspacing="0" class="dtTABLE"> + <TR VALIGN="top"> + <TH width=50%>Value</TH> + <TH width=50%>Condition</TH> + </TR> + <TR VALIGN="top"> + <TD width=50%>Less than zero</TD> + <TD width=50%><I>a</I> is less than <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Zero</TD> + <TD width=50%><I>a</I> equals <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Greater than zero</TD> + <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> + </TR> + </table> + + If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b + implements IComparable, then b. CompareTo (a) is returned. + Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not + generate an exception when using IComparable. When sorting, a null reference (Nothing) is + considered to be less than any other object. + + + + + A CoordinateFilter that counts the total number of coordinates + in a Geometry. + + + + + + + + + + + Returns the result of the filtering. + + + + + Converts degrees to radians. + + + + + Converts degrees to radians. + + The angle in degrees. + The angle in radians. + + + + + + + + + Only static methods! + + + + + Convert the given numeric value (passed as string) of the base specified by baseIn + to the value specified by baseOut. + + Numeric value to be converted, as string. + Base of input value. + Base to use for conversion. + Converted value, as string. + + + + + + + + + + + + + + + + + + + + + + + + + Utility functions to report memory usage. + + mbdavis + + + + A priority queue over a set of objects. + + Objects to add + Martin Davis + + + Insert into the priority queue. Duplicates are allowed. + + The item to insert. + + + + Test if the priority queue is logically empty. + + true if empty, false otherwise. + + + + Make the priority queue logically empty. + + + + + Remove the smallest item from the priority queue. + + The smallest item, or default(T) if empty. + + + + Returns size. + + + + + Converts radians to degress. + + + + + Converts radians to degress. + + Angle in radians. + The angle in degrees. + + + + + + + + + + + + + + + + + Buffer for characters. This approximates StringBuilder + but is designed to be faster for specific operations. + This is about 30% faster for the operations I'm interested in + (Append, Clear, Length, ToString). + This trades off memory for speed. + + + To make Remove from the head fast, this is implemented + as a ring buffer. + This uses head and tail indices into a fixed-size + array. This will grow the array as necessary. + + + + + Default constructor. + + + + + Construct with a specific capacity. + + + + + + Reallocate the buffer to be larger. For the new size, this + uses the max of the requested length and double the current + capacity. + This does not shift, meaning it does not change the head or + tail indices. + + The new requested length. + + + + Ensure that we're set for the requested length by + potentially growing or shifting contents. + + + + + + Move the buffer contents such that headIndex becomes 0. + + + + + Overwrite this object's underlying buffer with the specified + buffer. + + The character array. + The number of characters to consider filled + in the input buffer. + + + + Append a character to this buffer. + + + + + + Append a string to this buffer. + + The string to append. + + + + Append a string to this buffer. + + The string to append. + + + + Remove a character at the specified index. + + The index of the character to remove. + + + + + Remove a specified number of characters at the specified index. + + The index of the characters to remove. + The number of characters to remove. + + + + Find the first instance of a character in the buffer, and + return its index. This returns -1 if the character is + not found. + + The character to find. + The index of the specified character, or -1 + for not found. + + + + Empty the buffer. + + + + + Return the current contents as a string. + + The new string. + + + + Gets/Sets the number of characters in the character buffer. + Increasing the length this way provides indeterminate results. + + + + + Returns the capacity of this character buffer. + + + + + Indexer. + + + + + Exception class for unterminated tokens. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated quotes. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated block comments. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Bitwise enumeration for character types. + + + + word characters (usually alpha, digits, and domain specific) + + + # or something for line comments + + + whitespace + + + ' or " type + + + usually 0 to 9 + + + usually 0 to 9, a-f and A-F + + + eof char + + + + This contains the settings that control the behavior of the tokenizer. + This is separated from the StreamTokenizer so that common settings + are easy to package and keep together. + + + + + Default constructor. + + + + + Copy constructor. + + + + + Sets this object to be the same as the specified object. + Note that some settings which are entirely embodied by the character + type table. + + + + + Setup default parse behavior. + This resets to same behavior as on construction. + + bool - true for success. + + + + Apply settings which are commonly used for code parsing + C-endCapStyle code, including C++, C#, and Java. + + + + + + Clear the character type settings. This leaves them unset, + as opposed to the default. Use SetDefaults() for default + settings. + + + + + Specify that a particular character is a word character. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + The character. + + + + Specify that a range of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + First character. + Last character. + + + + Specify that a string of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + + + + + Specify that a character is a whitespace character. + Character table type manipulation method. + This type is exclusive with other types. + + The character. + + + + Specify that a range of characters are whitespace characters. + Character table type manipulation method. + This adds the characteristic to the char(s), rather + than overwriting other characteristics. + + First character. + Last character. + + + + Remove other type settings from a range of characters. + Character table type manipulation method. + + + + + + + Remove other type settings from a character. + Character table type manipulation method. + + + + + + Specify that a particular character is a comment-starting character. + Character table type manipulation method. + + + + + + Specify that a particular character is a quote character. + Character table type manipulation method. + + + + + + Return a string representation of a character type setting. + Since the type setting is bitwise encoded, a character + can have more than one type. + + The character type byte. + The string representation of the type flags. + + + + Check whether the specified char type byte has a + particular type flag set. + + The char type byte. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + This is the character type table. Each byte is bitwise encoded + with the character attributes, such as whether that character is + word or whitespace. + + + + + Whether or not to return whitespace tokens. If not, they're ignored. + + + + + Whether or not to return EolTokens on end of line. Eol tokens will not + break up other tokens which can be multi-line. For example block comments + and quotes will not be broken by Eol tokens. Therefore the number of + Eol tokens does not give you the line count of a stream. + + + + + Whether or not to look for // comments + + + + + Whether or not to look for /* */ block comments. + + + + + Whether or not to return comments. + + + + + Whether or not to check for unterminated quotes and block comments. + If true, and one is encoutered, an exception is thrown of the appropriate type. + + + + + Whether or not digits are specified as Digit type in the + character table. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + This setting may become incorrect if you modify the character + types table directly. + + + + + Whether or not to parse Hex (0xABCD...) numbers. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + + + + + A StreamTokenizer similar to Java's. This breaks an input stream + (coming from a TextReader) into Tokens based on various settings. The settings + are stored in the TokenizerSettings property, which is a + StreamTokenizerSettings instance. + + + + This is configurable in that you can modify TokenizerSettings.CharTypes[] array + to specify which characters are which type, along with other settings + such as whether to look for comments or not. + + + WARNING: This is not internationalized. This treats all characters beyond + the 7-bit ASCII range (decimal 127) as Word characters. + + + There are two main ways to use this: 1) Parse the entire stream at + once and get an ArrayList of Tokens (see the Tokenize* methods), + and 2) call NextToken() successively. + This reads from a TextReader, which you can set directly, and this + also provides some convenient methods to parse files and strings. + This returns an Eof token if the end of the input is reached. + + + Here's an example of the NextToken() endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer(); + tokenizer.GrabWhitespace = true; + tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging + tokenizer.TextReader = File.OpenText(fileName); + Token token; + while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); + + + + Here's an example of the Tokenize... endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer("some string"); + ArrayList tokens = new ArrayList(); + if (!tokenizer.Tokenize(tokens)) + { + // error handling + } + foreach (Token t in tokens) Console.WriteLine("t = {0}", t); + + + + Comment delimiters are hardcoded (// and /*), not affected by char type table. + + + This sets line numbers in the tokens it produces. These numbers are normally + the line on which the token starts. + There is one known caveat, and that is that when GrabWhitespace setting + is true, and a whitespace token contains a newline, that token's line number + will be set to the following line rather than the line on which the token + started. + + + + + + This is the number of characters in the character table. + + + + + Default constructor. + + + + + Construct and set this object's TextReader to the one specified. + + The TextReader to read from. + + + + Construct and set a string to tokenize. + + The string to tokenize. + + + + Utility function, things common to constructors. + + + + + Clear the stream settings. + + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + The state. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + Exclude this state from the possible next state. + The state. + + + + Read the next character from the stream, or from backString + if we backed up. + + The next character. + + + + Get the next token. The last token will be an EofToken unless + there's an unterminated quote or unterminated block comment + and Settings.DoUntermCheck is true, in which case this throws + an exception of type StreamTokenizerUntermException or sub-class. + + The output token. + bool - true for success, false for failure. + + + + Starting from current stream location, scan forward + over an int. Determine whether it's an integer or not. If so, + push the integer characters to the specified CharBuffer. + If not, put them in backString (essentially leave the + stream as it was) and return false. + + If it was an int, the stream is left 1 character after the + end of the int, and that character is output in the thisChar parameter. + + The formats for integers are: 1, +1, and -1 + The + and - signs are included in the output buffer. + + The CharBuffer to append to. + Whether or not to consider + to be part + of an integer. + The last character read by this method. + true for parsed an int, false for not an int + + + + Parse the rest of the stream and put all the tokens + in the input ArrayList. This resets the line number to 1. + + The ArrayList to append to. + bool - true for success + + + + Parse all tokens from the specified TextReader, put + them into the input ArrayList. + + The TextReader to read from. + The ArrayList to append to. + bool - true for success, false for failure. + + + + Parse all tokens from the specified file, put + them into the input ArrayList. + + The file to read. + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Tokenize a file completely and return the tokens in a Token[]. + + The file to tokenize. + A Token[] with all tokens. + + + + Parse all tokens from the specified string, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Parse all tokens from the specified Stream, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + This is the TextReader that this object will read from. + Set this to set the input reader for the parse. + + + + + The settings which govern the behavior of the tokenization. + + + + + The states of the state machine. + + + + + Token class used by StreamTokenizer. + This represents a single token in the input stream. + This is subclassed to provide specific token types, + such as CharToken, FloatToken, etc. + + + + + The line number in the input stream where this token originated. + This is base-1. + + + + + A storage object for the data of this token. + + + + + Backer for UntermError. + + + + An error message associated with unterm error. + + + + Construct a Token with the specified line number. + + The line number where this + token comes from. + + + + Equals override. + + The object to compare to. + bool - true for equals, false otherwise. + + + + Equals overload. + + The string to compare to. + bool + + + + Equals overload. + + The char to compare to. + bool + + + + Operator== overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator!= overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator== overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator!= overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator== overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Operator!= overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Override. Returns the ToString().GetHashCode(). + + The hash code. + + + + Produce a string which includes the line number. + + + + + + Produce a string which includes the token type. + + + + + + Create an object of the specified type corresponding to + this token. + + The type of object to create. + The new object, or null for error. + + + + The line number where this token was found. This is base-1. + + + + + The Object stored by this token. This will be + a primitive C# type. + + + + + Whether or not there was an unterminated token problem + when creating this token. See UntermErrorMessage for + a message associated with the problem. + + + + + The error message if there was an unterminated token error + creating this token. + + + + + Return this token's value as a string. + + This token's value as a string. + + + + Represents end-of-lines (line separator characters). + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Represents end of file/stream. + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Abstract base class for string tokens. + + + + Default constructor. + + + Constructor with the specified value + and line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for words, meaning sequences of word + characters. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for Quotes such as "this is a quote". + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for comments, including line and block + comments. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for whitespace such as spaces and tabs. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for characters, meaning non-word characters. + + + + Constructor with the specified value + and line number. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for floating point numbers, stored internally as a Double. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value and line number. + + + + + Constructor with the specified value and line number. + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Token type for integer tokens. This handles both Int32 and Int64. + + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + Constructor with the specified value + and line number. + + + + Constructor for a 64 bit int + + + + + Parse a string known to be a hex string. This is faster + than Parse which doesn't assume the number is Hex. This will + throw an exception if the input number isn't hex. + + The hex number as a string. + The line where this token was found. + A new IntToken set to the value in the input string. + + + + Convert the input string to an integer, if possible + + The string to parse. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + This enumerates verbosity levels. + + + + For error messages. + + + For warn messages. + + + For info messages. + + + For debug messages. + + + + Framework replacement for string.IsNullOrWhitespace + + The string to test + A value indicating if is null, empty or only contains whitespace characters + + + + A CoordinateFilter that builds a set of Coordinates. + The set of coordinates contains no duplicate points. + + + + + Convenience method which allows running the filter over an array of s. + + an array of coordinates + an array of the unique coordinates + + + + + + + + + + Returns the gathered s. + + + + + An algorithm for computing a distance metric + which is an approximation to the Hausdorff Distance + based on a discretization of the input . + + + + The algorithm computes the Hausdorff distance restricted to discrete points + for one of the geometries. + The points can be either the vertices of the geometries (the default), + or the geometries with line segments densified by a given fraction. + Also determines two points of the Geometries which are separated by the computed distance. + + + This algorithm is an approximation to the standard Hausdorff distance. + Specifically, + + for all geometries a, b: DHD(a, b) <= HD(a, b) + + The approximation can be made as close as needed by densifying the input geometries. + In the limit, this value will approach the true Hausdorff distance: + + DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 + + The default approximation is exact or close enough for a large subset of useful cases. + + + Examples of these are: + + + computing distance between Linestrings that are roughly parallel to each other, + and roughly equal in length. This occurs in matching linear networks. + + Testing similarity of geometries. + + + + An example where the default approximation is not close is: + + A = LINESTRING (0 0, 100 0, 10 100, 10 100) + B = LINESTRING (0 100, 0 10, 80 10) + + DHD(A, B) = 22.360679774997898 + HD(A, B) ~= 47.8 + + + + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The Discrete Hausdorff Distance + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The densify fraction. A value of 0 indicates, that no densification should take place + The Discrete Hausdorff Distance + + + Value of 0.0 indicates that no densification should take place + + + + Gets/sets the fraction by which to densify each segment. + + + Each segment will be (virtually) split into a number of equal-length + subsegments, whose fraction of the total length is closest + to the given fraction. + + +
+
Index: packages/NetTopologySuite.1.14/lib/net20/PowerCollections.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net20/PowerCollections.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net20/PowerCollections.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net20/PowerCollections.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,11141 @@ + + + + PowerCollections + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Makes a deep clone of this Deque. A new Deque is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the Deque takes time O(N), where N is the number of items in the Deque. + The cloned Deque. + T is a reference type that does not implement ICloneable. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Serialize the hash table. Called from the serialization infrastructure. + + + + + Called on deserialization. We cannot deserialize now, because hash codes + might not be correct now. We do real deserialization in the OnDeserialization call. + + + + + Deserialize the hash table. Called from the serialization infrastructure when + the object graph has finished deserializing. + + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N log N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Makes a deep clone of this BigList. A new BigList is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then this method is the same as Clone. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + +
+
Index: packages/NetTopologySuite.1.14/lib/net35-client/NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net35-client/NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net35-client/NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net35-client/NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,34111 @@ + + + + NetTopologySuite + + + + + An interface for rules which determine whether node points + which are in boundaries of geometry components + are in the boundary of the parent geometry collection. + The SFS specifies a single kind of boundary node rule, + the rule. + However, other kinds of Boundary Node Rules are appropriate + in specific situations (for instance, linear network topology + usually follows the .) + Some JTS operations + (such as , and ) + allow the BoundaryNodeRule to be specified, + and respect the supplied rule when computing the results of the operation. + + An example use case for a non-SFS-standard Boundary Node Rule is + that of checking that a set of s have + valid linear network topology, when turn-arounds are represented + as closed rings. In this situation, the entry road to the + turn-around is only valid when it touches the turn-around ring + at the single (common) endpoint. This is equivalent + to requiring the set of LineStrings to be + simple under the . + The SFS-standard is not + sufficient to perform this test, since it + states that closed rings have no boundary points. + + This interface and its subclasses follow the Strategy design pattern. + + Martin Davis + + + + + + + + Tests whether a point that lies in boundaryCount + geometry component boundaries is considered to form part of the boundary + of the parent geometry. + + boundaryCount the number of component boundaries that this point occurs in + true if points in this number of boundaries lie in the parent boundary + + + + Provides access to static instances of common s. + + + + + The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). + + + + + The Endpoint Boundary Node Rule. + + + + The MultiValent Endpoint Boundary Node Rule. + + + + The Monovalent Endpoint Boundary Node Rule. + + + + + The Boundary Node Rule specified by the OGC Simple Features Specification, + which is the same as the Mod-2 rule. + + + + + + A specifies that points are in the + boundary of a lineal geometry iff + the point lies on the boundary of an odd number + of components. + Under this rule s and closed + s have an empty boundary. + + + This is the rule specified by the OGC SFS, + and is the default rule used in JTS. + + Martin Davis + + + + A which specifies that any points which are endpoints + of lineal components are in the boundary of the + parent geometry. + This corresponds to the "intuitive" topological definition + of boundary. + Under this rule s have a non-empty boundary + (the common endpoint of the underlying LineString). + + + This rule is useful when dealing with linear networks. + For example, it can be used to check + whether linear networks are correctly noded. + The usual network topology constraint is that linear segments may touch only at endpoints. + In the case of a segment touching a closed segment (ring) at one point, + the Mod2 rule cannot distinguish between the permitted case of touching at the + node point and the invalid case of touching at some other interior (non-node) point. + The EndPoint rule does distinguish between these cases, + so is more appropriate for use. + + Martin Davis + + + + A which determines that only + endpoints with valency greater than 1 are on the boundary. + This corresponds to the boundary of a + being all the "attached" endpoints, but not + the "unattached" ones. + + Martin Davis + + + + A which determines that only + endpoints with valency of exactly 1 are on the boundary. + This corresponds to the boundary of a + being all the "unattached" endpoints. + + Martin Davis + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + It is also a reasonable strategy for cases where the + endpoint of one segment lies on or almost on the interior of another one. + Taking the most central endpoint ensures that the computed intersection + point lies in the envelope of the segments. + Also, by always returning one of the input points, this should result + in reducing segment fragmentation. + Intended to be used as a last resort for + computing ill-conditioned intersection situations which + cause other methods to fail. + + + WARNING: in some cases this algorithm makes a poor choice of endpoint. + It has been replaced by a better heuristic in . + + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + + Creates an instance of this class using the provided input coordinates + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + Determines a point closest to the given point. + + + + + Gets the intersection point + + + + + Computes the centroid of a of any dimension. + If the geometry is nominally of higher dimension, + but has lower effective dimension + (i.e. contains only components + having zero length or area), + the centroid will be computed as for the equivalent lower-dimension geometry. + If the input geometry is empty, a + null Coordinate is returned. + +

Algorithm

+ + Dimension 2 - the centroid ic computed + as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + Holes and multipolygons are handled correctly. + See http://www.faqs.org/faqs/graphics/algorithms-faq/ + for further details of the basic approach. + Dimension 1 - Computes the average of the midpoints + of all line segments weighted by the segment length. + Zero-length lines are treated as points. + + Dimension 0 - Compute the average coordinate over all points. + Repeated points are all included in the average + + + If the input geometries are empty, a null Coordinate is returned. +
+ 1.7 +
+ + + Computes the centroid point of a geometry. + + The geometry to use + + The centroid point, or null if the geometry is empty + + + + + the point all triangles are based at + + + + + temporary variable to hold centroid of triangle + + + + + Partial area sum + + + + + partial centroid sum + + + + + Creates a new instance for computing the centroid of a geometry + + + + + Adds a to the centroid total. + + >The to add. + + + + Gets the computed centroid. + + The computed centroid, or null if the input is empty + + + + Computes three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3. + The area is positive if the triangle is oriented CCW, and negative if CW. + + + + + Adds the line segments defined by an array of coordinates + to the linear centroid accumulators. + + An array of s + + + + Adds a point to the point centroid accumulator. + + A + + + + Computes the centroid of an area point. + + + Algorithm: + + Based on the usual algorithm for calculating + the centroid as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + + The algorithm has been extended to handle holes and multi-polygons. + See + for further details of the basic approach. + + + The code has also be extended to handle degenerate (zero-area) polygons. + In this case, the centroid of the line segments in the polygon + will be returned. + + + + + + Adds the area defined by a Geometry to the centroid total. + If the point has no area it does not contribute to the centroid. + + The point to add. + + + + Adds the area defined by an array of + coordinates. The array must be a ring; + i.e. end with the same coordinate as it starts with. + + An array of Coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3, + positive if a,b,c are oriented ccw, and negative if cw. + + + + + Adds the linear segments defined by an array of coordinates + to the linear centroid accumulators. + This is done in case the polygon(s) have zero-area, + in which case the linear centroid is computed instead. + + an array of s + + + + + + + + + + + + + + Computes the centroid of a linear point. + Algorithm: + Compute the average of the midpoints + of all line segments weighted by the segment length. + + + + + Adds the linear components of by a Geometry to the centroid total. + If the geometry has no linear components it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by an array of coordinates. + + An array of Coordinates. + + + + + + + + + Computes the centroid of a point point. + Algorithm: + Compute the average of all points. + + + + + Adds the point(s) defined by a Geometry to the centroid total. + If the point is not of dimension 0 it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by a coordinate. + + A coordinate. + + + + + + + + Basic computational geometry algorithms + for geometry and coordinates defined in 3-dimensional Cartesian space. + + @author mdavis + + + + Computes the distance between two 3D segments. + + @param A the start point of the first segment + @param B the end point of the first segment + @param C the start point of the second segment + @param D the end point of the second segment + @return the distance between the segments + + + + Implements basic computational geometry algorithms using arithmetic. + + Martin Davis + + + + A value which is safely greater than the + relative round-off error in double-precision numbers + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + Computes the sign of the determinant of the 2x2 matrix + with the given entries. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is 0. + + + + + + A filter for computing the orientation index of three coordinates. + + If the orientation can be computed safely using standard DP + arithmetic, this routine returns the orientation index. + Otherwise, a value i > 1 is returned. + In this case the orientation index must + be computed using some other more robust method. + The filter is fast to compute, so can be used to + avoid the use of slower robust methods except when they are really needed, + thus providing better average performance. + + Uses an approach due to Jonathan Shewchuk, which is in the public domain. + + + + The orientation index if it can be computed safely + > 1 if the orientation index cannot be computed safely> + + + + + + Computes an intersection point between two lines + using DD arithmetic. + Currently does not handle case of parallel lines. + + A point of 1st segment + Another point of 1st segment + A point of 2nd segment + Another point of 2nd segment + + + + + Specifies and implements various fundamental Computational Geometric algorithms. + The algorithms supplied in this class are robust for double-precision floating point. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + Returns the index of the direction of the point q + relative to a vector specified by p1-p2. + + The origin point of the vector. + The final point of the vector. + The point to compute the direction to. + + 1 if q is counter-clockwise (left) from p1-p2, + -1 if q is clockwise (right) from p1-p2, + 0 if q is collinear with p1-p2. + + + + + Tests whether a point lies inside or on a ring. + + + The ring may be oriented in either direction. + A point lying exactly on the ring boundary is considered to be inside the ring. + This method does not first check the point against the envelope + of the ring. + + Point to check for ring inclusion. + An array of s representing the ring (which must have first point identical to last point) + true if p is inside ring. + + + + + Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. + + + The ring may be oriented in either direction. + This method does not first check the point against the envelope of the ring. + + Point to check for ring inclusion + An array of coordinates representing the ring (which must have first point identical to last point) + The of p relative to the ring + + + + Tests whether a point lies on the line segments defined by a + list of coordinates. + + + + true if the point is a vertex of the line + or lies in the interior of a line segment in the linestring + + + + + Computes whether a ring defined by an array of s is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + An array of s froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + A coordinate sequence froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + The first vertex of the line segment + The second vertex of the line segment + The point to compute the relative orientation of + + 1 if q is counter-clockwise from p1-p2, + or -1 if q is clockwise from p1-p2, + or 0 if q is collinear with p1-p2 + + + + + Computes the distance from a point p to a line segment AB. + Note: NON-ROBUST! + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The distance from p to line segment AB. + + + + Computes the perpendicular distance from a point p + to the (infinite) line containing the points AB + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The perpendicular distance from p to line AB. + + + + Computes the distance from a point to a sequence of line segments. + + A point + A sequence of contiguous line segments defined by their vertices + The minimum distance between the point and the line segments + If there are too few points to make up a line (at least one?) + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates of the ring + The signed area of the ring + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates forming the ring + The signed area of the ring + + + + Computes the length of a linestring specified by a sequence of points. + + The points specifying the linestring + The length of the linestring + + + + Computes the convex hull of a . + The convex hull is the smallest convex Geometry that contains all the + points in the input Geometry. + Uses the Graham Scan algorithm. + + + + + Create a new convex hull construction for the input Geometry. + + + + + + Create a new convex hull construction for the input array. + + + + + + + + + + + + + + Returns a Geometry that represents the convex hull of the input point. + The point will contain the minimal number of points needed to + represent the convex hull. In particular, no more than two consecutive + points will be collinear. + + + If the convex hull contains 3 or more points, a Polygon; + 2 points, a LineString; + 1 point, a Point; + 0 points, an empty GeometryCollection. + + + + + Uses a heuristic to reduce the number of points scanned to compute the hull. + The heuristic is to find a polygon guaranteed to + be in (or on) the hull, and eliminate all points inside it. + A quadrilateral defined by the extremal points + in the four orthogonal directions + can be used, but even more inclusive is + to use an octilateral defined by the points in the 8 cardinal directions. + Note that even if the method used to determine the polygon vertices + is not 100% robust, this does not affect the robustness of the convex hull. + + To satisfy the requirements of the Graham Scan algorithm, + the returned array has at least 3 entries. + + + The coordinates to reduce + The reduced array of coordinates + + + + Pre sorts the coordinates + + + + + + + + + + + + + + + + + + + + Whether the three coordinates are collinear + and c2 lies between c1 and c3 inclusive. + + + + + + + + + + + + + + + + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + A 2-vertex LineString if the vertices are collinear; + otherwise, a Polygon with unnecessary (collinear) vertices removed. + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + The coordinates with unnecessary (collinear) vertices removed. + + + + Compares s for their angle and distance + relative to an origin. + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + Computes the Euclidean distance (L2 metric) from a to a . + + + Also computes two points on the geometry which are separated by the distance found. + + + + + Contains a pair of points and the distance between them. + + + Provides methods to update with a new point pair with either maximum or minimum distance. + + + + + Initializes to null. + + + + + Initializes the points. + + 1st coordinate + 2nd coordinate + + + + Initializes the points, avoiding recomputing the distance. + + 1st coordinate + 2nd coordinate + the distance between and + + + + The distance between the paired coordinates + + + + + Returns an array containing the paired points + + + + + Represents a homogeneous coordinate in a 2-D coordinate space. + In NTS s are used as a clean way + of computing intersections between line segments. + + David Skea + + + + Computes the (approximate) intersection point between two line segments using homogeneous coordinates. + + + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + 1st Coordinate of 1st linesegment + 2nd Coordinate of 1st linesegment + 1st Coordinate of 2nd linesegment + 2nd Coordinate of 2nd linesegment + + + + Computes the (approximate) intersection point between two line segments + using homogeneous coordinates. + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a homogeneous coordinate which is the intersection of the lines s. + define by the homogenous coordinates represented by two + + A coordinate + A coordinate + + + + Direct access to x private field + + + + + Direct access to y private field + + + + + Direct access to w private field + + + + + + + + + + Computes a point in the interior of an areal geometry. + + +

Algorithm:

+ + Find a Y value which is close to the centre of + the geometry's vertical extent but is different + to any of it's Y ordinates. + Create a horizontal bisector line using the Y value + and the geometry's horizontal extent + Find the intersection between the geometry + and the horizontal bisector line. + The intersection is a collection of lines and points. + Pick the midpoint of the largest intersection geometry + +

KNOWN BUGS

+ + If a fixed precision model is used, + in some cases this method may return a point + which does not lie in the interior.
+
+ + + + + + + + + + + Creates a new interior point finder + for an areal geometry. + + An areal geometry + + + + Tests the interior vertices (if any) + defined by an areal Geometry for the best inside point. + If a component Geometry is not of dimension 2 it is not tested. + + The point to add. + + + + Finds an interior point of a Polygon. + + The geometry to analyze. + + + + If point is a collection, the widest sub-point; otherwise, + the point itself. + + + + + + + + + + + + Returns the centre point of the envelope. + + The envelope to analyze. + The centre of the envelope. + + + + Gets the computed interior point. + + + + + Finds a safe bisector Y ordinate + by projecting to the Y axis + and finding the Y-ordinate interval + which contains the centre of the Y extent. + The centre of this interval is returned as the bisector Y-ordinate. + + Martin Davis + + + + Computes a point in the interior of an linear point. + Algorithm: + Find an interior vertex which is closest to + the centroid of the linestring. + If there is no interior vertex, find the endpoint which is + closest to the centroid. + + + + + + + + + + + Tests the interior vertices (if any) + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + Tests the endpoint vertices + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + + + + + + + + + + + + Computes a point in the interior of an point point. + Algorithm: + Find a point which is closest to the centroid of the point. + + + + + + + + + + + Tests the point(s) defined by a Geometry for the best inside point. + If a Geometry is not of dimension 0 it is not tested. + + The point to add. + + + + + + + + + + + + + + + An interface for classes which determine the of points in a + + Martin Davis + + + + Determines the of a point in the . + + The point to test + the location of the point in the geometry + + + + A LineIntersector is an algorithm that can both test whether + two line segments intersect and compute the intersection point(s) + if they do. + + There are three possible outcomes when determining whether two line segments intersect: + + - the segments do not intersect + - the segments intersect in a single point + - the segments are collinear and they intersect in a line segment + + + + For segments which intersect in a single point, the point may be either an endpoint + or in the interior of each segment. + If the point lies in the interior of both segments, + this is termed a proper intersection. + The property test for this situation. + + The intersection point(s) may be computed in a precise or non-precise manner. + Computing an intersection point precisely involves rounding it + via a supplied . + + LineIntersectors do not perform an initial envelope intersection test + to determine if the segments are disjoint. + This is because this class is likely to be used in a context where + envelope overlap is already known to occur (or be likely). + + + + + These are deprecated, due to ambiguous naming + + + + Indicates that line segments do not intersect + + + + + Indicates that line segments intersect in a single point + + + + + Indicates that line segments intersect in a line segment + + + + + Computes the "edge distance" of an intersection point p along a segment. + The edge distance is a metric of the point along the edge. + The metric used is a robust and easy to compute metric function. + It is not equivalent to the usual Euclidean metric. + It relies on the fact that either the x or the y ordinates of the + points in the edge are unique, depending on whether the edge is longer in + the horizontal or vertical direction. + NOTE: This function may produce incorrect distances + for inputs where p is not precisely on p1-p2 + (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. + My hypothesis is that the function is safe to use for points which are the + result of rounding points which lie on the line, but not safe to use for truncated points. + + + + + This function is non-robust, since it may compute the square of large numbers. + Currently not sure how to improve this. + + + + + The indexes of the endpoints of the intersection lines, in order along + the corresponding line + + + + + If MakePrecise is true, computed intersection coordinates will be made precise + using Coordinate.MakePrecise. + + + + + Gets an endpoint of an input segment. + + the index of the input segment (0 or 1) + the index of the endpoint (0 or 1) + The specified endpoint + + + + Compute the intersection of a point p and the line p1-p2. + This function computes the bool value of the hasIntersection test. + The actual value of the intersection (if there is one) + is equal to the value of p. + + + + + Computes the intersection of the lines p1-p2 and p3-p4. + This function computes both the bool value of the hasIntersection test + and the (approximate) value of the intersection point itself (if there is one). + + + + + Returns the intIndex'th intersection point. + + is 0 or 1. + The intIndex'th intersection point. + + + + Test whether a point is a intersection point of two line segments. + Note that if the intersection is a line segment, this method only tests for + equality with the endpoints of the intersection segment. + It does not return true if the input point is internal to the intersection segment. + + true if the input point is one of the intersection points. + + + + Tests whether either intersection point is an interior point of one of the input segments. + + + true if either intersection point is in the interior of one of the input segment. + + + + + Tests whether either intersection point is an interior point of the specified input segment. + + + true if either intersection point is in the interior of the input segment. + + + + + Computes the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The intIndex'th intersection point in the direction of the specified input line segment. + + + + + Computes the index (order) of the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The index of the intersection point along the segment (0 or 1). + + + + + Computes the intersection line index + + The segment index + + + + Computes the "edge distance" of an intersection point along the specified input line segment. + + is 0 or 1. + is 0 or 1. + The edge distance of the intersection point. + + + + Alias the [0] for ease of reference + + + + + Alias the [1] for ease of reference + + + + + Force computed intersection to be rounded to a given precision model + + + + + Force computed intersection to be rounded to a given precision model. + No getter is provided, because the precision model is not required to be specified. + + + + + Tests whether the input geometries intersect. + + true if the input geometries intersect. + + + + Returns the number of intersection points found. This will be either 0, 1 or 2. + + The number of intersection points found (0, 1, or 2) + + + + Tests whether an intersection is proper. + The intersection between two line segments is considered proper if + they intersect in a single point in the interior of both segments + (e.g. the intersection is a single point and is not equal to any of the endpoints). + The intersection between a point and a line segment is considered proper + if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). + + true if the intersection is proper. + + + + Determines the location of s relative to + a geometry, using indexing for efficiency. + This algorithm is suitable for use in cases where + many points will be tested against a given area. + + Thread-safe and immutable. + + Martin Davis + + + + An interface for classes which determine the of + points in areal geometries. + + Martin Davis + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + Creates a new locator for a given . + + the Geometry to locate in + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + + A visitor for items in an index. + + + + + + + + + + + Static methods for classes + + + + + Convenience method to test a point for intersection with a geometry + + The geometry is wrapped in a class. + + The locator to use. + The coordinate to test. + true if the point is in the interior or boundary of the geometry. + + + Computes the location of points relative to an areal , using a simple O(n) algorithm. + This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. + + The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. + + + + Determines the of a point in an areal . Currently this will never return a value of . + + The point to test + The areal geometry to test + The Location of the point in the geometry + + + + Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. + + The point to test + A linear ring + true if the point lies inside the ring + + + + Measures the degree of similarity between two s + using the area of intersection between the geometries. + The measure is normalized to lie in the range [0, 1]. + Higher measures indicate a great degree of similarity. + + + NOTE: Currently experimental and incomplete. + + mbdavis + + + + An interface for classes which measures the degree of similarity between two {@link Geometry}s. + + + The computed measure lies in the range [0, 1]. + Higher measures indicate a great degree of similarity. + A measure of 1.0 indicates that the input geometries are identical + A measure of 0.0 indicates that the geometries have essentially no similarity. + The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. + + mbdavis + + + + Function to measure the similarity between two s. + + A geometry + A geometry + The similarity value between two s + + + + Measures the degree of similarity between two s using the Hausdorff distance metric. + + + + The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. + + + The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing + this by dividing it by the diagonal distance across the envelope of the combined geometries. + + + mbdavis + + + + + + + + + + + Provides methods to mathematically combine values. + + Martin Davis + + + + + + + + + + + + Implements IPointInRing + using a MonotoneChains and a BinTree index to increase performance. + + + + + + An interface for classes which test whether a Coordinate lies inside a ring. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The action for the internal iterator for performing + envelope select queries on a MonotoneChain. + + + + + These envelopes are used during the MonotoneChain search process. + + + + + + + + + + This method is overridden to process a segment + in the context of the parent chain. + + The parent chain + The index of the start vertex of the segment being processed + + + + This is a convenience method which can be overridden to obtain the actual + line segment which is selected. + + + + + + + + + + + + + + + + + + + Computes the Minimum Bounding Circle (MBC) for the points in a . + The MBC is the smallest circle which covers all the input points + (this is also sometimes known as the Smallest Enclosing Circle). + This is equivalent to computing the Maximum Diameter of the input point set. + + + + The computed circle can be specified in two equivalent ways, + both of which are provide as output by this class: + + As a centre point and a radius + By the set of points defining the circle. + + Depending on the number of points in the input + and their relative positions, this + will be specified by anywhere from 0 to 3 points. + + 0 or 1 points indicate an empty or trivial input point arrangment. + 2 or 3 points define a circle which contains + all the input points. + + + + + The class can also output a which approximates the + shape of the MBC (although as an approximation it is not + guaranteed to cover all the input points.) + + Martin Davis + + + The algorithm used is based on the one by Jon Rokne in + the article "An Easy Bounding Circle" in Graphic Gems II. + + + + Creates a new object for computing the minimum bounding circle for the + point set defined by the vertices of the given geometry. + + The geometry to use to obtain the point set + + + + Gets a geometry which represents the Minimum Bounding Circle. + + + + If the input is degenerate (empty or a single unique point), + this method will return an empty geometry or a single Point geometry. + Otherwise, a Polygon will be returned which approximates the + Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) + + + A Geometry representing the Minimum Bounding Circle. + + + + Gets a geometry representing a line between the two farthest points + in the input. + These points will be two of the extremal points of the Minimum Bounding Circle. + They also lie on the convex hull of the input. + + A LineString between the two farthest points of the input + An empty LineString if the input is empty + A Point if the input is a point + + + + Gets a geometry representing the diameter of the computed Minimum Bounding Circle. + + + + the diameter line of the Minimum Bounding Circle + an empty line if the input is empty + a Point if the input is a point + + + + + + Gets the extremal points which define the computed Minimum Bounding Circle. + + + There may be zero, one, two or three of these points, + depending on the number of points in the input + and the geometry of those points. + + The points defining the Minimum Bounding Circle + + + + Gets the centre point of the computed Minimum Bounding Circle. + + the centre point of the Minimum Bounding Circle, null if the input is empty + + + + Gets the radius of the computed Minimum Bounding Circle. + + The radius of the Minimum Bounding Circle + + + + Computes the minimum diameter of a . + + + + The minimum diameter is defined to be the + width of the smallest band that contains the point, + where a band is a strip of the plane defined + by two parallel lines. + This can be thought of as the smallest hole that the point can be + moved through, with a single rotation. + + + The first step in the algorithm is computing the convex hull of the Geometry. + If the input Geometry is known to be convex, a hint can be supplied to + avoid this computation. + + + This class can also be used to compute a line segment representing + the minimum diameter, the supporting line segment of the minimum diameter, + and a minimum rectangle enclosing the input geometry. + This rectangle will + have width equal to the minimum diameter, and have one side + parallel to the supporting segment. + + + + + + + Gets the minimum rectangle enclosing a geometry. + + The geometry + The minimum rectangle enclosing the geometry + + + + Gets the minimum diameter enclosing a geometry. + + The geometry + The length of the minimum diameter of the geometry + + + + Compute a minimum diameter for a given . + + a Geometry. + + + + Compute a minimum diameter for a giver Geometry, + with a hint if + the Geometry is convex + (e.g. a convex Polygon or LinearRing, + or a two-point LineString, or a Point). + + a Geometry which is convex. + true if the input point is convex. + + + + + + + + + + + + + + + Compute the width information for a ring of Coordinates. + Leaves the width information in the instance variables. + + + + + + + + + + + + + + + + + + + + + + + Gets the minimum rectangular which encloses the input geometry. + + + + The rectangle has width equal to the minimum diameter, and a longer length. + If the convex hull of the input is degenerate (a line or point) a or is returned. + + + The minimum rectangle can be used as an extremely generalized representation for the given geometry. + + + The minimum rectangle enclosing the input (or a line or point if degenerate) + + + + Gets the length of the minimum diameter of the input Geometry. + + The length of the minimum diameter. + + + + Gets the Coordinate forming one end of the minimum diameter. + + A coordinate forming one end of the minimum diameter. + + + + Gets the segment forming the base of the minimum diameter. + + The segment forming the base of the minimum diameter. + + + + Gets a LineString which is a minimum diameter. + + A LineString which is a minimum diameter. + + + + Non-robust versions of various fundamental Computational Geometric algorithms, + FOR TESTING PURPOSES ONLY!. + The non-robustness is due to rounding error in floating point computation. + + + + + + + + + + + + + Computes whether a ring defined by an array of Coordinate is + oriented counter-clockwise. + This will handle coordinate lists which contain repeated points. + + an array of coordinates forming a ring. + + true if the ring is oriented counter-clockwise. + throws ArgumentException if the ring is degenerate (does not contain 3 different points) + + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + 1 if q is counter-clockwise from p1-p2 + -1 if q is clockwise from p1-p2 + 0 if q is collinear with p1-p2 + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + the origin point of the vector + the final point of the vector + the point to compute the direction to + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + A non-robust version of LineIntersector. + + + + + + + + + + true if both numbers are positive or if both numbers are negative, + false if both numbers are zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RParameter computes the parameter for the point p + in the parameterized equation + of the line from p1 to p2. + This is equal to the 'distance' of p along p1-p2. + + + + + + + + + + + + + + + Computes the topological relationship () of a single point to a Geometry. + + + A may be specified to control the evaluation of whether the point lies on the boundary or not + The default rule is to use the the SFS Boundary Determination Rule + + Notes: + + s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. + + Instances of this class are not reentrant. + + + + + + Initializes a new instance of the class. + + + + + Convenience method to test a point for intersection with a Geometry + + The coordinate to test. + The Geometry to test. + true if the point is in the interior or boundary of the Geometry. + + + + Computes the topological relationship ({Location}) of a single point to a Geometry. + It handles both single-element and multi-element Geometries. + The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. + + The Location of the point relative to the input Geometry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the number of segments crossed by a horizontal ray extending to the right + from a given point, in an incremental fashion. + This can be used to determine whether a point lies in a geometry. + The class determines the situation where the point lies exactly on a segment. + When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. + + + This class handles polygonal geometries with any number of shells and holes. + The orientation of the shell and hole rings is unimportant. + In order to compute a correct location for a given polygonal geometry, + it is essential that all segments are counted which + + touch the ray + lie in in any ring which may contain the point + + + The only exception is when the point-on-segment situation is detected, in which + case no further processing is required. + The implication of the above rule is that segments which can be a priori determined to not touch the ray + (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. + + + Martin Davis + + + + Determines the of a point in a ring. + This method is an exemplar of how to use this class. + + The point to test + An array of Coordinates forming a ring + The location of the point in the ring + + + + Determines the of a point in a ring. + + The point to test + A coordinate sequence forming a ring + The location of the point in the ring + + + + Counts a segment + + An endpoint of the segment + Another endpoint of the segment + + + + Reports whether the point lies exactly on one of the supplied segments. + + This method may be called at any time as segments are processed. If the result of this method is true, + no further segments need be supplied, since the result will never change again. + + + + + + Gets the of the point relative to the ring, polygon + or multipolygon from which the processed segments were provided. + + This property only determines the correct location if all relevant segments have been processed + + + + Tests whether the point lies in or on the ring, polygon + + + This property only determines the correct location if all relevant segments have been processed + + + + Computes whether a rectangle intersects line segments. + + + Rectangles contain a large amount of inherent symmetry + (or to put it another way, although they contain four + coordinates they only actually contain 4 ordinates + worth of information). + The algorithm used takes advantage of the symmetry of + the geometric situation + to optimize performance by minimizing the number + of line intersection tests. + + Martin Davis + + + + Creates a new intersector for the given query rectangle, + specified as an . + + The query rectangle, specified as an Envelope + + + + Tests whether the query rectangle intersects a given line segment. + + The first endpoint of the segment + The second endpoint of the segment + true if the rectangle intersects the segment + + + + Implements an algorithm to compute the + sign of a 2x2 determinant for double precision values robustly. + It is a direct translation of code developed by Olivier Devillers. + + The original code carries the following copyright notice: + ************************************************************************ + Author : Olivier Devillers + Olivier.Devillers@sophia.inria.fr + http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html + + Olivier Devillers has allowed the code to be distributed under + the LGPL (2012-02-16) saying "It is ok for LGPL distribution." + + ************************************************************************* + ************************************************************************* + Copyright (c) 1995 by INRIA Prisme Project + BP 93 06902 Sophia Antipolis Cedex, France. + All rights reserved + ************************************************************************* + + + + + Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is null. + + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + A robust version of . + + + + + + + + + + + + + + + + + + + + + + + This method computes the actual value of the intersection point. + To obtain the maximum precision from the intersection calculation, + the coordinates are normalized by subtracting the minimum + ordinate values (in absolute value). This has the effect of + removing common significant digits from the calculation to + maintain more bits of precision. + + + + + + + + + + Computes a segment intersection using homogeneous coordinates. + Round-off error can cause the raw computation to fail, + (usually due to the segments being approximately parallel). + If this happens, a reasonable approximation is computed instead. + + + + + Normalize the supplied coordinates to + so that the midpoint of their intersection envelope + lies at the origin. + + + + + Tests whether a point lies in the envelopes of both input segments. + A correctly computed intersection point should return true + for this test. + Since this test is for debugging purposes only, no attempt is + made to optimize the envelope test. + + + true if the input point lies within both input segment envelopes. + + + + Finds the endpoint of the segments P and Q which + is closest to the other segment. + This is a reasonable surrogate for the true + intersection points in ill-conditioned cases + (e.g. where two segments are nearly coincident, + or where the endpoint of one segment lies almost on the other segment). + + + This replaces the older CentralEndpoint heuristic, + which chose the wrong endpoint in some cases + where the segments had very distinct slopes + and one endpoint lay almost on the other segment. + + an endpoint of segment P + an endpoint of segment P + an endpoint of segment Q + an endpoint of segment Q + the nearest endpoint to the other segment + + + + Tests whether a Coordinate lies inside + a ring, using a linear-time algorithm. + + + + + + + + + + + + + + + + + + + + + + + Implements PointInRing using a SIRtree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all ICRSObject implementing types + + + + + Base Interface for CRSBase Object types. + + + + + Gets the CRS type. + + + + + Gets the type of the CRSBase object. + + + + + Gets the properties. + + + + + Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. + + + + + Defines the Named CRS type. + + + + + Defines the Linked CRS type. + + + + + Defines the Linked CRS type. + + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Defines the Named CRS type. + + + + + Initializes a new instance of the class. + + + The mandatory name + member must be a string identifying a coordinate reference system. OGC CRS URNs such as + 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. + + + + + A graph containing s. + + + + + A graph comprised of s. + It supports tracking the vertices in the graph + via edges incident on them, + to allow efficient lookup of edges and vertices. + + + This class may be subclassed to use a + different subclass of HalfEdge, + by overriding . + If additional logic is required to initialize + edges then + can be overridden as well. + + + + + Creates a single HalfEdge. + Override to use a different HalfEdge subclass. + + the origin location + a new with the given origin + + + + Adds an edge between the coordinates orig and dest + to this graph. + + + Only valid edges can be added (in particular, zero-length segments cannot be added) + + the edge origin location + the edge destination location + The created edge + null if the edge was invalid and not added + + + + + Test if an the coordinates for an edge form a valid edge (with non-zero length) + + The start coordinate + The end coordinate + true of the edge formed is valid + + + + Inserts an edge not already present into the graph. + + the edge origin location + the edge destination location + an existing edge with same orig (if any) + the created edge + + + + Finds an edge in this graph with the given origin + and destination, if one exists. + + the origin location + the destination location + an edge with the given orig and dest, or null if none exists + + + + A HalfEdge which carries information + required to support . + + + + + A which supports + marking edges with a boolean flag. + Useful for algorithms which perform graph traversals. + + + + + Represents a directed component of an edge in an . + HalfEdges link vertices whose locations are defined by s. + HalfEdges start at an origin vertex, + and terminate at a destination vertex. + HalfEdges always occur in symmetric pairs, with the method + giving access to the oppositely-oriented component. + HalfEdges and the methods on them form an edge algebra, + which can be used to traverse and query the topology + of the graph formed by the edges. + + + By design HalfEdges carry minimal information + about the actual usage of the graph they represent. + They can be subclassed to carry more information if required. + + + HalfEdges form a complete and consistent data structure by themselves, + but an is useful to allow retrieving edges + by vertex and edge location, as well as ensuring + edges are created and linked appropriately. + + + + + Creates a HalfEdge pair representing an edge + between two vertices located at coordinates p0 and p1. + + a vertex coordinate + a vertex coordinate + the HalfEdge with origin at p0 + + + + Initialize a symmetric pair of HalfEdges. + Intended for use by subclasses. + The edges are initialized to have each other + as the edge, and to have pointers + which point to edge other. + This effectively creates a graph containing a single edge. + + a HalfEdge + a symmetric HalfEdge + the initialized edge e0 + + + + Creates an edge originating from a given coordinate. + + the origin coordinate + + + + Finds the edge starting at the origin of this edge + with the given dest vertex, if any. + + the dest vertex to search for + + the edge with the required dest vertex, + if it exists, or null + + + + + Tests whether this edge has the given orig and dest vertices. + + the origin vertex to test + the destination vertex to test + true if the vertices are equal to the ones of this edge + + + + Inserts an edge + into the ring of edges around the origin vertex of this edge. + The inserted edge must have the same origin as this edge. + + the edge to insert + + + + Insert an edge with the same origin after this one. + Assumes that the inserted edge is in the correct + position around the ring. + + the edge to insert (with same origin) + + + + Compares edges which originate at the same vertex + based on the angle they make at their origin vertex with the positive X-axis. + This allows sorting edges around their origin vertex in CCW order. + + + + + Implements the total order relation. + The angle of edge a is greater than the angle of edge b, + where the angle of an edge is the angle made by + the first segment of the edge with the positive x-axis. + When applied to a list of edges originating at the same point, + this produces a CCW ordering of the edges around the point. + Using the obvious algorithm of computing the angle is not robust, + since the angle calculation is susceptible to roundoff error. + + + A robust algorithm is: + 1. compare the quadrants the edge vectors lie in. + If the quadrants are different, + it is trivial to determine which edge has a greater angle. + 2. If the vectors lie in the same quadrant, the + function + can be used to determine the relative orientation of the vectors. + + + + + Computes a string representation of a HalfEdge. + + + + + Computes the degree of the origin vertex. + The degree is the number of edges + originating from the vertex. + + the degree of the origin vertex + + + + Finds the first node previous to this edge, if any. + If no such node exists (i.e the edge is part of a ring) + then null is returned. + + + an edge originating at the node prior to this edge, if any, + or null if no node exists + + + + + Gets the origin coordinate of this edge. + + + + + Gets the destination coordinate of this edge. + + + + + Gets the symmetric pair edge of this edge. + + + + + Gets the next edge CCW around the + destination vertex of this edge. + If the vertex has degree 1 then this is the sym edge. + + + + + Returns the edge previous to this one + (with dest being the same as this orig). + + + + + The X component of the distance between the orig and dest vertices. + + + + + The Y component of the distance between the orig and dest vertices. + + + + + Sets the mark for the given edge pair to a boolean value. + + an edge of the pair to update + the mark value to set + + + + Marks the edges in a pair. + + an edge of the pair to mark + + + + Creates a new marked edge. + + the coordinate of the edge origin + + + + Marks this edge. + + + + + Sets this edge to be the start segment of an input LineString. + + + + + Tests whether this edge is the starting segment + in a LineString being dissolved. + + true if this edge is a start segment + + + + Dissolves the linear components + from a collection of s. + into a set of maximal-length s + in which every unique segment appears once only. + The output linestrings run between node vertices + of the input, which are vertices which have + either degree 1, or degree 3 or greater. + + + Use cases for dissolving linear components + include generalization + (in particular, simplifying polygonal coverages), + and visualization + (in particular, avoiding symbology conflicts when + depicting shared polygon boundaries). + + + This class does NOT node the input lines. + If there are line segments crossing in the input, + they will still cross in the output. + + + + + Dissolves the linear components in a geometry. + + the geometry to dissolve + the dissolved lines + + + + Adds a to be dissolved. + Any number of geometries may be adde by calling this method multiple times. + Any type of Geometry may be added. The constituent linework will be + extracted to be dissolved. + + geometry to be line-merged + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + the geometries to be line-merged + + + + Gets the dissolved result as a . + + the dissolved lines + + + + For each edge in stack + (which must originate at a node) + extracts the line it initiates. + + + + + Updates the tracked ringStartEdge + if the given edge has a lower origin + (using the standard ordering). + + + Identifying the lowest starting node meets two goals: + * It ensures that isolated input rings are created using the original node and orientation. + * For isolated rings formed from multiple input linestrings, + it provides a canonical node and orientation for the output + (rather than essentially random, and thus hard to test). + + + + + + Builds a line starting from the given edge. + The start edge origin is a node (valence = 1 or >= 3), + unless it is part of a pure ring. + + + A pure ring has no other incident lines. + In this case the start edge may occur anywhere on the ring. + + + The line is built up to the next node encountered, + or until the start edge is re-encountered + (which happens if the edges form a ring). + + + + + + Adds edges around this node to the stack. + + + + + + Builds an edge graph from geometries containing edges. + + + + + Adds the edges of a Geometry to the graph. + May be called multiple times. + Any dimension of Geometry may be added; the constituent edges are extracted. + + geometry to be added + + + + Adds the edges in a collection of s to the graph. + May be called multiple times. + Any dimension of may be added. + + the geometries to be added + + + + Represents a feature collection. + + + + + Initializes a new instance of the class. + + The features. + + + + Initializes a new instance of the class. + + + + + Adds the specified feature. + + The feature. + + + + Removes the specified feature. + + The feature. + true if item is successfully removed; otherwise, false. This method also returns + false if item was not found in the collection. + + + + Removes the element at the specified index of the collection. + + The index. + + + + Gets the features. + + The features. + + + + Gets the (mandatory) type of the GeoJSON Object. + + + The type of the object. + + + + + Gets or sets the (optional) Coordinate Reference System Object. + + + The Coordinate Reference System Objects. + + + + + Returns the indexTh element in the collection. + + + + + + Returns the number of features contained by this . + + + + + A representation of a planar, linear vector geometry. + + + +

Binary Predicates:

+ Because it is not clear at this time what semantics for spatial + analysis methods involving GeometryCollections would be useful, + GeometryCollections are not supported as arguments to binary + predicates or the Relate method. +
+ +

Overlay Methods:

+ The spatial analysis methods will + return the most specific class possible to represent the result. If the + result is homogeneous, a Point, LineString, or + Polygon will be returned if the result contains a single + element; otherwise, a MultiPoint, MultiLineString, + or MultiPolygon will be returned. If the result is + heterogeneous a GeometryCollection will be returned. +
+ + Representation of Computed Geometries: + The SFS states that the result + of a set-theoretic method is the "point-set" result of the usual + set-theoretic definition of the operation (SFS 3.2.21.1). However, there are + sometimes many ways of representing a point set as a Geometry. + The SFS does not specify an unambiguous representation of a given point set + returned from a spatial analysis method. One goal of NTS is to make this + specification precise and unambiguous. NTS uses a canonical form for + Geometrys returned from overlay methods. The canonical + form is a Geometry which is simple and noded: + Simple means that the Geometry returned will be simple according to + the NTS definition of IsSimple. + Noded applies only to overlays involving LineStrings. It + means that all intersection points on LineStrings will be + present as endpoints of LineStrings in the result. + This definition implies that non-simple geometries which are arguments to + spatial analysis methods must be subjected to a line-dissolve process to + ensure that the results are simple. + + + Constructed Points And The Precision Model: + The results computed by the set-theoretic methods may + contain constructed points which are not present in the input Geometrys. + These new points arise from intersections between line segments in the + edges of the input Geometrys. In the general case it is not + possible to represent constructed points exactly. This is due to the fact + that the coordinates of an intersection point may contain twice as many bits + of precision as the coordinates of the input line segments. In order to + represent these constructed points explicitly, NTS must truncate them to fit + the PrecisionModel. + Unfortunately, truncating coordinates moves them slightly. Line segments + which would not be coincident in the exact result may become coincident in + the truncated representation. This in turn leads to "topology collapses" -- + situations where a computed element has a lower dimension than it would in + the exact result. + When NTS detects topology collapses during the computation of spatial + analysis methods, it will throw an exception. If possible the exception will + report the location of the collapse. + + + +

Geometry Equality

+ There are two ways of comparing geometries for equality: + structural equality and topological equality. +

Structural Equality

+ Structural Equality is provided by the + method. + This implements a comparison based on exact, structural pointwise + equality. + The is a synonym for this method, + to provide structural equality semantics for + use in collections. + It is important to note that structural pointwise equality + is easily affected by things like + ring order and component order. In many situations + it will be desirable to normalize geometries before + comparing them (using the + or methods). + is provided + as a convenience method to compute equality over + normalized geometries, but it is expensive to use. + Finally, + allows using a tolerance value for point comparison. + +

Topological Equality

+ Topological Equality is provided by the + method. + It implements the SFS definition of point-set equality + defined in terms of the DE-9IM matrix. + To support the SFS naming convention, the method + is also provided as a synonym. + However, due to the potential for confusion with + its use is discouraged. + + Since and are overridden, + Geometries can be used effectively in .Net collections. + +
+
+ + + + + + + An object reference which can be used to carry ancillary data defined + by the client. + + + + The bounding box of this Geometry. + + + + + Creates a new Geometry via the specified GeometryFactory. + + The factory + + + + Returns true if the array contains any non-empty Geometrys. + + an array of Geometrys; no elements may be null + + true if any of the Geometrys + IsEmpty methods return false. + + + + + Returns true if the array contains any null elements. + + an array to validate. + true if any of arrays elements are null. + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + Returns an element Geometry from a GeometryCollection, + or this, if the geometry is not a collection. + + The index of the geometry element. + The n'th geometry contained in this geometry. + + + + Returns the minimum distance between this Geometry + and another Geometry g. + + The Geometry from which to compute the distance. + The distance between the geometries + 0 if either input geometry is empty + if g is null + + + + Tests whether the distance from this Geometry + to another is less than or equal to a specified value. + + the Geometry to check the distance to. + the distance value to compare. + true if the geometries are less than distance apart. + + + + Notifies this geometry that its coordinates have been changed by an external + party (for example, via a ). + + + When this method is called the geometry will flush + and/or update any derived information it has cached (such as its ). + The operation is applied to all component Geometries. + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When GeometryChanged is called, this method will be called for + this Geometry and its component Geometries. + + + + + Tests whether this geometry is disjoint from the argument geometry. + + + The Disjoint predicate has the following equivalent definitions: + + The DE-9IM intersection matrix for the two geometries matches FF*FF****. + !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
+
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys are disjoint. + +
+ + + Tests whether this geometry touches the argument geometry + + + The Touches predicate has the following equivalent definitions: + + The geometries have at least one point in common, + but their interiors do not intersect + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns + + FT*******, + F**T***** or + F***T****. + + + If both geometries have dimension 0, the predicate returns false, + since points have only interiors. + This predicate is symmetric. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys touch; + Returns false if both Geometrys are points. + + + + + Tests whether this geometry intersects the argument geometry. + + + The Intersects predicate has the following equivalent definitions: + + The two geometries have at least one point in common + The DE-9IM Intersection Matrix for the two geometries matches
+ [T********] or
+ [*T*******] or
+ [***T*****] or
+ [****T****]
+ !g.disjoint(this)
+ (Intersects is the inverse of Disjoint)
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys intersect. + +
+ + + Tests whether this geometry crosses the specified geometry. + + + The Crosses predicate has the following equivalent definitions: + + The geometries have some but not all interior points in common. + The DE-9IM Intersection Matrix for the two geometries matches + one of the following patterns: + + CodeDescription + [T*T******]for P/L, P/A, and L/A situations + [T*****T**]for L/P, A/P, and A/L situations) + [0********]for L/L situations + + + + For any other combination of dimensions this predicate returns false. + + The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. + In order to make the relation symmetric, + NTS extends the definition to apply to L/P, A/P and A/L situations as well. + + + The Geometry with which to compare this Geometry + true if the two Geometrys cross. + + + + Tests whether this geometry is within the specified geometry. + + + The within predicate has the following equivalent definitions: + + + Every point of this geometry is a point of the other geometry, + and the interiors of the two geometries have at least one point in common. + + The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] + g.contains(this) == true
(Within is the converse of )
+
+ + An implication of the definition is that "The boundary of a geometry is not within the Polygon". + In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false + (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) + For a predicate with similar behaviour but avoiding + this subtle limitation, see . + +
+ The Geometry with which to compare this Geometry. + true if this Geometry is within other. + + +
+ + + + Tests whether this geometry overlaps the specified geometry. + + + The Overlaps predicate has the following equivalent definitions: + + The geometries have at least one point each not shared by the other (or equivalently neither covers the other), + they have the same dimension, + and the intersection of the interiors of the two geometries has + the same dimension as the geometries themselves. + The DE-9IM Intersection Matrix for the two geometries matches + [T*T***T**] (for two points or two surfaces) + or [1*T***T**] (for two curves) + + If the geometries are of different dimension this predicate returns false. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys overlap. + For this function to return true, the Geometry + s must be two points, two curves or two surfaces. + + + + + Tests whether this geometry covers the argument geometry + + + The covers predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry. + The DE-9IM Intersection Matrix for the two geometries matches at least + one of the following patterns: + + [T*****FF*] or
+ [*T****FF*] or
+ [***T**FF*] or
+ [****T*FF*] +
+
+ g.CoveredBy(this) == true
+ (covers is the converse of )
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + In particular, unlike Contains it does not distinguish between + points in the boundary and in the interior of geometries. + For most situations, Covers should be used in preference to Contains. + As an added benefit, Covers is more amenable to optimization, + and hence should be more performant. + +
+ The Geometry with which to compare this Geometry + true if this Geometry covers + + +
+ + Tests whether this geometry is covered by the specified geometry. + + The CoveredBy predicate has the following equivalent definitions: + + Every point of this geometry is a point of the other geometry. + + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns: + + [T*F**F***] + [*TF**F***] + [**FT*F***] + [**F*TF***] + g.Covers(this) == true
+ (CoveredBy is the converse of ) +
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + +
+ the Geometry with which to compare this Geometry + true if this Geometry is covered by g + + +
+ + + Tests whether the elements in the DE-9IM + for the two Geometrys match the elements in intersectionPattern. + + + The pattern is a 9-character string, with symbols drawn from the following set: + + 0 (dimension 0) + 1 (dimension 1) + 2 (dimension 2) + T ( matches 0, 1 or 2) + F ( matches FALSE) + * ( matches any value) + For more information on the DE-9IM, see the OpenGIS Simple Features + Specification. + + the Geometry with which to compare this Geometry + the pattern against which to check the + intersection matrix for the two Geometrys + true if the DE-9IM intersection + matrix for the two Geometrys match intersectionPattern + + + + + Returns the DE-9IM intersection matrix for the two Geometrys. + + The Geometry with which to compare this Geometry + + A matrix describing the intersections of the interiors, + boundaries and exteriors of the two Geometrys. + + + + + Tests whether this geometry is + topologically equal to the argument geometry. + + This method is included for backward compatibility reasons. + It has been superseded by the method, + which has been named to clearly denote its functionality. + + This method should NOT be confused with the method + , which implements + an exact equality comparison. + + The Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal. + + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS Equals predicate. + + + The SFS equals predicate has the following equivalent definitions: + + The two geometries have at least one point in common, + and no point of either geometry lies in the exterior of the other geometry. + The DE-9IM Intersection Matrix for the two geometries matches + the pattern T*F**FFF* +
+            T*F
+            **F
+            FF*
+            
+
+ Note that this method computes topologically equality. + For structural equality, see {@link #equalsExact(Geometry)}. +
+ the Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal +
+ + + Tests whether this geometry is structurally and numerically equal + to a given Object. + + + If the argument Object is not a Geometry, + the result is false. + Otherwise, the result is computed using + . + + This method is provided to fulfill the Java contract + for value-based object equality. + In conjunction with + it provides semantics which are most useful + for using + Geometrys as keys and values in Java collections. + + Note that to produce the expected result the input geometries + should be in normal form. It is the caller's + responsibility to perform this where required + (using + or as appropriate). + + The object to compare + true if this geometry is exactly equal to the argument + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets a hash code for the Geometry. + + + An integer value suitable for use as a hashcode + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + + + + + + + Returns the Well-known Binary representation of this Geometry. + For a definition of the Well-known Binary format, see the OpenGIS Simple + Features Specification. + + The Well-known Binary representation of this Geometry. + + + + + + + + + + Returns the feature representation as GML 2.1.1 XML document. + This XML document is based on Geometry.xsd schema. + NO features or XLink are implemented here! + + + + + Computes a buffer area around this geometry having the given width. The + buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The buffer geometry is constructed using 8 segments per quadrant to approximate + the circular arcs. + The end cap style is BufferStyle.CapRound. + + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified accuracy of approximation for circular arcs. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + + + + Returns the smallest convex Polygon that contains all the + points in the Geometry. This obviously applies only to Geometry + s which contain 3 or more points. + + the minimum-area convex polygon containing this Geometry's points. + + + + Computes a new geometry which has all component coordinate sequences + in reverse order (opposite orientation) to this one. + + A reversed geometry + + + + Computes a Geometry representing the point-set which is + common to both this Geometry and the other Geometry. + + The intersection of two geometries of different dimension produces a result + geometry of dimension less than or equal to the minimum dimension of the input + geometries. + The result geometry may be a heterogenous . + If the result is empty, it is an atomic geometry + with the dimension of the lowest input dimension. + + Intersection of s is supported + only for homogeneous collection types. + + Non-empty heterogeneous arguments are not supported. + + The Geometry with which to compute the intersection. + A geometry representing the point-set common to the two Geometrys. + if a robustness error occurs. + if the argument is a non-empty heterogenous GeometryCollection + + + + Computes a Geometry representing the point-set + which is contained in both this + Geometry and the other Geometry. + + + The method may be used on arguments of different dimension, but it does not + support arguments. + + The union of two geometries of different dimension produces a result + geometry of dimension equal to the maximum dimension of the input + geometries. + The result geometry may be a heterogenous + . + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Unioning s has the effect of + noding and dissolving the input linework. In this context + "noding" means that there will be a node or endpoint in the result for + every endpoint or line segment crossing in the input. "Dissolving" means + that any duplicate (i.e. coincident) line segments or portions of line + segments will be reduced to a single line segment in the result. + If merged linework is required, the + class can be used. + + Non-empty arguments are not supported. + the Geometry with which to compute the union + A point-set combining the points of this Geometry and the + points of other + Thrown if a robustness error occurs + Thrown if either input is a non-empty GeometryCollection + + + + + Computes a Geometry representing the closure of the point-set + of the points contained in this Geometry that are not contained in + the other Geometry. + + If the result is empty, it is an atomic geometry + with the dimension of the left-hand input. + + Non-empty arguments are not supported. + + The Geometry with which to compute the difference. + A Geometry representing the point-set difference of this Geometry with other. + + + + Computes a Geometry representing the closure of the point-set + which is the union of the points in this Geometry which are not + contained in the other Geometry, + with the points in the other Geometry not contained in this + Geometry. + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Non-empty arguments are not supported. + + The Geometry with which to compute the symmetric difference. + a Geometry representing the point-set symmetric difference of this Geometry with other. + + + + Computes the union of all the elements of this geometry. + + + This method supports s (which the other overlay operations currently do not). + + The result obeys the following contract: + + Unioning a set of s has the effect of fully noding and dissolving the linework. + Unioning a set of s always returns a geometry + (unlike ), which may return geometries of lower dimension if a topology + collapse occurred). + + + Thrown if a robustness error occurs + + + + Returns true if the two Geometrys are exactly equal, + up to a specified tolerance. + Two Geometries are exactly within a tolerance equal if: + + they have the same class, + they have the same values of Coordinates, + within the given tolerance distance, in their internal + Coordinate lists, in exactly the same order. + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry + have identical structure and point values, up to the distance tolerance. + Distance at or below which two Coordinates will be considered equal. + + true if this and the other Geometry + are of the same class and have equal internal data. + + + + + + + + Returns true if the two Geometrys are exactly equal. + Two Geometries are exactly equal if: + + they have the same class, + they have the same values of Coordinates in their internal + Coordinate lists, in exactly the same order. + + This provides a stricter test of equality than + , which is more useful + in certain situations + (such as using geometries as keys in collections). + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry. + + true if this and the other Geometry have identical structure and point values. + + + + + Tests whether two geometries are exactly equal + in their normalized forms. + + This is a convenience method which creates normalized + versions of both geometries before computing + . + This method is relatively expensive to compute. + For maximum performance, the client + should instead perform normalization on the individual geometries + at an appropriate point during processing. + + + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + Performs an operation with or on this Geometry's coordinates. + + + If this method modifies any coordinate values, + must be called to update the geometry state. + Note that you cannot use this method to + modify this Geometry if its underlying CoordinateSequence's #get method + returns a copy of the Coordinate, rather than the actual Coordinate stored + (if it even stores Coordinate objects at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + + + If the filter reports that a coordinate value has been changed, + will be called automatically. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + + + + + + + Converts this Geometry to normal form (or canonical form ). + + + + Normal form is a unique representation for Geometrys. + It can be used to test whether two Geometrys are equal + in a way that is independent of the ordering of the coordinates within + them. Normal form equality is a stronger condition than topological + equality, but weaker than pointwise equality. + + The definitions for normal + form use the standard lexicographical ordering for coordinates. "Sorted in + order of coordinates" means the obvious extension of this ordering to + sequences of coordinates. + + + NOTE that this method mutates the value of this geometry in-place. + If this is not safe and/or wanted, the geometry should be + cloned prior to normalization. + + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry, using the given . + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + A IComparer<ICoordinateSequence> + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether the two Geometrys are equal, from the point + of view of the EqualsExact method. Called by EqualsExact + . In general, two Geometry classes are considered to be + "equivalent" only if they are the same class. An exception is LineString + , which is considered to be equivalent to its subclasses. + + The Geometry with which to compare this Geometry for equality. + + true if the classes of the two Geometry + s are considered to be equal by the equalsExact method. + + + + + Throws an exception if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + if g is a GeometryCollection, but not one of its subclasses. + + + + + Returns true if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + If g is a GeometryCollection, but not one of its subclasses. + + + + + Returns the minimum and maximum x and y values in this Geometry, + or a null Envelope if this Geometry is empty. + Unlike EnvelopeInternal, this method calculates the Envelope + each time it is called; EnvelopeInternal caches the result + of this method. + + + This Geometrys bounding box; if the Geometry + is empty, Envelope.IsNull will return true. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry having the same class. + + A Geometry having the same class as this Geometry. + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry of the same class. + using the given . + + A Geometry having the same class as this Geometry + The comparer + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the JTS Technical + Specifications + + + + + Returns the first non-zero result of CompareTo encountered as + the two Collections are iterated over. If, by the time one of + the iterations is complete, no non-zero result has been encountered, + returns 0 if the other iteration is also complete. If b + completes before a, a positive number is returned; if a + before b, a negative number. + + A Collection of IComparables. + A Collection of IComparables. + The first non-zero compareTo result, if any; otherwise, zero. + + + + + + + + + + + + + + + + + + + + + A predefined with == . + + + + + + + Gets the factory which contains the context in which this point was created. + + The factory for this point. + + + + Gets/Sets the user data object for this point, if any. + + + A simple scheme for applications to add their own custom data to a Geometry. + An example use might be to add an object representing a Coordinate Reference System. + Note that user data objects are not present in geometries created by + construction methods. + + + + + Sets the ID of the Spatial Reference System used by the Geometry. + + + + NOTE: This method should only be used for exceptional circumstances or + for backwards compatibility. Normally the SRID should be set on the + used to create the geometry. + SRIDs set using this method will not be propagated to + geometries returned by constructive methods. + + + + + + Returns the name of this Geometry's actual class. + + The name of this Geometrys actual class. + + + + Gets the OGC geometry type + + + + + Returns the PrecisionModel used by the Geometry. + + + the specification of the grid of allowable points, for this + Geometry and all other Geometrys. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the number of Geometryes in a GeometryCollection, + or 1, if the geometry is not a collection. + + + + + Tests whether this is simple. + + The SFS definition of simplicity + follows the general rule that a Geometry is simple if it has no points of + self-tangency, self-intersection or other anomalous points. + + Simplicity is defined for each subclass as follows: + + Valid polygonal geometries are simple, since their rings + must not self-intersect. IsSimple + tests for this condition and reports false if it is not met. + (This is a looser test than checking for validity). + Linear rings have the same semantics. + Linear geometries are simple iff they do not self-intersect at points + other than boundary points. + Zero-dimensional geometries (points) are simple iff they have no + repeated points. + Empty Geometrys are always simple. + + + true if this Geometry is simple + + + + + Tests whether this Geometry is topologically + valid, according to the OGC SFS specification. + For validity rules see the documentation for the specific geometry subclass. + + true if this Geometry is valid. + + + + Tests whether the set of points covered in this Geometry is empty. + + true if this Geometry does not cover any points. + + + + Returns the area of this Geometry. + Areal Geometries have a non-zero area. + They override this function to compute the area. + Others return 0.0 + + The area of the Geometry. + + + + Returns the length of this Geometry. + Linear geometries return their length. + Areal geometries return their perimeter. + They override this function to compute the length. + Others return 0.0 + + The length of the Geometry. + + + + Computes the centroid of this Geometry. + The centroid + is equal to the centroid of the set of component Geometries of highest + dimension (since the lower-dimension geometries contribute zero + "weight" to the centroid). + + The centroid of an empty geometry is POINT EMPTY. + + A Point which is the centroid of this Geometry. + + + + Computes an interior point of this Geometry. + + + An interior point is guaranteed to lie in the interior of the Geometry, + if it possible to calculate such a point exactly. Otherwise, + the point may lie on the boundary of the point. + + The interior point of an empty geometry is POINT EMPTY. + + A Point which is in the interior of this Geometry. + + + + + + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the boundary, or an empty geometry of appropriate dimension + if this Geometry is empty. + For a discussion of this function, see the OpenGIS Simple + Features Specification. As stated in SFS Section 2.1.13.1, "the boundary + of a Geometry is a set of Geometries of the next lower dimension." + + The closure of the combinatorial boundary of this Geometry. + NOTE: make abstract, remove setter and change geoapi + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + Gets a geometry representing the envelope (bounding box) of this Geometry. + + If this Geometry is + + empty, returns an empty Point + a point, returns a Point + a line parallel to an axis, a two-vertex LineString, + otherwise, returns a + Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, + maxy), (minx, maxy), (minx, miny). + + + + A Geometry representing the envelope of this Geometry + + + + + + Gets an containing + the minimum and maximum x and y values in this Geometry. + If the geometry is empty, an empty Envelope + is returned. + + + The returned object is a copy of the one maintained internally, + to avoid aliasing issues. + For best performance, clients which access this + envelope frequently should cache the return value. + the envelope of this Geometry. + An empty Envelope if this Geometry is empty + + + + + + + + + + + + + + + Extension Methods for geometries + + + + + Function to encode to an array of s. If assigned, is used. + + The geometry to encode + The writer to use + An array of s, that represent + + + + Delegate function declaration to handle filter operation + + The geometry to filter + + + + An implementation that applies filtering with the provided + + + + + Creates an instance of this class + + The filter method to be used + + + + OGC compliant geometry factory + + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + Note that the factory constructor methods do not change the input coordinates in any way. + In particular, they are not rounded to the supplied PrecisionModel. + It is assumed that input Coordinates meet the given precision. + + + + + A predefined with + == . + + + + + A predefined with + == . + + A shortcut for . + + + + A predefined with + == . + + + + + A predefined with + == . + + + + + + + + + + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. + + + + + Constructs a GeometryFactory that generates Geometries having the given + CoordinateSequence implementation, a double-precision floating PrecisionModel and a + spatial-reference ID of 0. + + + + + Constructs a GeometryFactory that generates Geometries having the given + {PrecisionModel} and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel and spatial-reference ID, and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + The SRID to use. + + + + Constructs a GeometryFactory that generates Geometries having a floating + PrecisionModel and a spatial-reference ID of 0. + + + + + Converts the ICollection to an array. + + The ICollection of Points to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Geometry's to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LinearRings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Polygons to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPoints to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiLineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPolygons to convert. + The ICollection in array format. + + + + Creates a with the same extent as the given envelope. + + + + The Geometry returned is guaranteed to be valid. + To provide this behaviour, the following cases occur: + + + If the Envelope is: +
    +
  • null returns an empty
  • +
  • a point returns a non-empty
  • +
  • a line returns a two-point
  • +
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
  • +
+
+
+ The Envelope + + An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases) + +
+ + + Creates a Point using the given Coordinate. + A null coordinate creates an empty Geometry. + + a Coordinate, or null + A object + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + a CoordinateSequence (possibly empty), or null + A object + + + + Creates a LineString using the given Coordinates. + A null or empty array creates an empty LineString. + + An array without null elements, or an empty array, or null. + A object + + + + Creates a LineString using the given CoordinateSequence. + A null or empty CoordinateSequence creates an empty LineString. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a LinearRing using the given Coordinates; a null or empty array + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A object + If the ring is not closed, or has too few points + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence (possibly empty), or null. + A object + If the ring is not closed, or has too few points + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + A object + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + the created Polygon + If the boundary ring is invalid + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + A object + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + A object + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + an array of Geometries, each of which may be empty but not null, or null + A object + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned.
+ If geomList contains several Polygons, a + MultiPolygon is returned.
+ If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned.
+ If geomList is empty, an empty GeometryCollection + is returned. + Note that this method does not "flatten" Geometries in the input, and hence if + any MultiGeometries are contained in the input a GeometryCollection containing + them will be returned. +
+ The Geometry to combine. + + A of the "smallest", "most type-specific" + class that can contain the elements of geomList. + +
+ + + Creates a deep copy of the input . + The defined for this factory + is used to copy the s + of the input geometry. + + This is a convenient way to change the CoordinateSequence + used to represent a geometry, or to change the + factory used for a geometry. + + can also be used to make a deep copy, + but it does not allow changing the CoordinateSequence type. + + The geometry + A deep copy of the input geometry, using the CoordinateSequence type of this factory + + + + + Returns the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + + + + + + The SRID value defined for this factory. + + + + + Creates an instance of this class using the default + values for , + and + . + + + + + Creates an instance of this class using the default + values for , + , + but the specified . + + + + Creates an instance of this class using the default + values for , + but the + specified . + + + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. +
The are guaranteed to be orientated clockwise. +
+
+ + + Methods to map various collections + of s + via defined mapping functions. + + Martin Davis + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation delegate + A result collection or geometry of most specific type + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation + A result collection or geometry of most specific type + + + + An interface for geometry functions used for mapping. + + Martin Davis + + + + Computes a new geometry value. + + The input geometry + A result geometry + + + + Represents an (1-dimensional) closed interval on the Real number line. + + + + + Creates a new interval instance, setting ==0d; + + + + + Creates a new interval instance, setting = and =; + + The minimum value + The maximum value + + + + Creates a new interval instance, setting = and =. + + + + + + Method to initialize the interval with the given and values.
+ If < , their values are exchanged. +
+ The minimum value + The maximum value +
+ + + Method to expand this interval to contain . + + The interval to contain. + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval R[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval R[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval R[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval R[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Gets or sets a value indicating the minimum value of the closed interval. + + + + + Gets or sets a value indicating the maximum value of the closed interval. + + + + + Gets the width of the interval ( - ) + + + + + Gets the centre of the interval ( + * 0.5d) + + + + + A visitor for s in a index. + + 1.7 + + + + Visits a node. + + The node to visit + + + + A contiguous portion of 1D-space. Used internally by SIRtree. + + + + + + + + + + + + + + + + + + + + + this + + + + + + + this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writes a formatted string containing the KML representation + of a JTS . + The output is KML fragments which can be substituted + wherever the KML abstract + element can be used. + + + Output elements are indented to provide a + nicely-formatted representation. + An output line prefix and maximum + number of coordinates per line can be specified. + + + The Z ordinate value output can be forced to be a specific value. + The and modes can be set. + If set, the corresponding sub-elements will be output. + + + + + The KML standard value clampToGround for use in . + + + + + The KML standard value relativeToGround for use in . + + + + + The KML standard value absolute for use in . + + + + + Writes a Geometry as KML to a string, using + a specified Z value. + + the geometry to write + the Z value to use + a string containing the KML geometry representation + + + + Writes a Geometry as KML to a string, using + a specified Z value, precision, extrude flag, + and altitude mode code. + + the geometry to write + the Z value to use + the maximum number of decimal places to write + the extrude flag to write + the altitude model code to write + a string containing the KML geometry representation + + + + Writes a in KML format as a string. + + the geometry to write + a string containing the KML geometry representation + + + + Writes the KML representation of a to a . + + the geometry to write + the writer to write to + + + + Appends the KML representation of a to a . + + the geometry to write + the buffer to write into + + + + Takes a list of coordinates and converts it to KML. + + + 2D and 3D aware. Terminates the coordinate output with a newline. + + + + + A tag string which is prefixed to every emitted text line. + This can be used to indent the geometry text in a containing document. + + + + + The maximum number of coordinates to output per line. + + + + + The Z value to be output for all coordinates. + This overrides any Z value present in the Geometry coordinates. + + + + + The flag to be output in the extrude element. + + + + + The flag to be output in the tesselate element. + + + + + The value output in the altitudeMode element. + + + + + The maximum number of decimal places to output in ordinate values. + Useful for limiting output size. + + + negative values set the precision to , + like standard behavior. + + + + + Reads a sequence of {@link Geometry}s in WKBHex format + from a text file. + Each WKBHex geometry must be on a single line + The geometries in the file may be separated by any amount + of whitespace and newlines. + + Martin Davis + + + + Creates a new given the + to use to parse the geometries. + + The geometry reader to use + + + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no filename was specified + Thrown if the filename specified does not exist + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no stream was passed + Thrown if passed stream is not readable or seekable + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The stream reader to use. + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Tests if reader has reached limit + + A collection of already read geometries + true if number of geometries has been read. + + + + Tests if reader is at EOF. + + + + + Gets or sets a value indicating the maximum number of geometries to read + + + + + Gets or sets the number of geometries to skip before storing. + + + + + Enumeration for the 3 coordinate planes + + + + + Models a plane in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the oriented distance from a point to the plane.
+ The distance is: + + positive if the point lies above the plane (relative to the plane normal) + zero if the point is on the plane + negative if the point lies below the plane (relative to the plane normal) + +
+ The point to compute the distance for + The oriented distance to the plane +
+ + + Computes the axis plane that this plane lies closest to. + + Geometries lying in this plane undergo least distortion + (and have maximum area) + when projected to the closest axis plane. + This provides optimal conditioning for + computing a Point-in-Polygon test. + + The index of the closest axis plane + + + + Represents a vector in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the dot product of the 3D vectors AB and CD. + + A coordinate + A coordinate + A coordinate + A coordinate + The dot product + + + + Creates a new vector with given , and components. + + The x component + The y component + The z component + A new vector + + + + Creates a new vector from a . + + The coordinate to copy + A new vector + + + + Computes the 3D dot-product of two s + + The 1st vector + The 2nd vector + The dot product of the (coordinate) vectors + + + + Creates a vector, that is the difference of and + + The origin coordinate + The destination coordinate + + + + Creates a vector with the ordinates , and + + The x-ordinate + The y-ordinate + The z-ordinate + + + + Computes the dot-product of this and + + The 2nd vector + The dot product of the vectors + + + + Function to compute the length of this vector + + The length of this vector + + + + Function to compute the length of vector . + + A coordinate, treated as vector + The length of + + + + Function to compute a normalized form of this vector + + A normalized form of this vector + + + + Function to devide all dimensions of this vector by . + + The divisor + A new (divided) vector + + + + Function to compute a normalized form of vector . + + A coordinate vector + A normalized form of + + + + Gets a value indicating the x-ordinate + + + + + Gets a value indicating the y-ordinate + + + + + Gets a value indicating the z-ordinate + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + + + + Processes possible intersections detected by a . + + + + The is passed to a . + + The + method is called whenever the + detects that two s might intersect. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + This class is an example of the Strategy pattern. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + + + This method is called by clients + of the interface to process + intersections for two segments of the s being intersected. + + + + + + + + + Reports whether the client of this class needs to continue testing + all intersections in an arrangement. + + if there is no need to continue testing segments + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Intersects two sets of s using + brute-force comparison. + + + + + An intersector for the red-blue intersection problem. + In this class of line arrangement problem, + two disjoint sets of linestrings are intersected. + + Implementing classes must provide a way + of supplying the base set of segment strings to + test against (e.g. in the constructor, + for straightforward thread-safety). + + In order to allow optimizing processing, + the following condition is assumed to hold for each set: + + the only intersection between any two linestrings occurs at their endpoints. + + Implementations can take advantage of this fact to optimize processing + (i.e by avoiding testing for intersections between linestrings + belonging to the same set). + + + + + Computes the intersections with a given set of s, + using the supplied . + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of base segments. + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Processes all of the segment pairs in the given segment strings + using the given SegmentIntersector. + + A segment string + A segment string + The segment intersector to use + + + + A geometry service provider class + + + + + Creates an instance of this class, using the as default and a precision model. No is specified + + + + + Creates an instance of this class, using the provided , and spatial reference Id (. + + The coordinate sequence factory to use. + The precision model. + The default spatial reference ID + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Gets or sets the current instance + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Gets a value representing the number of geometry factories that have been stored in the cache + + + + + A pair of s, whose leaf items + support a distance metric between them. + Used to compute the distance between the members, + and to expand a member relative to the other + in order to produce new branches of the + Branch-and-Bound evaluation tree. + Provides an ordering based on the distance between the members, + which allows building a priority queue by minimum distance. + + Martin Davis + + + + Creates an instance of this class with the given s and the function. + + The first boundable + The second boundable + The item distance function + + + + Gets one of the member s in the pair + (indexed by [0, 1]). + + The index of the member to return (0 or 1) + The chosen member + + + + Computes the distance between the s in this pair. + The boundables are either composites or leaves. + If either is composite, the distance is computed as the minimum distance + between the bounds. + If both are leaves, the distance is computed by . + + The distance between the s in this pair. + + + + Compares two pairs based on their minimum distances + + + + + For a pair which is not a leaf + (i.e. has at least one composite boundable) + computes a list of new pairs + from the expansion of the larger boundable. + + + + + Gets the minimum possible distance between the Boundables in + this pair. + If the members are both items, this will be the + exact distance between them. + Otherwise, this distance will be a lower bound on + the distances between the items in the members. + + The exact or lower bound distance for this pair + + + + Tests if both elements of the pair are leaf nodes + + + + + An function for + items which are using the method. + + Martin Davis + + + + A function method which computes the distance + between two s in an . + Used for Nearest Neighbour searches. + + Martin Davis + + + + Computes the distance between two items. + + The first item. + The second item. + If the metric is not applicable to the arguments + The distance between and . + + + + Computes the distance between two items, + using the method. + + An item which is a geometry. + An item which is a geometry. + if either item is not a Geometry + The distance between the two items. + + + + Implements extended-precision floating-point numbers + which maintain 106 bits (approximately 30 decimal digits) of precision. + + A DoubleDouble uses a representation containing two double-precision values. + A number x is represented as a pair of doubles, x.hi and x.lo, + such that the number represented by x is x.hi + x.lo, where +
+                |x.lo| <= 0.5*ulp(x.hi)
+            
+ and ulp(y) means "unit in the last place of y". + The basic arithmetic operations are implemented using + convenient properties of IEEE-754 floating-point arithmetic. + + The range of values which can be represented is the same as in IEEE-754. + The precision of the representable numbers + is twice as great as IEEE-754 double precision. + + The correctness of the arithmetic algorithms relies on operations + being performed with standard IEEE-754 double precision and rounding. + This is the Java standard arithmetic model, but for performance reasons + Java implementations are not + constrained to using this standard by default. + Some processors (notably the Intel Pentium architecure) perform + floating point operations in (non-IEEE-754-standard) extended-precision. + A JVM implementation may choose to use the non-standard extended-precision + as its default arithmetic mode. + To prevent this from happening, this code uses the + Java strictfp modifier, + which forces all operations to take place in the standard IEEE-754 rounding model. + + The API provides both a set of value-oriented operations + and a set of mutating operations. + Value-oriented operations treat DoubleDouble values as + immutable; operations on them return new objects carrying the result + of the operation. This provides a simple and safe semantics for + writing DoubleDouble expressions. However, there is a performance + penalty for the object allocations required. + The mutable interface updates object values in-place. + It provides optimum memory performance, but requires + care to ensure that aliasing errors are not created + and constant values are not changed. + + This implementation uses algorithms originally designed variously by + Knuth, Kahan, Dekker, and Linnainmaa. + Douglas Priest developed the first C implementation of these techniques. + Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al. +

References

+ + Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, + in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, + IEEE Computer Society Press, Los Alamitos, Calif., 1991. + Yozo Hida, Xiaoye S. Li and David H. Bailey, + Quad-Double Arithmetic: Algorithms, Implementation, and Application, + manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. + David Bailey, High Precision Software Directory; + http://crd.lbl.gov/~dhbailey/mpdist/index.html + +
+ Martin Davis +
+ + + The value to split a double-precision value on during multiplication + + + + The value nearest to the constant Pi. + + + The value nearest to the constant 2 * Pi. + + + The value nearest to the constant Pi / 2. + + + + The value nearest to the constant e (the natural logarithm base). + + + + + A value representing the result of an operation which does not return a valid number. + + + + + The smallest representable relative difference between two values + + + + + Converts the string argument to a DoubleDouble number. + + A string containing a representation of a numeric value + The extended precision version of the value + Thrown if is not a valid representation of a number + + + Converts the double argument to a DoubleDouble number. + + @param x a numeric value + @return the extended precision version of the value + + + The high-order component of the double-double precision value. + + + The low-order component of the double-double precision value. + + + + Creates a new with value x. + + The initial value + + + + Creates a new with value (hi, lo). + + The high order component + The low order component + + + + Creates a with a value equal to the argument + + The initial value + + + Creates a new DoubleDouble with value equal to the argument. + + @param str the value to initialize by + @throws NumberFormatException if str is not a valid representation of a number + + + + Creates a new with the value of the argument. + + The value to copy + A copy of + + + + Creates and returns a copy of this value. + + Acopy of this value + + + + Returns a whose value is (this + ) + + The addende"/> + (this + ) + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns a whose value is (this + y). + + The addend + (this + y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Returns a whose value is -this. + + -this + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + ** + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + ** + + + Returns a DoubleDouble whose value is 1 / this. + + @return the reciprocal of this value + + + + Computes the minimum of this and another DD number. + + A DD number + The minimum of the two numbers + + + + Computes the maximum of this and another DD number. + + A DD number + The maximum of the two numbers + + + + + + Returns an integer indicating the sign of this value. + + + if this value is > 0, returns 1 + if this value is < 0, returns -1 + if this value is = 0, returns 0 + if this value is NaN, returns 0 + + + + An integer indicating the sign of this value + + + + Rounds this value to the nearest integer. + The value is rounded to an integer by adding 1/2 and taking the floor of the result. + Special cases: + + If this value is NaN, returns NaN. + + + This value rounded to the nearest integer + + + + Returns the integer which is largest in absolute value and not further + from zero than this value. + + Special cases: + + If this value is NaN, returns NaN. + + + + The integer which is largest in absolute value and not further from zero than this value + + + + + Returns the absolute value of this value. + + Special cases: + + if this value is NaN, it is returned. + + + The absolute value of this value + + + + Computes the square of this value. + + The square of this value + + + + Computes the square of this value. + + The square of this value. + + + Computes the positive square root of this value. + If the number is NaN or negative, NaN is returned. + + @return the positive square root of this number. + If the argument is NaN or less than zero, the result is NaN. + + + + Computes the value of this number raised to an integral power. + Follows semantics of .Net Math.Pow as closely as possible. + + The integer exponent + x raised to the integral power exp + + + Converts this value to the nearest double-precision number. + + @return the nearest double-precision number to this value + + + Converts this value to the nearest integer. + + @return the nearest integer to this value + + + + Gets a value indicating whether this object is positive or not + + + + + Gets a value indicating whether this object is positive or not + + + + Tests whether this value is equal to another DoubleDouble value. + + @param y a DoubleDouble value + @return true if this value = y + + + Tests whether this value is greater than another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value > y + + + Tests whether this value is greater than or equals to another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value >= y + + + + Tests whether this value is less than another DoubleDouble value. + + A DoubleDouble value + true if this value is < + + + + Compares two DoubleDouble objects numerically. + + @return -1,0 or 1 depending on whether this value is less than, equal to + or greater than the value of o + + + + Dumps the components of this number to a string. + + A string showing the components of the number + + + + Returns a string representation of this number, in either standard or scientific notation. + If the magnitude of the number is in the range [ 10-3, 108 ] + standard notation will be used. Otherwise, scientific notation will be used. + + A string representation of this number + + + + Returns the string representation of this value in standard notation. + + The string representation in standard notation + + + + Returns the string representation of this value in scientific notation. + + The string representation in scientific notation + + + Extracts the significant digits in the decimal representation of the argument. + A decimal point may be optionally inserted in the string of digits + (as long as its position lies within the extracted digits + - if not, the caller must prepend or append the appropriate zeroes and decimal point). + + @param y the number to extract ( >= 0) + @param decimalPointPos the position in which to insert a decimal point + @return the string containing the significant digits and possibly a decimal point + + + + Returns the string for this value if it has a known representation (e.g. NaN or 0.0). + + The string for this special number
+ or null if the number is not a special number
+
+ + + Determines the decimal magnitude of a number. + The magnitude is the exponent of the greatest power of 10 which is less than + or equal to the number. + + The number to find the magnitude of + The decimal magnitude of + + + + Converts a string representation of a real number into a DoubleDouble value. + The format accepted is similar to the standard Java real number syntax. + It is defined by the following regular expression: +
+            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
+            
+
+ The string to parse + The value of the parsed number + Thrown if str is not a valid representation of a number +
+ + + Gets a value indicating whether this object is zero (0) or not + + + + + Gets a value indicating whether this object is negative or not + + + + + Various utility functions for mathematical and numerical operations. + + + + + Clamps a double value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Clamps a int value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Computes the base-10 logarithm of a double value. + + + If the argument is NaN or less than zero, then the result is NaN. + If the argument is positive infinity, then the result is positive infinity. + If the argument is positive zero or negative zero, then the result is negative infinity. + + + + A positive number + The value log a, the base-10 logarithm of the input value + + + + + Computes the average of two numbers. + + A number + A number + The average of the inputs + + + + Computes the maximum fo three values + + A number + A number + A number + The maximum value of , and + + + + Computes the maximum of four values + + A number + A number + A number + A number + The maximum value of , , and + + + + Computes the minimum of four values + + A number + A number + A number + The minimum value of , and + + + + Computes the minimum of four values + + A number + A number + A number + A number + The minimum value of , , and + + + + Implements some 2D matrix operations + (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination. + In order to avoid overhead the algorithm runs in-place + on - if should not be modified the client must supply a copy. + + An nxn matrix in row/column order )modified by this method) + A vector of length n + A vector containing the solution (if any)
or null if the system has no or no unique solution +
+ If the matrix has the wrong size +
+ + + A 2-dimensional mathematical vector represented by double-precision X and Y components. + + mbdavis + + + + Creates a new vector with given X and Y components. + + The x component + The y component + A new vector + + + + Creates a new vector from an existing one. + + The vector to copy + A new vector + + + + Creates a vector from a . + + The coordinate to copy + A new vector + + + Creates a vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + A new vector + + + The X component of this vector. + + + The Y component of this vector. + + + + Creates an new vector instance + + + + + Creates a new vector instance using the provided and ordinates + + The x-ordinate value + The y-ordinate value + + + + Creates a new vector instance based on . + + The vector + + + Creates a new vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + + + + Creates a vector from a . + + The coordinate + A new vector + + + + Adds to this vector instance. + + The vector to add + The result vector + + + + Subtracts from this vector instance + + The vector to subtract + The result vector + + + + Multiplies the vector by a scalar value. + + The value to multiply by + A new vector with the value v * d + + + + Divides the vector by a scalar value. + + The value to divide by + A new vector with the value v / d + + + + Negates this vector + + A new vector with [-_x, -_y] + + + + + + + + + + + + + + + + Normalizes the vector + + A new normalized vector + + + + + + + + + + + Computes the weighted sum of this vector + with another vector, + with this vector contributing a fraction + of frac to the total. + + In other words, +
+            sum = frac * this + (1 - frac) * v
+            
+
+ The vector to sum + The fraction of the total contributed by this vector + The weighted sum of the two vectors +
+ + + Computes the distance between this vector and another one. + + A vector + The distance between the vectors + + + + Computes the dot-product of two vectors + + A vector + The dot product of the vectors + + + + Computes the angle this vector describes to the horizontal axis + + The angle + + + + + + + + + + + + + + + + + + Rotates this vector by + + The angle + The rotated vector + + + + Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 + degrees or Pi/2 radians). A positive number rotates counter-clockwise, a + negative number rotates clockwise. Under this operation the magnitude of + the vector and the absolute values of the ordinates do not change, only + their sign and ordinate index. + + The number of quarter-circles to rotate by + The rotated vector. + + + + + + + + + + + Gets a made of this vector translated by . + + The translation coordinate + A coordinate + + + + Gets a from this vector + + A coordinate + + + + Creates a copy of this vector + + A copy of this vector + + + + Gets a string representation of this vector + + A string representing this vector + + + + Tests if a vector has the same values for the x and y components. + + A with which to do the comparison. + true if is a with the same values for the X and Y components. + + + + Gets a hashcode for this vector. + + A hashcode for this vector + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + + Functions for performing vector mathematics. + + + + + Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each + triangle coordinate must have a Z value. If this is not the case, the returned Coordinate + will have NaN values. The returned vector has unit length. + + A point + A point + A point + The normal vector to the triangle -- + + + + Normalizes the vector + + The normalized + + + + Computes the cross product of and + + A vector + A vector + The cross product of and + + + + Computes the dot product of and + + A vector + A vector + The dot product of and + + + + Computes the determinant of a 2x2 matrix + + The m[0,0] value + The m[0,1] value + The m[1,0] value + The m[1,1] value + The determinant + + + + Helper class for transforming objects. + + + + + Transforms a object. + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Densifies a geometry by inserting extra vertices along the line segments + contained in the geometry. + All segments in the created densified geometry will be no longer than + than the given distance tolerance. + + + Densified polygonal geometries are guaranteed to be topologically correct. + The coordinates created during densification respect the input geometry's . + Note: At some future point this class will offer a variety of densification strategies. + + Martin Davis + + + + Densifies a geometry using a given distance tolerance, and respecting the input geometry's . + + The geometry densify + The distance tolerance () + The densified geometry + + + + Densifies a coordinate sequence. + + The coordinate sequence to densify + The distance tolerance () + The precision model to apply on the new coordinates + The densified coordinate sequence + + + Creates a new densifier instance + The geometry to densify + + + + Gets the densified geometry. + + The densified geometry + + + + Gets or sets the distance tolerance for the densification. All line segments + in the densified geometry will be no longer than the distance tolereance. + Simplified geometry will be within this distance of the original geometry. + The distance tolerance must be positive. + + + + + A framework for processes which transform an input Geometry into + an output , possibly changing its structure and type(s). + + + + This class is a framework for implementing subclasses + which perform transformations on + various different Geometry subclasses. + + + It provides an easy way of applying specific transformations + to given point types, while allowing unhandled types to be simply copied. + Also, the framework handles ensuring that if subcomponents change type + the parent geometries types change appropriately to maintain valid structure. + Subclasses will override whichever TransformX methods + they need to to handle particular Geometry types. + + + A typically usage would be a transformation that may transform Polygons into + Polygons, LineStrings or Points, depending on the geometry of the input + (For instance, a simplification operation). + This class would likely need to override the + method to ensure that if input Polygons change type the result is a GeometryCollection, + not a MultiPolygon. + + The default behaviour of this class is simply to recursively transform + each Geometry component into an identical object by deep copying down + to the level of, but not including, coordinates. + + + Note that all TransformXXX methods may return null, + to avoid creating empty point objects. This will be handled correctly + by the transformer. TransformXXX methods should always return valid + geometry - if they cannot do this they should return null + (for instance, it may not be possible for a transformLineString implementation + to return at least two points - in this case, it should return null). + The method itself will always + return a non-null Geometry object (but this may be empty). + > + + + + + + + + + true if empty geometries should not be included in the result. + + + + + true if a homogenous collection result + from a GeometryCollection should still + be a general GeometryCollection. + + + + + true if the type of the input should be preserved. + + + + + + + + + + + + Convenience method which provides standard way of + creating a CoordinateSequence. + + The coordinate array to copy. + A coordinate sequence for the array. + + + + Convenience method which provides statndard way of copying {CoordinateSequence}s + + The sequence to copy. + A deep copy of the sequence. + + + + Transforms a . + This method should always return a valid coordinate list for + the desired result type. (E.g. a coordinate list for a LineString + must have 0 or at least 2 points). + If this is not possible, return an empty sequence - + this will be pruned out. + + The coordinates to transform + The parent geometry + The transformed coordinates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Makes the input geometry available + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections + A valid area geometry + + + + Stores all attributes associated with a single Geometry feature. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the names + + + + + + + + + + + + + + + + + + + + + + + + Returns a string array containing + all names of present attributes. + + + + + + Returns a object array containing + all values of present attributes. + + + + + + Verifies if attribute specified already exists. + + + + + + + Build a field with the given value and add it to attributes table. + + Name of the new attribute. + Value for attribute (can be null). + If attribute already exists. + + + + Delete the specified attribute from the table. + + + + + + Return the System.Type of the specified attribute, + useful for casting values retrieved with GetValue methods. + + + + + + + Get the value of the specified attribute. + + + + + + + Set the value of the specified attribute. + + + + + + + + + + + + Get / Set the value of the specified attribute. + + + + + + + Feature class + + + + + + + + + + + + + + + + + Geometry representation of the feature. + + + + + Attributes table of the feature. + + + + + Angle orientation + + + + Constant representing no orientation + + + Constant representing straight orientation + + + Constant representing counterclockwise orientation + + + Constant representing left orientation + + + Constant representing clockwise orientation + + + Constant representing right orientation + + + + Utility functions for working with angles. + Unless otherwise noted, methods in this class express angles in radians. + + + + + Converts from radians to degrees. + + An angle in radians + The angle in degrees + + + + Converts from degrees to radians. + + An angle in degrees + The angle in radians + + + + Returns the angle of the vector from p0 to p1, relative to the positive X-axis. + + The angle is normalized to be in the range [ -Pi, Pi ]. + The start-point + The end-point + The normalized angle (in radians) that p0-p1 makes with the positive X-axis + + + + Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. + + + The angle is normalized to be in the range ( -Pi, Pi ]. + + The point + The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. + + + + Tests whether the angle between p0-p1-p2 is acute. + + + An angle is acute if it is less than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Tests whether the angle between p0-p1-p2 is obtuse + + + An angle is obtuse if it is greater than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Returns the unoriented smallest angle between two vectors. + + + The computed angle will be in the range [0, Pi). + + The tip of one vector + The tail of each vector + The tip of the other vector + + + + Returns the oriented smallest angle between two vectors. + The computed angle will be in the range (-Pi, Pi]. + A positive result corresponds to a rotation (CCW) from v1 to v2; + a negative result corresponds to a (CW) rotation; + a zero result corresponds to no rotation. + + The tip of v1 + The tail of each vector + The tip of v2 + The angle between v1 and v2, relative to v1 + + + + Computes the interior angle between two segments of a ring. + The ring is assumed to be oriented in a clockwise direction. + + The computed angle will be in the range [0, 2Pi] + A point of the ring + The next point of the ring + The next point of the ring + The interior angle based at p1 + + + + Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. + + An angle (in radians) + An angle (in radians) + Whether a1 must turn , or to overlap a2. + + + + Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. + + The angle to normalize + An equivalent angle in the range (-Pi, Pi] + + + + Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). + + E.g. + + + NormalizePositive(0.0) = 0.0 + NormalizePositive(-PI) = + NormalizePositive(-2PI) = 0.0 + NormalizePositive(-3PI) = + NormalizePositive(-4PI) = 0 + NormalizePositive(PI) = + NormalizePositive(2PI) = 0.0 + NormalizePositive(3PI) = + NormalizePositive(4PI) = 0.0 + + + + + The angle to normalize, in radians. + An equivalent positive angle + + + + Computes the unoriented smallest difference between two angles. + + + + The angles are assumed to be normalized to the range [-Pi, Pi]. + The result will be in the range [0, Pi]. + + + The angle of one vector (in [-Pi, Pi] ) + The angle of the other vector (in range [-Pi, Pi] ) + The angle (in radians) between the two vectors (in range [0, Pi] ) + + + + Useful utility functions for handling Coordinate arrays. + + + + + Tests whether an array of s forms a ring, by checking length and closure. + Self-intersection is not checked. + + An array of Coordinates + true if the coordinate form a ring. + + + + Finds a in a list of s + which is not contained in another list of s. + + The s to test. + An array of s to test the input points against. + + A from + which is not in , or null. + + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + + + + Determines which orientation of the array is (overall) increasing. + In other words, determines which end of the array is "smaller" + (using the standard ordering on ). + Returns an integer indicating the increasing direction. + If the sequence is a palindrome, it is defined to be + oriented in a positive direction. + + The array of Coordinates to test. + + 1 if the array is smaller at the start or is a palindrome, + -1 if smaller at the end. + + + + + Determines whether two arrays of equal length + are equal in opposite directions. + + + + + + + + Creates a deep copy of the argument Coordinate array. + + Array of Coordinates. + Deep copy of the input. + + + + Creates a deep copy of a given section of a source array into a destination Coordinate array. + The destination array must be an appropriate size to receive the copied coordinates. + + An array of Coordinates + The index to start copying from + The array to receive the deep-copied coordinates + The destination index to start copying to + The number of items to copy + + + + Converts the given of + s into a array. + + of coordinates. + + + If contains not only s. + + + + + Converts the given of + s into a array. + + of coordinates. + + + + + Returns whether Equals returns true for any two consecutive + coordinates in the given array. + + Array of Coordinates. + true if coord has repeated points; false otherwise. + + + + Returns either the given coordinate array if its length is greater than + the given amount, or an empty coordinate array. + + Length amount. + Array of Coordinates. + New Coordinate array. + + + + If the coordinate array argument has repeated points, + constructs a new array containing no repeated points. + Otherwise, returns the argument. + + + + + + + Collapses a coordinate array to remove all null elements. + + The coordinate array to collapse + An Array containing only non-null elements + + + + Reverses the coordinates in an array in-place. + + Array of Coordinates. + + + + Returns true if the two arrays are identical, both null, or pointwise + equal (as compared using Coordinate.Equals). + + First array of Coordinates. + Second array of Coordinates. + true if two Coordinates array are equals; false otherwise + + + + Returns true if the two arrays are identical, both null, or pointwise + equal, using a user-defined + for s. + + An array of s. + Another array of s. + + A for s. + + + + + + Returns the minimum coordinate, using the usual lexicographic comparison. + + Array to search. + The minimum coordinate in the array, found using CompareTo. + + + + Shifts the positions of the coordinates until firstCoordinate is first. + + Array to rearrange. + Coordinate to make first. + + + + Returns the index of in . + The first position is 0; the second is 1; etc. + + A to search for. + A array to search. + The position of coordinate, or -1 if it is not found. + + + + Extracts a subsequence of the input array + from indices to (inclusive). + The input indices are clamped to the array size; + If the end index is less than the start index, + the extracted array will be empty. + + The input array. + The index of the start of the subsequence to extract. + The index of the end of the subsequence to extract. + A subsequence of the input array. + + + + Computes the of the coordinates. + + the array to scan. + the of the . + + + Extracts the coordinates which intersect an {@link Envelope}. + + @param coordinates the coordinates to scan + @param env the envelope to intersect with + @return an array of the coordinates which intersect the envelope + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + Compares the specified s arrays. + + + + + + + + A comparator for arrays modulo their directionality. + E.g. if two coordinate arrays are identical but reversed + they will compare as equal under this ordering. + If the arrays are not equal, the ordering returned + is the ordering in the forward direction. + + + + + A backed by an array of s. + This is the implementation that s use by default. + + Coordinates returned by , and are live -- + modifications to them are actually changing the + CoordinateSequence's underlying data. + A dimension may be specified for the coordinates in the sequence, + which may be 2 or 3. + The actual coordinates will always have 3 ordinates, + but the dimension is useful as metadata in some situations. + + + + The actual dimension of the coordinates in the sequence. + Allowable values are 2 or 3. + + + + Constructs a sequence based on the given array of s. + The coordinate dimension is 3 + + + The array is not copied. + + The coordinate array that will be referenced. + + + + Constructs a sequence based on the given array + of s. + + The Array is not copied + The coordinate array that will be referenced. + The dimension of the coordinates + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Constructs a sequence of a given , populated + with new s of the given . + + The size of the sequence to create. + the dimension of the coordinates + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Get the Coordinate with index i. + + The index of the coordinate. + The requested Coordinate instance. + + + + Get a copy of the Coordinate with index i. + + The index of the coordinate. + A copy of the requested Coordinate. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Creates a deep copy of the object. + + The deep copy. + + + + + + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + This method exposes the internal Array of Coordinate Objects. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the string representation of the coordinate array. + + + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the length of the coordinate sequence. + + + + + Creates CoordinateSequences represented as an array of Coordinates. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Returns the singleton instance of CoordinateArraySequenceFactory. + + + + + A list of Coordinates, which may + be set to prevent repeated coordinates from occuring in the list. + + + + + Constructs a new list without any coordinates + + + + + Constructs a new list from an array of Coordinates, allowing repeated points. + (I.e. this constructor produces a with exactly the same set of points + as the input array.) + + Initial coordinates + + + + Constructs a new list from a collection of Coordinates, + allows repeated points. + + Collection of coordinates to load into the list. + + + + Constructs a new list from a collection of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Collection of coordinates to load into the list. + If false, repeated points are removed. + + + + Constructs a new list from an array of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Array of coordinates to load into the list. + If false, repeated points are removed. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Adds a section of an array of coordinates to the list. + + The coordinates + If set to false, repeated coordinates are collapsed + The index to start from + The index to add up to but not including + true (as by general collection contract) + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + If false, the array is added in reverse order. + Return true. + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the list. + + Coordinate to be inserted, as object. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the end of this list. + + Coordinate to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if all ok. + + + + Inserts the specified coordinate at the specified position in this list. + + The position at which to insert + the coordinate to insert + if set to false, repeated coordinates are collapsed + + + + Add an array of coordinates. + + Coordinates collection to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if at least one element has added (IList not empty). + + + + Ensure this coordList is a ring, by adding the start point if necessary. + + + + + Returns the Coordinates in this collection. + + Coordinater as Coordinate[] array. + + + + Returns a deep copy of this collection. + + The copied object. + + + + Compares two s. + + + For sequences of the same dimension, the ordering is lexicographic. + Otherwise, lower dimensions are sorted before higher. + The dimensions compared can be limited; if this is done + ordinate dimensions above the limit will not be compared. + + + If different behaviour is required for comparing size, dimension, + or coordinate values, any or all methods can be overridden. + + + + + Compare two doubles, allowing for NaN values. + NaN is treated as being less than any valid number. + + A double + A double + -1, 0, or 1 depending on whether a is less than, equal to or greater than b + + + The number of dimensions to test + + + Creates a comparator which will test all dimensions. + + + + + @param dimensionLimit + Creates a comparator which will test only the specified number of dimensions. + The number of dimensions to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 + + + + Compares the same coordinate of two s + + A coordinate sequence + A coordinate sequence + The index of the coordinate to test + the number of dimensiosn to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 + + + + Utility functions for manipulating s. + + + + + Reverses the coordinates in a sequence in-place. + + + + + + Swaps two coordinates in a sequence. + + seq the sequence to modify + the index of a coordinate to swap + the index of a coordinate to swap + + + + Copies a section of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinates from + The starting index of the coordinates to copy + The sequence to which the coordinates should be copied to + The starting index of the coordinates in + The number of coordinates to copy + + + + Copies a coordinate of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinate from + The index of the coordinate to copy + The sequence to which the coordinate should be copied to + The index of the coordinate in + + + + Tests whether a forms a valid , + by checking the sequence length and closure + (whether the first and last points are identical in 2D). + Self-intersection is not checked. + + The sequence to test + True if the sequence is a ring + + + + + Ensures that a CoordinateSequence forms a valid ring, + returning a new closed sequence of the correct length if required. + If the input sequence is already a valid ring, it is returned + without modification. + If the input sequence is too short or is not closed, + it is extended with one or more copies of the start point. + + The CoordinateSequenceFactory to use to create the new sequence + The sequence to test + The original sequence, if it was a valid ring, or a new sequence which is valid. + + + + Tests whether two s are equal. + To be equal, the sequences must be the same length. + They do not need to be of the same dimension, + but the ordinate values for the smallest dimension of the two + must be equal. + Two NaN ordinates values are considered to be equal. + + a CoordinateSequence + a CoordinateSequence + true if the sequences are equal in the common dimensions + + + + Creates a string representation of a . + The format is: + + ( ord0,ord1.. ord0,ord1,... ... ) + + + the sequence to output + the string representation of the sequence + + + + The CoordinateSequence implementation that Geometries use by default. In + this implementation, Coordinates returned by ToArray and GetCoordinates are live -- + parties that change them are actually changing the + DefaultCoordinateSequence's underlying data. + + + + + Constructs a DefaultCoordinateSequence based on the given array (the + array is not copied). + + Coordinate array that will be assimilated. + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns a copy of the coordinate at specified index. + + Coordinate index. + The copy of the coordinate specified. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns a deep copy of the object passed. + + The copied object. + + + + This method exposes the internal Array of Coordinate Objects. + + Coordinate[] array. + + + + Returns the string Representation of the coordinate array + + A string. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns the elements number of the coordinate sequence. + + + + + + Returns the elements number of the coordinate sequence. + + The length. + + + + Creates CoordinateSequences internally represented + as an array of x's and an array of y's. + + + + + + + + + + Returns a DefaultCoordinateSequence based on the given array + (the array is not copied). + + Coordinates array, which may not be null + nor contain null elements + Singleton instance of DefaultCoordinateSequenceFactory. + + + + Returns the singleton instance of DefaultCoordinateSequenceFactory. + + Singleton instance of DefaultCoordinateSequenceFactory. + + + + A coordinate sequence that follows the dotspatial shape range + + + + + Creates an instance of this class + + The + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The number of dimensions. + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The kind of ordinates. + + + + Creates a sequence based on the given coordinate sequence. + + The coordinate sequence. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Releases the weak reference to the weak referenced coordinate array + + This is necessary if you modify the values of the , , arrays externally. + + + + Gets the vector with x- and y-ordinate values; + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with z-ordinate values + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with measure values + + If you modify the values of this vector externally, you need to call ! + + + + A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, + and can be set. + + A coordinate sequence. + + + + Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. + + + + + + Gets the Ordinate flags that sequences created by this factory can cope with. + + + + + Basic implementation of GeometryCollection. + + + + + Represents an empty GeometryCollection. + + + + + Internal representation of this GeometryCollection. + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + For create this is used a standard + with == . + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a GeometryCollectionEnumerator: + this IEnumerator returns the parent geometry as first element. + In most cases is more useful the code + geometryCollectionInstance.Geometries.GetEnumerator(): + this returns an IEnumerator over geometries composing GeometryCollection. + + + + + + Creates a with + every component reversed. + The order of the components in the collection are not reversed. + + A in the reverse order + + + + + + + + + Collects all coordinates of all subgeometries into an Array. + Note that while changes to the coordinate objects themselves + may modify the Geometries in place, the returned Array as such + is only a temporary container which is not synchronized back. + + The collected coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "GeometryCollection" + + + + Gets the OGC geometry type + + + + + + + + + + Returns the area of this GeometryCollection. + + + + + Returns the length of this GeometryCollection. + + + + + Return true if all features in collection are of the same type. + + + + + Returns the iTh element in the collection. + + + + + + + Returns the number of geometries contained by this . + + + + + Iterates over all Geometry's in a GeometryCollection. + Implements a pre-order depth-first traversal of the GeometryCollection + (which may be nested). The original GeometryCollection is + returned as well (as the first object), as are all sub-collections. It is + simple to ignore the GeometryCollection objects if they are not + needed. + + + + + The GeometryCollection being iterated over. + + + + + Indicates whether or not the first element (the GeometryCollection) + has been returned. + + + + + The number of Geometrys in the the GeometryCollection. + + + + + The index of the Geometry that will be returned when next + is called. + + + + + The iterator over a nested GeometryCollection, or null + if this GeometryCollectionIterator is not currently iterating + over a nested GeometryCollection. + + + + + Constructs an iterator over the given GeometryCollection. + + + The collection over which to iterate; also, the first + element returned by the iterator. + + + + + + + + + + + + + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + + + The parent GeometryCollection is the first object returned! + + + + Models an OGC SFS LinearRing. + + + A LinearRing is a which is both closed and simple. + In other words, + the first and last coordinate in the ring must be equal, + and the interior of the ring must not self-intersect. + Either orientation of the ring is allowed. + + A ring must have either 0 or 4 or more points. + The first and last points must be equal (in 2D). + If these conditions are not met, the constructors throw + an + + + + + Models an OGC-style LineString + + + A LineString consists of a sequence of two or more vertices, + along with all points along the linearly-interpolated curves + (line segments) between each + pair of consecutive vertices. + Consecutive vertices may be equal. + The line segments in the line may intersect each other (in other words, + the linestring may "curl back" in itself and self-intersect. + Linestrings with exactly two identical points are invalid. + A linestring must have either 0 or 2 or more points. + If these conditions are not met, the constructors throw an . + + + + + + Represents an empty LineString. + + + + + The points of this LineString. + + + + + + + + + + + + + + + + + + + Creates a whose coordinates are in the reverse order of this objects. + + A with coordinates in the reverse order. + + + + Returns true if the given point is a vertex of this LineString. + + The Coordinate to check. + true if pt is one of this LineString's vertices. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalizes a LineString. A normalized linestring + has the first point which is not equal to it's reflected point + less than the reflected point. + + + + + + + + + + + + Initializes a new instance of the class. + + + For create this is used a standard + with == . + + The coordinates used for create this . + If too few points are provided + + + + Initializes a new instance of the class. + + + The points of the linestring, or null + to create the empty point. Consecutive points may not be equal. + + + If too few points are provided + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "LineString" + + + + Returns the length of this LineString + + The length of the polygon. + + + + + + + + + + + + + + + + + Returns the value of the angle between the + and the . + + + + + The minimum number of vertices allowed in a valid non-empty ring (= 4). + Empty rings with 0 vertices are also valid. + + + + + Constructs a LinearRing with the given points. + + + Points forming a closed and simple linestring, or + null or an empty array to create the empty point. + This array must not contain null elements. + + + If the ring is not closed, or has too few points + + + + + + + + + Initializes a new instance of the class. + + The points used for create this instance. + + For create this is used a standard + with == . + + If the ring is not closed, or has too few points + + + + Returns Dimensions.False, since by definition LinearRings do not have a boundary. + + + + + Returns the name of this object's interface. + + "LinearRing" + + + + Represents a line segment defined by two Coordinates. + Provides methods to compute various geometric properties + and relationships of line segments. + This class is designed to be easily mutable (to the extent of + having its contained points public). + This supports a common pattern of reusing a single LineSegment + object as a way of computing segment properties on the + segments defined by arrays or lists of Coordinates. + + + + + Creates an instance of this class using two coordinates + + The start-point + The end-point + + + + Creates an instance of this class using another instance + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the orientation of a LineSegment relative to this segment. + The concept of orientation is specified as follows: + Given two line segments A and L, + A is to the left of a segment L if A lies wholly in the + closed half-plane lying to the left of L + A is to the right of a segment L if A lies wholly in the + closed half-plane lying to the right of L + otherwise, A has indeterminate orientation relative to L. This + happens if A is collinear with L or if A crosses the line determined by L. + + The LineSegment to compare. + + 1 if seg is to the left of this segment, + -1 if seg is to the right of this segment, + 0 if seg is collinear to or crosses this segment. + + + + + Determines the orientation index of a relative to this segment. + The orientation index is as defined in . + + + + + 1 if p is to the left of this segment + -1 if p is to the right of this segment + 0 if p is collinear with this segment + " + + + + + + Reverses the direction of the line segment. + + + + + Puts the line segment into a normalized form. + This is useful for using line segments in maps and indexes when + topological equality rather than exact equality is desired. + + + + + Computes the distance between this line segment and another one. + + + + + + + Computes the distance between this line segment and a point. + + + + + Computes the perpendicular distance between the (infinite) line defined + by this line segment and a point. + + + + + + + Computes the that lies a given + fraction along the line defined by this segment. + + + A fraction of 0.0 returns the start point of the segment; + A fraction of 1.0 returns the end point of the segment. + If the fraction is < 0.0 or > 1.0 the point returned + will lie before the start or beyond the end of the segment. + + the fraction of the segment length along the line + the point at that distance + + + + Computes the that lies a given + + + A fraction along the line defined by this segment and offset from + the segment by a given distance. + A fraction of 0.0 offsets from the start point of the segment; + A fraction of 1.0 offsets from the end point of the segment. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + + the fraction of the segment length along the line + the distance the point is offset from the segment + (positive is to the left, negative is to the right) + the point at that distance and offset + if the segment has zero length + + + Computes the Projection Factor for the projection of the point p + onto this LineSegment. The Projection Factor is the constant r + by which the vector for this segment must be multiplied to + equal the vector for the projection of p on the line + defined by this segment. + + The projection factor will lie in the range (-inf, +inf), + or be NaN if the line segment has zero length. + + The point to compute the factor for + The projection factor for the point + + + + Computes the fraction of distance (in [0.0, 1.0]) + that the projection of a point occurs along this line segment. + If the point is beyond either ends of the line segment, + the closest fractional value (0.0 or 1.0) is returned. + + + Essentially, this is the clamped to + the range [0.0, 1.0]. + + the point + the fraction along the line segment the projection of the point occurs + + + + Compute the projection of a point onto the line determined + by this line segment. + Note that the projected point may lie outside the line segment. + If this is the case, the projection factor will lie outside the range [0.0, 1.0]. + + + + + + + Project a line segment onto this line segment and return the resulting + line segment. The returned line segment will be a subset of + the target line line segment. This subset may be null, if + the segments are oriented in such a way that there is no projection. + Note that the returned line may have zero length (i.e. the same endpoints). + This can happen for instance if the lines are perpendicular to one another. + + The line segment to project. + The projected line segment, or null if there is no overlap. + + + + Computes the closest point on this line segment to another point. + + The point to find the closest point to. + + A Coordinate which is the closest point on the line segment to the point p. + + + + + Computes the closest points on a line segment. + + + + A pair of Coordinates which are the closest points on the line segments. + + + + + Computes an intersection point between two segments, if there is one. + There may be 0, 1 or many intersection points between two segments. + If there are 0, null is returned. If there is 1 or more, a single one + is returned (chosen at the discretion of the algorithm). If + more information is required about the details of the intersection, + the {RobustLineIntersector} class should be used. + + A line segment + An intersection point, or null if there is none. + + + + + Computes the intersection point of the lines defined by two segments, if there is one. + + + There may be 0, 1 or an infinite number of intersection points between two lines. + If there is a unique intersection point, it is returned. + Otherwise, null is returned. + If more information is required about the details of the intersection, + the class should be used. + + A line segment defining a straight line + An intersection point, or null if there is none or an infinite number + + + + + Creates a LineString with the same coordinates as this segment + + the geometery factory to use + A LineString with the same geometry as this segment + + + + Returns true if o has the same values for its points. + + A LineSegment with which to do the comparison. + + true if o is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + + + + + + + + + + Compares this object with the specified object for order. + Uses the standard lexicographic ordering for the points in the LineSegment. + + + The LineSegment with which this LineSegment + is being compared. + + + A negative integer, zero, or a positive integer as this LineSegment + is less than, equal to, or greater than the specified LineSegment. + + + + + Returns true if other is + topologically equal to this LineSegment (e.g. irrespective + of orientation). + + + A LineSegment with which to do the comparison. + + + true if other is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + Return HashCode. + + + + + The end-point + + + + + The start-point + + + + + Gets the minimum X ordinate + + + + + Gets the maximum X ordinate + + + + + Gets the minimum Y ordinate + + + + + Gets the maximum Y ordinate + + + + + Computes the length of the line segment. + + The length of the line segment. + + + + Tests whether the segment is horizontal. + + true if the segment is horizontal. + + + + Tests whether the segment is vertical. + + true if the segment is vertical. + + + + The angle this segment makes with the x-axis (in radians). + + + + The midpoint of the segment + + + + Basic implementation of MultiLineString. + + + + + Represents an empty MultiLineString. + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + For create this is used a standard + with == . + + + + + Creates a in the reverse order to this object. + Both the order of the component LineStrings + and the order of their coordinate sequences are reversed. + + a in the reverse order. + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiLineString" + + + + Gets the OGC geometry type + + + + + Gets a value indicating whether this instance is closed. + + true if this instance is closed; otherwise, false. + + + + Models a collection of Points. + + + + + Represents an empty MultiPoint. + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + For create this is used a standard + with == . + + + + + + + + + + + + + Returns the Coordinate at the given position. + + The index of the Coordinate to retrieve, beginning at 0. + + The nth Coordinate. + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPoint" + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + Basic implementation of MultiPolygon. + + + + + Represents an empty MultiPolygon. + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + For create this is used a standard + with == . + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + + + + + + + + + + + Creates a {@link MultiPolygon} with every component reversed. + + The order of the components in the collection are not reversed. + An in the reverse order + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPolygon" + + + + + + + + + A bounding container for a which is in the shape of a general octagon. + + + The OctagonalEnvelope of a geometric object + is a geometry which is tight bound along the (up to) four extremal rectilineal parallels + and along the (up to) four extremal diagonal parallels. + Depending on the shape of the contained + geometry, the octagon may be degenerate to any extreme + (e.g. it may be a rectangle, a line, or a point). + + + + + Gets the octagonal envelope of a geometry + + The geometry + The octagonal envelope of the geometry + + + + Creates a new null bounding octagon + + + + + Creates a new null bounding octagon bounding a + + The coordinate to bound + + + + Creates a new null bounding octagon bounding a pair of s + + A coordinate to bound + A coordinate to bound + + + + Creates a new null bounding octagon bounding an + + + + + Creates a new null bounding octagon bounding an + (the copy constructor). + + + + + Creates a new null bounding octagon bounding a + + + + + Sets the value of this object to the null value + + + + + Tests if the extremal values for this octagon are valid. + + @return true if this object has valid values + + + + + A CoordinateSequence implementation based on a packed arrays. + A CoordinateSequence implementation based on a packed arrays. + + + + + A soft reference to the Coordinate[] representation of this sequence. + Makes repeated coordinate array accesses more efficient. + + + + + The dimensions of the coordinates hold in the packed array + + + + + The ordinates + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + + A copy of the i'th coordinate in the sequence + + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. + Note that if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + + + + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the first ordinate of a coordinate in this sequence. + + + + + + + Sets the second ordinate of a coordinate in this sequence. + + + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on doubles. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on floats. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked: + if it is over dimensions you may not get an exception but a meaningless value. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Builds packed array coordinate sequences. The array data type can be either + double or float, and defaults to double. + + + + + Initializes a new instance of the class, + using double values. + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + + + + + + Returns a CoordinateSequence based on the given array; whether or not the + array is copied is implementation-dependent. + + Coordinates array, which may not be null nor contain null elements + + + + + Returns a CoordinateSequence based on the given coordinate sequence; whether or not the + array is copied is implementation-dependent. + + + + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates + + The ordinates each coordinate has. is fix, and can be set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a single point. + + A Point is topologically valid if and only if: + + The coordinate which defines it if any) is a valid coordinate + (i.e. does not have an NaN X- or Y-ordinate + + + + + + + Represents an empty Point. + + + + + The Coordinate wrapped by this Point. + + + + + Initializes a new instance of the class. + + The coordinate used for create this . + + For create this is used a standard + with == . + + + + + Constructs a Point with the given coordinate. + + + Contains the single coordinate on which to base this Point, + or null to create the empty point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + The z coordinate. + /// + For create this is used a standard + with set to . + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + /// + For create this is used a standard + with set to . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Point" + + + + Gets the OGC geometry type + + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + + + + + + Represents a polygon with linear edges, which may include holes. + The outer boundary (shell) + and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. + The boundary rings of the polygon may have any orientation. + Polygons are closed, simple geometries by definition. + + The polygon model conforms to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + A Polygon is topologically valid if and only if: + + the coordinates which define it are valid coordinates + the linear rings for the shell and holes are valid + (i.e. are closed and do not self-intersect) + holes touch the shell or another hole at at most one point + (which implies that the rings of the shell and holes must not cross) + the interior of the polygon is connected, + or equivalently no sequence of touching holes + makes the interior of the polygon disconnected + (i.e. effectively split the polygon into two pieces). + + + + + + Represents an empty Polygon. + + + + + The exterior boundary, or null if this Polygon + is the empty point. + + + + + The interior boundaries, if any. + + + + + Initializes a new instance of the class. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + For create this is used a standard + with == . + + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Polygon" + + + + Returns the area of this Polygon + + + + + + Returns the perimeter of this Polygon. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the precision model of the Coordinates in a Geometry. + In other words, specifies the grid of allowable + points for all Geometrys. + + + The MakePrecise method allows rounding a coordinate to + a "precise" value; that is, one whose + precision is known exactly. + Coordinates are assumed to be precise in geometries. + That is, the coordinates are assumed to be rounded to the + precision model given for the point. + NTS input routines automatically round coordinates to the precision model + before creating Geometries. + All internal operations + assume that coordinates are rounded to the precision model. + Constructive methods (such as bool operations) always round computed + coordinates to the appropriate precision model. + Currently three types of precision model are supported: + + Floating: represents full double precision floating point. + This is the default precision model used in NTS + FloatingSingle: represents single precision floating point. + Fixed: represents a model with a fixed number of decimal places. + + A Fixed Precision Model is specified by a scale factor. + The scale factor specifies the size of the grid which numbers are rounded to. + Input coordinates are mapped to fixed coordinates according to the following + equations: + + jtsPt.x = round( (inputPt.x * scale ) / scale + jtsPt.y = round( (inputPt.y * scale ) / scale + + + For example, to specify 3 decimal places of precision, use a scale factor + of 1000. To specify -3 decimal places of precision (i.e. rounding to + the nearest 1000), use a scale factor of 0.001. + + Coordinates are represented internally as Java double-precision values. + Since .NET uses the IEEE-394 floating point standard, this + provides 53 bits of precision. (Thus the maximum precisely representable + integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). + + NTS binary methods currently do not handle inputs which have different precision models. + The precision model of any constructed geometric value is undefined. + + + + + The maximum precise value representable in a double. Since IEE754 + double-precision numbers allow 53 bits of mantissa, the value is equal to + 2^53 - 1. This provides almost 16 decimal digits of precision. + + + + + Determines which of two s is the most precise + + A precision model + A precision model + The PrecisionModel which is most precise + + + + The type of PrecisionModel this represents. + + + + + The scale factor which determines the number of decimal places in fixed precision. + + + + + Creates a PrecisionModel with a default precision + of Floating. + + + + + Creates a PrecisionModel that specifies + an explicit precision model type. + If the model type is Fixed the scale factor will default to 1. + + + The type of the precision model. + + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate + + Not used. + Not used. + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate. + + + + + Copy constructor to create a new PrecisionModel + from an existing one. + + + + + + Return HashCode. + + + + + Sets internal to the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the + precise representation of external. + + + + + Returns the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the precise + representation of external + + + + + Returns the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Sets external to the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Rounds a numeric value to the PrecisionModel grid. + Symmetric Arithmetic Rounding is used, to provide + uniform rounding behaviour no matter where the number is + on the number line. + + + This method has no effect on NaN values + + + + + + Rounds a Coordinate to the PrecisionModel grid. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compares this PrecisionModel object with the specified object for order. + A PrecisionModel is greater than another if it provides greater precision. + The comparison is based on the value returned by the + {getMaximumSignificantDigits) method. + This comparison is not strictly accurate when comparing floating precision models + to fixed models; however, it is correct when both models are either floating or fixed. + + + The PrecisionModel with which this PrecisionModel + is being compared. + + + A negative integer, zero, or a positive integer as this PrecisionModel + is less than, equal to, or greater than the specified PrecisionModel. + + + + + + + + + + + + Tests whether the precision model supports floating point. + + true if the precision model supports floating point. + + + + Returns the maximum number of significant digits provided by this + precision model. + Intended for use by routines which need to print out precise values. + + + The maximum number of decimal places provided by this precision model. + + + + + Returns the scale factor used to specify a fixed precision model. + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + The scale factor for the fixed precision model + + + + + Gets the type of this PrecisionModel. + + + + + + Returns the x-offset used to obtain a precise coordinate. + + + The amount by which to subtract the x-coordinate before + multiplying by the scale. + + + + + Returns the y-offset used to obtain a precise coordinate. + + + The amount by which to subtract the y-coordinate before + multiplying by the scale + + + + + A base class containing the logic for computes the contains + and covers spatial relationship predicates + for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + Contains and covers are very similar, and differ only in how certain + cases along the boundary are handled. These cases require + full topological evaluation to handle, so all the code in + this class is common to both predicates. + + + It is not possible to short-circuit in all cases, in particular + in the case where line segments of the test geometry touches the polygon linework. + In this case full topology must be computed. + (However, if the test geometry consists of only points, this + can be evaluated in an optimized fashion. + + + Martin Davis + + + + A base class for predicate operations on s. + + mbdavis + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether all components of the test Geometry are contained in the target geometry. + + Handles both linear and point components. + A geometry to test + + true if all componenta of the argument are contained in the target geometry + + + + + Tests whether all components of the test Geometry are contained in the interior of the target geometry. + + Handles both linear and point components. + A geometry to test + true if all componenta of the argument are contained in the target geometry interior + + + + Tests whether any component of the test Geometry intersects the area of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry + + + + Tests whether any component of the test Geometry intersects the interior of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry interior + + + + Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) + + The test geometry + The representative points of the target geometry + true if any component intersects the areal test geometry + + + This flag controls a difference between contains and covers. + + For contains the value is true. + For covers the value is false. + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Evaluate the contains or covers relationship + for the given geometry. + + the test geometry + true if the test geometry is contained + + + + Tests whether a geometry consists of a single polygon with no holes. + + True if the geometry is a single polygon with no holes + + + + Computes the full topological predicate. + Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon has the relationship with the test geometry + + + + A base class for subclasses. + + + Contains default implementations for methods, which simply delegate to the equivalent methods. + This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. + + Martin Davis + + + + Tests whether any representative of the target geometry intersects the test geometry. + This is useful in A/A, A/L, A/P, L/P, and P/P cases. + + The test geometry + true if any component intersects the areal test geometry + + + + Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. + + A geometry + true if the envelopes intersect + + + + Determines whether the envelope of this geometry covers the Geometry g. + + A geometry + true if g is contained in this envelope + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + Default implementation. + + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + Default implementation. + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + Default implementation. + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + Default implementation. + + + + Tests whether the base is disjoint from given geometry. + + The geometry to test + true if this geometry is disjoint from the given geometry + + Default implementation. + + + + Tests whether the base intersects a given geometry. + + The geometry to test + true if this geometry intersects the given geometry + + Default implementation. + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + Default implementation. + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + Default implementation. + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + Default implementation. + + + + Gets the list of representative points for this geometry. + One vertex is included for every component of the geometry + (i.e. including one for every ring of polygonal geometries). + + Do not modify the returned list! + + + + + A factory for creating s. It chooses an appropriate implementation of PreparedGeometry + based on the geoemtric type of the input geometry. + + + In the future, the factory may accept hints that indicate + special optimizations which can be performed. + + Martin Davis + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + mbdavis + + + + Computes the intersects spatial relationship predicate + for a target relative to other classes. + + + Uses short-circuit tests and indexing to improve performance. + + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared linestring + A test geometry + true if the linestring intersects the geometry + + + + Creates an instance of this operation. + + The target PreparedLineString + + + + Tests whether this geometry intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Tests whether any representative point of the test Geometry intersects + the target geometry. + + + Only handles test geometries which are Puntal (dimension 0) + + A Puntal geometry to test + true if any point of the argument intersects the prepared geometry + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + Martin Davis + + + + Tests whether this point intersects a . + + + The optimization here is that computing topology for the test geometry + is avoided. This can be significant for large geometries. + + + + + A prepared version for geometries. + This class supports both s and s. + This class does not support MultiPolygons which are non-valid + (e.g. with overlapping elements). + + + Instances of this class are thread-safe and immutable. + + mbdavis + + + + Computes the contains spatial relationship predicate for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + It is not possible to short-circuit in all cases, in particular + in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + + Martin Davis + + + + Computes the contains spatial relationship predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon contains the geometry + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon contains a given geometry. + + The test geometry + true if the test geometry is contained + + + + Computes the full topological contains predicate.
+ Used when short-circuit tests are not conclusive. +
+ The test geometry + true if this prepared polygon contains the test geometry +
+ + + Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
+ Uses short-circuit tests and indexing to improve performance. +
+ + + A Geometry A containsProperly another Geometry B iff + all points of B are contained in the Interior of A. + Equivalently, B is contained in A AND B does not intersect + the Boundary of A. + + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + In a situation with many geometries intersecting the boundary + of the target geometry, this can make a performance difference. + + + Martin Davis +
+ + Computes the containsProperly predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon properly contains the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon containsProperly a given geometry. + + The test geometry + true if the polygon properly contains the geometry + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + + Uses short-circuit tests and indexing to improve performance. + + It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + Martin Davis + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + The prepared polygon + A test geometry + true if the polygon covers the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon covers a given geometry. + + The test geometry + true if the test geometry is covered + + + + Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon covers the test geometry + + + + Computes the intersects spatial relationship predicate + for s relative to all other classes. + + Uses short-circuit tests and indexing to improve performance. + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared polygon + A test geometry + true if the polygon intersects the geometry + + + + Creates an instance of this operation. + + The prepared polygon + + + + Tests whether this PreparedPolygon intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Indicates an invalid or inconsistent topological situation encountered during processing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a planar triangle, and provides methods for calculating various + properties of triangles. + + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + + Tests whether a triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 degrees. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + True if the triangle is acute. + + + + Computes the line which is the perpendicular bisector of the + + A point + Another point + The perpendicular bisector, as an HCoordinate line segment a-b. + + + Computes the circumcentre of a triangle. + + The circumcentre is the centre of the circumcircle, + the smallest circle which encloses the triangle. + It is also the common intersection point of the + perpendicular bisectors of the sides of the triangle, + and is the only point which has equal distance to all three + vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. For example, + the circumcentre of an obtuse isoceles triangle lies outside the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The circumcentre of the triangle + + + + Computes the determinant of a 2x2 matrix. Uses standard double-precision + arithmetic, so is susceptible to round-off error. + + the [0,0] entry of the matrix + the [0,1] entry of the matrix + the [1,0] entry of the matrix + the [1,1] entry of the matrix + The determinant + + + + Computes the incentre of a triangle. + + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + It is also the point at which the bisectors of the triangle's angles meet. + It is the centre of the triangle's InCircle, which is the unique circle + that is tangent to each of the triangle's three sides. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point which is the incentre of the triangle + + + Computes the centroid (centre of mass) of a triangle. + + This is also the point at which the triangle's three + medians intersect (a triangle median is the segment from a vertex of the triangle to the + midpoint of the opposite side). + The centroid divides each median in a ratio of 2:1. + The centroid always lies within the triangle. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The centroid of the triangle + + + Computes the length of the longest side of a triangle + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The length of the longest side of the triangle + + + Computes the point at which the bisector of the angle ABC cuts the segment AC. + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The angle bisector cut point + + + + Computes the 2D area of a triangle. + The area value is always non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + Computes the signed 2D area of a triangle. + + + + The area value is positive if the triangle is oriented CW, + and negative if it is oriented CCW. + + + The signed area value can be used to determine point orientation, but + the implementation in this method is susceptible to round-off errors. + Use for robust orientation + calculation. + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + + Computes the 3D area of a triangle. + The value computed is alway non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The 3D area of the triangle + + + + Computes the Z-value (elevation) of an XY point + on a three-dimensional plane defined by a triangle + whose vertices have Z-values. + The defining triangle must not be degenerate + (in other words, the triangle must enclose a + non-zero area), + and must not be parallel to the Z-axis. + + This method can be used to interpolate + the Z-value of a point inside a triangle + (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + The computed Z-value (elevation) of the point + + + + Creates a new triangle with the given vertices. + + A vertex + A vertex + A vertex + + + + Computes the InCentre of this triangle + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + This is also the point at which the bisectors of the angles meet. + It is the centre of the triangle's InCircle, + which is the unique circle that is tangent to each of the triangle's three sides. + + + The point which is the InCentre of the triangle. + + + + + Tests whether this triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 + degrees. + + true if this triangle is acute + + + + Computes the circumcentre of this triangle. The circumcentre is the centre + of the circumcircle, the smallest circle which encloses the triangle. It is + also the common intersection point of the perpendicular bisectors of the + sides of the triangle, and is the only point which has equal distance to + all three vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + The circumcentre of this triangle + + + + Computes the centroid (centre of mass) of this triangle. This is also the + point at which the triangle's three medians intersect (a triangle median is + the segment from a vertex of the triangle to the midpoint of the opposite + side). The centroid divides each median in a ratio of 2:1. + + The centroid always lies within the triangle. + + The centroid of this triangle + + + + Computes the length of the longest side of this triangle + + The length of the longest side of this triangle + + + + Computes the 2D area of this triangle. The area value is always + non-negative. + + The area of this triangle + + + + + Computes the signed 2D area of this triangle. The area value is positive if + the triangle is oriented CW, and negative if it is oriented CCW. + + The signed area value can be used to determine point orientation, but the + implementation in this method is susceptible to round-off errors. Use + + for robust orientation calculation. + + The signed 2D area of this triangle + + + + + Computes the 3D area of this triangle. The value computed is alway + non-negative. + + The 3D area of this triangle + + + + Computes the Z-value (elevation) of an XY point on a three-dimensional + plane defined by this triangle (whose vertices must have Z-values). This + triangle must not be degenerate (in other words, the triangle must enclose + a non-zero area), and must not be parallel to the Z-axis. + + This method can be used to interpolate the Z-value of a point inside this + triangle (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + The computed Z-value (elevation) of the point + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + Represents an affine transformation on the 2D Cartesian plane. + + + + It can be used to transform a or . + An affine transformation is a mapping of the 2D plane into itself + via a series of transformations of the following basic types: +
    +
  • reflection (through a line)
  • +
  • rotation (around the origin)
  • +
  • scaling (relative to the origin)
  • +
  • shearing (in both the X and Y directions)
  • +
  • translation
  • +
+
+ + In general, affine transformations preserve straightness and parallel lines, + but do not preserve distance or shape. + + + An affine transformation can be represented by a 3x3 + matrix in the following form: +
+            T = | m00 m01 m02 |
+                | m10 m11 m12 |
+                |  0   0   1  |
+            
+ A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') + by representing it as a 3x1 matrix and using matrix multiplication to compute: +
+            | x' |  = T x | x |
+            | y' |        | y |
+            | 1  |        | 1 |
+            
+
+

Transformation Composition

+ + Affine transformations can be composed using the method. + Composition is computed via multiplication of the + transformation matrices, and is defined as: +
+            A.compose(B) = TB x TA
+            
+
+ + This produces a transformation whose effect is that of A followed by B. + The methods , , + , , and + have the effect of composing a transformation of that type with + the transformation they are invoked on. + The composition of transformations is in general not commutative. + +

Transformation Inversion

+ + Affine transformations may be invertible or non-invertible. + If a transformation is invertible, then there exists + an inverse transformation which when composed produces + the identity transformation. + The method + computes the inverse of a transformation, if one exists. + + + @author Martin Davis + +
+
+ + + Creates a transformation for a reflection about the + line (x0,y0) - (x1,y1). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + the x-ordinate of a another point on the reflection line + the y-ordinate of a another point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a reflection about the + line (0,0) - (x,y). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a rotation + about the origin + by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + a transformation for the rotation + + + + Creates a transformation for a rotation + by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a scaling relative to the origin. + + the value to scale by in the x direction + the value to scale by in the y direction + a transformation for the scaling + + + + Creates a transformation for a scaling relative to the point (x,y). + + The value to scale by in the x direction + The value to scale by in the y direction + The x-ordinate of the point to scale around + The y-ordinate of the point to scale around + A transformation for the scaling + + + + Creates a transformation for a shear. + + the value to shear by in the x direction + the value to shear by in the y direction + a tranformation for the shear + + + + Creates a transformation for a translation. + + the value to translate by in the x direction + the value to translate by in the y direction + a tranformation for the translation + + + + Constructs a new identity transformation + + + + + Constructs a new transformation whose + matrix has the specified values. + + an array containing the 6 values { m00, m01, m02, m10, m11, m12 } + if matrix is null + if matrix is too small + + + + Constructs a new transformation whose + matrix has the specified values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + + + + Constructs a transformation which is + a copy of the given one. + + the transformation to copy + + + + Constructs a transformation + which maps the given source + points into the given destination points. + + source point 0 + source point 1 + source point 2 + the mapped point for source point 0 + the mapped point for source point 1 + the mapped point for source point 2 + + + + Sets this transformation to be the identity transformation. + + + The identity transformation has the matrix: +
+            | 1 0 0 |
+            | 0 1 0 |
+            | 0 0 1 |
+            
+
+ this transformation, with an updated matrix +
+ + + Sets this transformation's matrix to have the given values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + this transformation, with an updated matrix + + + + Sets this transformation to be a copy of the given one + + a transformation to copy + this transformation, with an updated matrix + + + + Computes the inverse of this transformation, if one + exists. + + + + * The inverse is the transformation which when + * composed with this one produces the identity + * transformation. + * A transformation has an inverse if and only if it + * is not singular (i.e. its + * determinant is non-zero). + * Geometrically, an transformation is non-invertible + * if it maps the plane to a line or a point. + * If no inverse exists this method + * will throw a . + + + * The matrix of the inverse is equal to the + * inverse of the matrix for the transformation. + * It is computed as follows: + *
+            *                 1
+            * inverse(A)  =  ---   x  adjoint(A)
+            *                det
+            *
+            *
+            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
+            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
+            *                det      |  0     0     m00*m11-m10*m01  |
+            *
+            *
+            *
+            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
+            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
+            *               |   0           0          1               |
+            *
+            * 
+
+
+ A new inverse transformation + + +
+ + + Explicitly computes the math for a reflection. May not work. + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection + about the line defined by vector (x,y). + + + The transformation for a reflection + is computed by: +
+            d = sqrt(x2 + y2)
+            sin = x / d;
+            cos = x / d;
+            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
+            
+
+ the x-component of the reflection line vector + the y-component of the reflection line vector + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the orign. + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle theta + has the value: +
+            |  cos(theta)  -sin(theta)   0 |
+            |  sin(theta)   cos(theta)   0 |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the origin + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   0 |
+            |  sinTheta   cosTheta   0 |
+            |         0          0   1 |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y). + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y) + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |         0          0         1       |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a scaling. + + + The transformation matrix for a scale + has the value: +
+            |  xScale      0  dx |
+            |  1      yScale  dy |
+            |  0           0   1 |
+            
+
+ the amount to scale x-ordinates by + the amount to scale y-ordinates by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a shear. + + + The transformation matrix for a shear + has the value: +
+            |  1      xShear  0 |
+            |  yShear      1  0 |
+            |  0           0  1 |
+            
+ Note that a shear of (1, 1) is not + equal to shear(1, 0) composed with shear(0, 1). + Instead, shear(1, 1) corresponds to a mapping onto the + line x = y. +
+ the x component to shear by + the y component to shear by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a translation. + + + For a translation by the vector (x, y) + the transformation matrix has the value: +
+            |  1  0  dx |
+            |  1  0  dy |
+            |  0  0   1 |
+            
+
+ the x component to translate by + the y component to translate by + this transformation, with an updated matrix +
+ + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of the line to reflect around + the y-ordinate of the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation transformation composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by in radians + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around the origin composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a scale transformation composed + with the current value. + + the value to scale by in the x direction + the value to scale by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a shear transformation composed + with the current value. + + the value to shear by in the x direction + the value to shear by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a translation transformation composed + with the current value. + + the value to translate by in the x direction + the value to translate by in the y direction + this transformation, with an updated matrix + + + + Updates this transformation to be + the composition of this transformation with the given . + + + This produces a transformation whose effect + is equal to applying this transformation + followed by the argument transformation. + Mathematically, +
+            A.compose(B) = TB x TA
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Updates this transformation to be the composition + of a given with this transformation. + + + This produces a transformation whose effect + is equal to applying the argument transformation + followed by this transformation. + Mathematically, +
+            A.composeBefore(B) = TA x TB
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Applies this transformation to the coordinate + and places the results in the coordinate + (which may be the same as the source). + + the coordinate to transform + the coordinate to accept the results + the dest coordinate + + + + + Cretaes a new which is the result of this transformation applied to the input Geometry. + + A Geometry + The transformed Geometry + + + + Applies this transformation to the i'th coordinate + in the given CoordinateSequence. + + a CoordinateSequence + the index of the coordinate to transform + + + + Transforms the i'th coordinate in the input sequence + + A CoordinateSequence + The index of the coordinate to transform + + + + Tests if an object is an AffineTransformation and has the same matrix as this transformation. + + An object to test + true if the given object is equal to this object + + + + Gets a text representation of this transformation. + The string is of the form: + + AffineTransformation[[m00, m01, m02], [m10, m11, m12]] + + + A string representing this transformation + + + + Clones this transformation + + A copy of this transformation + + + + Gets an array containing the entries + of the transformation matrix. + + + Only the 6 non-trivial entries are returned, + in the sequence: +
+            m00, m01, m02, m10, m11, m12
+            
+
+ an array of length 6 +
+ + + Computes the determinant of the transformation matrix. + + + + The determinant is computed as: +
+             | m00 m01 m02 |
+             | m10 m11 m12 | = m00 * m11 - m01 * m10
+             |  0   0   1  |
+             
+
+ + If the determinant is zero, + the transform is singular (not invertible), + and operations which attempt to compute + an inverse will throw a . + +
+ the determinant of the transformation + + + The determinant of the transformation + +
+ + + Reports that this filter should continue to be executed until + all coordinates have been transformed. + + false + + + Tests if this transformation is the identity transformation. + + + + Builds an defined by a set of control vectors. + + + + A control vector consists of a source point and a destination point, + which is the image of the source point under the desired transformation. + + + A transformation is well-defined + by a set of three control vectors + if and only if the source points are not collinear. + (In particular, the degenerate situation + where two or more source points are identical will not produce a well-defined transformation). + A well-defined transformation exists and is unique. + If the control vectors are not well-defined, the system of equations + defining the transformation matrix entries is not solvable, + and no transformation can be determined. + + No such restriction applies to the destination points. + However, if the destination points are collinear or non-unique, + a non-invertible transformations will be generated. + + + This technique of recovering a transformation + from its effect on known points is used in the Bilinear Interpolated Triangulation + algorithm for warping planar surfaces. + + + Martin Davis + + + + Constructs a new builder for the transformation defined by the given set of control point mappings. + + A control point + A control point + A control point + The image of under the required transformation + The image of under the required transformation + The image of under the required transformation + + + + Computes the + determined by the control point mappings, + or null if the control vectors do not determine a well-defined transformation. + + + + An affine transformation + null if the control vectors do not determine a well-defined transformation. + + + + + + Computes the transformation matrix by + solving the two systems of linear equations + defined by the control point mappings, + if this is possible. + + True if the transformation matrix is solvable + + + + Solves the transformation matrix system of linear equations + for the given right-hand side vector. + + The vector for the right-hand side of the system + The solution vector, if it can be determinated, otherwise null + + + + Supports creating s defined by various kinds of inputs and transformation mapping rules. + + Martin Davis + + + + Creates a tranformation from a set of three control vectors. A control + vector consists of a source point and a destination point, which is the + image of the source point under the desired transformation. Three control + vectors allows defining a fully general affine transformation. + + + + + + + + The computed transformation + + + + Creates an AffineTransformation defined by a pair of control vectors. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. The + computed transformation is a combination of one or more of a uniform scale, + a rotation, and a translation (i.e. there is no shear component and no + reflection) + + + + + + The computed transformation + null if the control vectors do not determine a well-defined transformation + + + + Creates an AffineTransformation defined by a single control vector. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. This + produces a translation. + + The start point of the control vector + The end point of the control vector + The computed transformation + + + + Creates an AffineTransformation defined by a set of control vectors. + Between one and three vectors must be supplied. + + The source points of the vectors + The destination points of the vectors + The computed transformation + if the control vector arrays are too short, long or of different lengths + + + + Creates an AffineTransformation defined by a maping between two baselines. + The computed transformation consists of: + + a translation from the start point of the source baseline to the start point of the destination baseline, + a rotation through the angle between the baselines about the destination start point, + and a scaling equal to the ratio of the baseline lengths. + + If the source baseline has zero length, an identity transformation is returned. + + The start point of the source baseline + The end point of the source baseline + The start point of the destination baseline + The end point of the destination baseline + + + + + Extracts a single representative from each connected component of a . + + 1.9 + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The Geometry from which to extract + A list of Coordinates + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + Maps the members of a + into another GeometryCollection via a defined + mapping function. + + Martin Davis + + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + Combines s to produce a of the most appropriate type. + + + Input geometries which are already collections will have their elements extracted first. + No validation of the result geometry is performed. + (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). + + mbdavis + + + + Combines a collection of geometries. + The geometries to combine + The combined geometry + + + + Combines two geometries. + + A geometry to combine + A geometry to combine + The combined geometry + + + + Combines three geometries. + + A geometry to combine + A geometry to combine + A geometry to combine + The combined geometry + + + + Creates a list from two items + + + + A list from two geometries + + + + Creates a list from three items + + + + + A list from three geometries + + + + Creates a new combiner for a collection of geometries + + The geometries to combine + + + + Extracts the GeometryFactory used by the geometries in a collection + + + a GeometryFactory + + + + Computes the combination of the input geometries to produce the most appropriate or + + A Geometry which is the combination of the inputs + + + + + Value indicating whether empty geometries should be skipped + + + + + A class which supports creating new s + which are modifications of existing ones, + maintaining the same type structure. + + + Geometry objects are intended to be treated as immutable. + This class allows you to "modifies" a Geometrys + by traversing them, applying a user-defined + , or + and creating a new Geometrys with the same structure but + (possibly) modified components. + + Examples of the kinds of modifications which can be made are: + + + The values of the coordinates may be changed. + The editor does not check whether changing coordinate values makes the result Geometry invalid + + + The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). + The modifed coordinate lists must be consistent with their original parent component + (e.g. a LinearRing must always have at least 4 coordinates, and the first and last + coordinate must be equal). + + + Components of the original point may be deleted + (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). + Deletions will be propagated up the component tree appropriately. + + + + All changes must be consistent with the original Geometry's structure + (e.g. a Polygon cannot be collapsed into a LineString). + If changing the structure is required, use a . + + + This class supports creating an edited Geometry + using a different via the + constructor. + Examples of situations where this is required is if the geometry is + transformed to a new SRID and/or a new PrecisionModel. + + Usage notes + + The resulting Geometry is not checked for validity. + If validity needs to be enforced, the new Geometry's + method should be called. + By default the UserData of the input geometry is not copied to the result. + + + + + + + + + The factory used to create the modified Geometry. + + + If null the GeometryFactory of the input is used. + + + + + Creates a new GeometryEditor object which will create + edited with the same as the input Geometry. + + + + + Creates a new GeometryEditor object which will create + edited s with the given . + + The GeometryFactory to create the edited Geometry with. + + + + Edit the input Geometry with the given edit operation. + Clients can create subclasses of GeometryEditorOperation or + CoordinateOperation to perform required modifications. + + The Geometry to edit. + The edit operation to carry out. + A new Geometry which is the result of the editing (which may be empty). + + + + Gets or sets a value indicating if the User Data is copied to the edit result. + If so, only the object reference is copied. + + + + + A interface which specifies an edit operation for Geometries. + + + + + Edits a Geometry by returning a new Geometry with a modification. + The returned Geometry may be the input geometry itself. + It may be null if the geometry is to be deleted. + + The Geometry to modify. + + The factory with which to construct the modified Geometry + (may be different to the factory of the input point). + + A new Geometry which is a modification of the input Geometry. + null if the Geometry is to be deleted completely + + + + A GeometryEditorOperation which does not modify + the input geometry. + This can be used for simple changes of + (including PrecisionModel and SRID). + + mbdavis + + + + A GeometryEditorOperation which edits the coordinate list of a Geometry. + Operates on Geometry subclasses which contains a single coordinate list. + + + + + + + + + + + + + Edits the array of Coordinates from a Geometry. + + The coordinate array to operate on. + The point containing the coordinate list. + An edited coordinate array (which may be the same as the input). + + + + A which edits the + of a . + + Operates on Geometry subclasses which contains a single coordinate list. + + + + An edited coordinate sequence (which may be the same as the input) + + + + Extracts the components of a given type from a . + + + + + Extracts the T components from an and adds them to the provided . + + the geometry from which to extract + the list to add the extracted elements to + The geometry type to extract + + + + Extracts the T elements from a single and returns them in a . + + the geometry from which to extract + + + + Extracts the components of type T from a . + + + + + Constructs a filter with a list in which to store the elements found. + + The list to extract into + + + + Extracts all the 1-dimensional () components from a . + For polygonal geometries, this will extract all the component s. + If desired, s can be forced to be returned as s. + + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single point. + If more than one point is to be processed, it is more + efficient to create a single LineExtracterFilter instance + and pass it to multiple geometries. + + The point from which to extract linear components. + The list of linear components. + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The geometry from which to extract linear components + true if s should be converted to s + The list of linear components + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + true if s should be converted to s + A linear geometry + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single + and adds them to the. + + The geometry from which to extract + The list to add the extracted elements to + The list argument + + + + Extracts the elements from a single + and returns them in a . + + The geometry from which to extract + A list containing the linear elements + + + + Extracts the elements from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Constructs a filter with a list in which to store the elements found. + + + + + Implements some 2D matrix operations (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination.
+ In order to avoid overhead the algorithm runs in-place + on A - if A should not be modified the client must supply a copy. +
+ A an nxn matrix in row/column order )modified by this method) + A vector of length n + if the matrix is the wrong size + + + A vector containing the solution (if any) + null if the system has no or no unique solution + + +
+ + + Indicates that an is non-invertible. + + Martin Davis + + + + Extracts all the 0-dimensional (Point) components from a Geometry. + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + the geometry from which to extract + + + + Constructs a PointExtracterFilter with a list in which to store Points found. + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + The geometry from which to extract + + + + Constructs a PolygonExtracterFilter with a list in which to store Polygons found. + + + + + + + + + + + + A visitor to elements which componets, which + allows short-circuiting when a defined condition holds. + + + + + + + + + + + + + + + + + + + + + + + A Depth object records the topological depth of the sides + of an Edge for up to two Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Depth object is null (has never been initialized) if all depths are null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalize the depths for each point, if they are non-null. + A normalized depth + has depth values in the set { 0, 1 }. + Normalizing the depths + involves reducing the depths by the same amount so that at least + one of them is 0. If the remaining value is > 0, it is set to 1. + + + + + + + + + + + Calls GetDepth and SetDepth. + + + + + + + + + + + + + Models the end of an edge incident on a node. + + + + EdgeEnds have a direction determined by the direction of the ray from the initial + point to the next point. + + + EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". + This ordering is used to sort EdgeEnds around a node. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the total order relation: + a has a greater angle with the positive x-axis than b. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is obviously susceptible to roundoff. + A robust algorithm is: + - first compare the quadrant. If the quadrants + are different, it it trivial to determine which vector is "greater". + - if the vectors lie in the same quadrant, the computeOrientation function + can be used to decide the relative orientation of the vectors. + + + + + + Subclasses should override this if they are using labels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes the factor for the change in depth when moving from one location to another. + E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. + + + + + + + + + + The depth of each side (position) of this edge. + The 0 element of the array is never used. + + + + + + + + + + + + + + + + + + + + + + + + + + Compute the label in the appropriate orientation for this DirEdge. + + + + + Set both edge depths. + One depth for a given side is provided. + The other is computed depending on the Location + transition and the depthDelta of the edge. + + + + + + + Set both edge depths. One depth for a given side is provided. The other is + computed depending on the Location transition and the depthDelta of the edge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VisitedEdge get property returns true if bot Visited + and Sym.Visited are true. + VisitedEdge set property marks both DirectedEdges attached to a given Edge. + This is used for edges corresponding to lines, which will only + appear oriented in a single direction in the result. + + + + + + + + + + + + + + + + + + + + + + + + + This edge is a line edge if + at least one of the labels is a line label + any labels which are not line labels have all Location = Exterior. + + + + + This is an interior Area edge if + its label is an Area label for both Geometries + and for each Geometry both sides are in the interior. + + true if this is an interior Area edge. + + + + A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. + It supports labelling the edges as well as linking the edges to form both + MaximalEdgeRings and MinimalEdgeRings. + + + + + A EdgeEndStar is an ordered list of EdgeEnds around a node. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + A map which maintains the edges in sorted order around the node. + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + The location of the point for this star in Geometry i Areas. + + + + + Insert a EdgeEnd into this EdgeEndStar. + + + + + + Insert an EdgeEnd into the map, and clear the edgeList cache, + since the list of edges has now changed. + + + + + + + Iterator access to the ordered list of edges is optimized by + copying the map collection to a list. (This assumes that + once an iterator is requested, it is likely that insertion into + the map is complete). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate for the node this star is based at. + + + + + + + + + + + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + Insert a directed edge in the list. + + + + + + + + + + + + + + + + + + + + + + + + + Compute the labelling for all dirEdges in this star, as well + as the overall labelling. + + + + + + For each dirEdge in the star, merge the label . + + + + + Update incomplete dirEdge labels from the labelling for the node. + + + + + + + + + + + + Traverse the star of DirectedEdges, linking the included edges together. + To link two dirEdges, the next pointer for an incoming dirEdge + is set to the next outgoing edge. + DirEdges are only linked if: + they belong to an area (i.e. they have sides) + they are marked as being in the result + Edges are linked in CCW order (the order they are stored). + This means that rings have their face on the Right + (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). + PRECONDITION: No pair of dirEdges are both marked as being in the result. + + + + + + + + + + + + + + + + Traverse the star of edges, maintaing the current location in the result + area at this node (if any). + If any L edges are found in the interior of the result, mark them as covered. + + + + + + + + + + + Compute the DirectedEdge depths for a subsequence of the edge array. + + The last depth assigned (from the R side of the last edge visited). + + + + + + + + + + + + + + + + + + + + A GraphComponent is the parent class for the objects' + that form a graph. Each GraphComponent can carry a + Label. + + + + + + + + + + + + + + + + + + + + + Compute the contribution to an IM for this component. + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + + + + + + + + + + + IsInResult indicates if this component has already been included in the result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A coordinate in this component (or null, if there are none). + + + + + An isolated component is one that does not intersect or touch any other + component. This is the case if the label has valid locations for + only a single Geometry. + + true if this component is isolated. + + + + Updates an IM from the label for an edge. + Handles edges from both L and A geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an EdgeIntersection for intersection intIndex. + An intersection that falls exactly on a vertex of the edge is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if the coordinate sequences of the Edges are identical. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The depthDelta is the change in depth as an edge is crossed from R to L. + + The change in depth as the edge is crossed from R to L. + + + + + + + + + + + + + + + + + + + + + + + + An Edge is collapsed if it is an Area edge and it consists of + two segments which are equal and opposite (eg a zero-width V). + + + + + + + + + + + + + + + + + + + + An EdgeIntersection represents a point on an + edge which intersects with another edge. + The intersection may either be a single point, or a line segment + (in which case this point is the start of the line segment) + The label attached to this intersection point applies to + the edge from this point forwards, until the next + intersection or the end of the edge. + The intersection point must be precise. + + + + + + + + + + + + + + + + + + + + + + + + + -1 this EdgeIntersection is located before the argument location, + 0 this EdgeIntersection is at the argument location, + 1 this EdgeIntersection is located after the argument location. + + + + + + + + + + + + + + + + + + The point of intersection. + + + + + The index of the containing line segment in the parent edge. + + + + + The edge distance of this point along the containing line segment. + + + + + A list of edge intersections along an Edge. + + + + + + + + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + + The EdgeIntersection found or added. + + + + Returns an iterator of EdgeIntersections. + + + + + + + + + + + + Adds entries for the first and last points of the edge to the list. + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the input list (this is so a single list + can be used to accumulate all split edges for a Geometry). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + + + + + + + + + + + + A EdgeList is a list of Edges. It supports locating edges + that are pointwise equals to a target edge. + + + + + + Remove the selected Edge element from the list if present. + + Edge element to remove from list + + + + Insert an edge unless it is already in the list. + + + + + + + + + + + + If there is an edge equal to e already in the list, return it. + Otherwise return null. + + + + equal edge, if there is one already in the list, + null otherwise. + + + + + + + + + + + + + + + + + + If the edge e is already in the list, return its index. + + + + Index, if e is already in the list, + -1 otherwise. + + + + + + + + + + + + + + + + + + + + + + + Validates that a collection of is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Checks whether the supplied s are correctly noded. + + an enumeration of Edges. + If the SegmentStrings are not correctly noded + + + + Creates a new validator for the given collection of s. + + + + + Checks whether the supplied edges are correctly noded. + + If the SegmentStrings are not correctly noded + + + + + + + + + The directed edge which starts the list of edges for this EdgeRing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compute a LinearRing from the point list previously collected. + Test if the ring is a hole (i.e. if it is CCW) and set the hole flag + accordingly. + + + + + + + + + + + + + + + + + + + Collect all the points from the DirectedEdges of this ring into a contiguous list. + + + + + + + + + + + + + + + + + + + + + + Merge the RHS label from a DirectedEdge into the label for this EdgeRing. + The DirectedEdge label may be null. This is acceptable - it results + from a node which is NOT an intersection node between the Geometries + (e.g. the end node of a LinearRing). In this case the DirectedEdge label + does not contribute any information to the overall labelling, and is simply skipped. + + + + + + + + + + + + + + + This method will cause the ring to be computed. + It will also check any holes, if they have been assigned. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the list of DirectedEdges that make up this EdgeRing. + + + + + + + + + + A GeometryGraph is a graph that models a given Geometry. + + + + + The computation of the IntersectionMatrix relies on the use of a structure + called a "topology graph". The topology graph contains nodes and edges + corresponding to the nodes and line segments of a Geometry. Each + node and edge in the graph is labeled with its topological location relative to + the source point. + Note that there is no requirement that points of self-intersection be a vertex. + Thus to obtain a correct topology graph, Geometrys must be + self-noded before constructing their graphs. + Two fundamental operations are supported by topology graphs: + Computing the intersections between all the edges and nodes of a single graph + Computing the intersections between the edges and nodes of two different graphs + + + + + For nodes in the Collection, link the DirectedEdges at the node that are in the result. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The node if found; null otherwise + + + + + + Add a set of edges to the graph. For each edge two DirectedEdges + will be created. DirectedEdges are NOT linked by this method. + + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Returns the EdgeEnd which has edge e as its base edge + (MD 18 Feb 2002 - this should return a pair of edges). + + + The edge, if found null if the edge was not found. + + + + Returns the edge whose first two coordinates are p0 and p1. + + + + The edge, if found null if the edge was not found. + + + + Returns the edge which starts at p0 and whose first segment is + parallel to p1. + + + + The edge, if found null if the edge was not found. + + + + The coordinate pairs match if they define line segments lying in the same direction. + E.g. the segments are parallel and in the same quadrant + (as opposed to parallel and opposite!). + + + + + + + + + + + + + + + + + + + + + + + + + This method implements the Boundary Determination Rule + for determining whether + a component (node or edge) that appears multiple times in elements + of a MultiGeometry is in the boundary or the interior of the Geometry. + The SFS uses the "Mod-2 Rule", which this function implements. + An alternative (and possibly more intuitive) rule would be + the "At Most One Rule": + isInBoundary = (componentCount == 1) + + + + + The lineEdgeMap is a map of the linestring components of the + parentGeometry to the edges which are derived from them. + This is used to efficiently perform findEdge queries + + + + + If this flag is true, the Boundary Determination Rule will used when deciding + whether nodes are in the boundary or not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + Adds a polygon ring to the graph. Empty rings are ignored. + The left and right topological location arguments assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged. + + + + + + + + + + + + + + + + + + + + Add an Edge computed externally. The label on the Edge is assumed + to be correct. + + + + + + Add a point computed externally. The point is assumed to be a + Point Geometry part, which has a location of INTERIOR. + + + + + + Compute self-nodes, taking advantage of the Geometry type to + minimize the number of intersection tests. (E.g. rings are + not tested for self-intersection, since they are assumed to be valid). + + The LineIntersector to use. + If false, intersection checks are optimized to not test rings for self-intersection. + The SegmentIntersector used, containing information about the intersections found. + + + + + + + + + + + + + + + + + + + + + Adds candidate boundary points using the current . + This is used to add the boundary + points of dim-1 geometries (Curves/MultiCurves). + + + + + + + + + + + + + Add a node for a self-intersection. + If the node is a potential boundary node (e.g. came from an edge which + is a boundary) then insert it as a potential boundary node. + Otherwise, just add it as a regular node. + + + + + + + + Determines the of the given in this geometry. + + The point to test + + The location of the point in the geometry + + + + + + + + + + + + + + + + + + + + Gets the used with this geometry graph. + + + + + + + + + + An EdgeSetIntersector computes all the intersections between the + edges in the set. It adds the computed intersections to each edge + they are found on. It may be used in two scenarios: + determining the internal intersections between a single set of edges + determining the mutual intersections between two different sets of edges + It uses a SegmentIntersector to compute the intersections between + segments and to record statistics about what kinds of intersections were found. + + + + + Computes all self-intersections between edges in a set of edges, + allowing client to choose whether self-intersections are computed. + + A list of edges to test for intersections. + The SegmentIntersector to use. + true if self-intersections are to be tested as well. + + + + Computes all mutual intersections between two sets of edges. + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + They have the following properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + + Specifically, a sequence of contiguous line segments + is a monotone chain iff all the vectors defined by the oriented segments + lies in the same quadrant. + + Monotone Chains have the following useful properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + Note that due to the efficient intersection test, there is no need to limit the size + of chains to obtain fast performance. + + + + + + + + + + + + + + + + + + + + The index of the last point in the monotone chain. + + + + + + Computes the intersection of line segments, + and adds the intersection to the edges containing the segments. + + + + + + + + + + + + + Testing only. + + + + + + + + + + + + + + + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning + and end segments. + + + + + + + + + This method is called by clients of the EdgeIntersector class to test for and add + intersections for two segments of the edges being intersected. + Note that clients (such as MonotoneChainEdges) may choose not to intersect + certain pairs of segments for efficiency reasons. + + + + + + + + + + + + + + + + + + + + + + + + + The proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire Geometry, since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the Geometry. + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this SegmentIntersector. + + + + + Finds all intersections in one or two sets of edges, + using the straightforward method of + comparing all segments. + This algorithm is too slow for production use, but is useful for testing purposes. + + + + + + + + + + + + + + + + + + + + + Performs a brute-force comparison of every segment in each Edge. + This has n^2 performance, and is about 100 times slower than using + monotone chains. + + + + + + + + Finds all intersections in one or two sets of edges, + using an x-axis sweepline algorithm in conjunction with Monotone Chains. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + The use of MonotoneChains as the items in the index + seems to offer an improvement in performance over a sweep-line alone. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + Finds all intersections in one or two sets of edges, + using a simple x-axis sweepline algorithm. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because DELETE events have a link to their corresponding INSERT event, + it is possible to compute exactly the range of events which must be + compared to a given INSERT event object. + + + + + + + + + + + + + + + + + + + + + + + + + Creates an INSERT event. + + The edge set label for this object. + The event location + the object being inserted + + + + Creates a DELETE event. + + The event location + The corresponding INSERT event + + + + Events are ordered first by their x-value, and then by their eventType. + Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Label indicates the topological relationship of a component + of a topology graph to a given Geometry. + This class supports labels for relationships to two Geometrys, + which is sufficient for algorithms for binary operations. + Topology graphs support the concept of labeling nodes and edges in the graph. + The label of a node or edge specifies its topological relationship to one or + more geometries. (In fact, since NTS operations have only two arguments labels + are required for only two geometries). A label for a node or edge has one or + two elements, depending on whether the node or edge occurs in one or both of the + input Geometrys. Elements contain attributes which categorize the + topological location of the node or edge relative to the parent + Geometry; that is, whether the node or edge is in the interior, + boundary or exterior of the Geometry. Attributes have a value + from the set {Interior, Boundary, Exterior}. In a node each + element has a single attribute On. For an edge each element has a + triplet of attributes Left, On, Right. + It is up to the client code to associate the 0 and 1 TopologyLocations + with specific geometries. + + + + + Converts a Label to a Line label (that is, one with no side Location). + + Label to convert. + Label as Line label. + + + + Construct a Label with a single location for both Geometries. + Initialize the locations to Null. + + + + + + Construct a Label with a single location for both Geometries. + Initialize the location for the Geometry index. + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for both Geometries to the given values. + + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for the given Geometry index. + + + + + + + + + Construct a Label with the same values as the argument Label. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge this label with another one. + Merging updates any null attributes of this label with the attributes from lbl. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts one GeometryLocation to a Line location. + + + + + + + + + + + + + + + + + + + + + + Only non-null if this node is precise. + + + + + + + + + + + + + + + + + Basic nodes do not compute IMs. + + + + + + Add the edge to the list of edges at this node. + + + + + + + + + + + + To merge labels for two nodes, + the merged location for each LabelElement is computed. + The location for the corresponding node LabelElement is set to the result, + as long as the location is non-null. + + + + + + + + + + + + + Updates the label of a node to BOUNDARY, + obeying the mod-2 boundaryDetermination rule. + + + + + + The location for a given eltIndex for a node will be one + of { Null, Interior, Boundary }. + A node may be on both the boundary and the interior of a point; + in this case, the rule is that the node is considered to be in the boundary. + The merged location is the maximum of the two input values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The basic node constructor does not allow for incident edges. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + + + + + + + This method expects that a node has a coordinate value. + + + + + + + + + + + + + Adds a node for the start point of this EdgeEnd + (if one does not already exist in this map). + Adds the EdgeEnd to the (possibly new) node. + + + + + + The node if found; null otherwise. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An indicator that a Location is on a GraphComponent (0) + + + + + An indicator that a Location is to the left of a GraphComponent (1) + + + + + An indicator that a Location is to the right of a GraphComponent (2) + + + + + An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) + /// + + + + A Position indicates the position of a Location relative to a graph component + (Node, Edge, or Area). + + + + + Returns Positions.Left if the position is Positions.Right, + Positions.Right if the position is Left, or the position + otherwise. + + + + + + Utility functions for working with quadrants, which are numbered as follows: + + 1 | 0 + --+-- + 2 | 3 + + + + + + North-East + + + + + North-West + + + + + South-West + + + + + South-East + + + + + Only static methods! + + + + + Returns the quadrant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + If the displacements are both 0 + + + + Returns the quadrant of a directed line segment from p0 to p1. + + + + if the points are equal + + + + Returns true if the quadrants are 1 and 3, or 2 and 4. + + + + + + + Returns the right-hand quadrant of the halfplane defined by the two quadrants, + or -1 if the quadrants are opposite, or the quadrant if they are identical. + + + + + + + Returns whether the given quadrant lies within the given halfplane (specified + by its right-hand quadrant). + + + + + + + Returns true if the given quadrant is 0 or 1. + + + + + + A TopologyLocation is the labelling of a + GraphComponent's topological relationship to a single Geometry. + + + If the parent component is an area edge, each side and the edge itself + have a topological location. These locations are named: + + Onon the edge + Leftleft-hand side of the edge + Rightright-hand side + + + If the parent component is a line edge or node, there is a single + topological relationship attribute, On. + + The possible values of a topological location are + { , , , } + + The labelling is stored in an array _location[j] where + where j has the values On, Left, Right. + + + + + + + + + + + + Constructs a TopologyLocation specifying how points on, to the left of, and to the + right of some GraphComponent relate to some Geometry. Possible values for the + parameters are Location.Null, Location.Exterior, Location.Boundary, + and Location.Interior. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge updates only the Null attributes of this object + with the attributes of another. + + + + + + + + + + + Get calls Get(Positions posIndex), + Set calls SetLocation(Positions locIndex, Location locValue) + + + + + + + true if all locations are Null. + + + + + true if any locations are Null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An BinTree (or "Binary Interval Tree") + is a 1-dimensional version of a quadtree. + It indexes 1-dimensional intervals (which may + be the projection of 2-D objects on an axis). + It supports range searching + (where the range may be a single point). + + + + This structure is dynamic - + new items can be added at any time, + and it will support deletion of items + (although this is not currently implemented). + + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + This index is different to the Interval Tree of Edelsbrunner + or the Segment Tree of Bentley. + + + + + Ensure that the Interval for the inserted item has non-zero extents. + Use the current minExtent to pad it, if necessary. + + + + + + + + + + + + + + + + + Removes a single item from the tree. + + itemEnv the Envelope of the item to be removed + the item to remove + true if the item was found (and thus removed) + + + + + + + + + + + + + + + + + Queries the tree to find all candidate items which + may overlap the query interval. + If the query interval is null, all items in the tree are found. + min and max may be the same value. + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + + + + + + + + + + + + + + + + + Compute the total number of nodes in the tree. + + The number of nodes in the tree. + + + + A Key is a unique identifier for a node in a tree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node of a Bintree. + + + + + The base class for nodes in a Bintree. + + + + + Returns the index of the subnode that wholely contains the given interval. + If none does, returns -1. + + + + + + + + + + + + Subnodes are numbered as follows: + 0 | 1 + . + + + + + + + + + + + + + + + + + + + + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + Removes a single item from this subtree. + + The envelope containing the item + The item to remove + true if the item was found and removed + + + + + + + + + Gets whether this node is prunable + + + + + Gets whether this node has any children + + + + + + + + + + Gets whether this node has any subnodes + + + + + + + + + + + + + + + Creates a node + + The interval of the node item + A new node + + + + Creates a larger node, that contains both and + If is null, a node for is created. + + The original node + The additional interval + A new node + + + + Creates a new node instance + + The node's interval + The node's level + + + + + + + + + + + Returns the subnode containing the envelope. + Creates the node if + it does not already exist. + + + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subnode for the index. + If it doesn't exist, create it. + + + + + + + + + + + + Gets the node's + + + + + The root node of a single Bintree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the tree this is the root of. + + + + + + + Insert an item which is known to be contained in the tree rooted at + the given Node. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + The root node matches all searches. + + + + + + MonotoneChains are a way of partitioning the segments of a linestring to + allow for fast searching of intersections. + + + + They have the following properties: + + the segments within a monotone chain never intersect each other + the envelope of any contiguous subset of the segments in a monotone chain + is equal to the envelope of the endpoints of the subset. + + + + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows an efficient + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + One of the goals of this implementation of MonotoneChains is to be + as space and time efficient as possible. One design choice that aids this + is that a MonotoneChain is based on a subarray of a list of points. + This means that new arrays of points (potentially very large) do not + have to be allocated. + + MonotoneChains support the following kinds of queries: + + Envelope selectdetermine all the segments in the chain which + intersect a given envelope. + Overlapdetermine all the pairs of segments in two chains whose + envelopes overlap. + + + + This implementation of MonotoneChains uses the concept of internal iterators + ( and ) + to return the resultsets for the above queries. + This has time and space advantages, since it + is not necessary to build lists of instantiated objects to represent the segments + returned by the query. + Queries made in this manner are thread-safe. + + + + + + + + + + + + + + + Gets the line segment starting at + + The index of the segment + The line segment to extract to + + + + Determine all the line segments in the chain whose envelopes overlap + the searchEnvelope, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the select action on chain segments + which it can determine are not in the search envelope. + However, it *may* call the select action on segments + which do not intersect the search envelope. + This saves on the overhead of checking envelope intersection + each time, since clients may be able to do this more efficiently. + + The search envelope + The select action to execute on selected segments + + + + + + + + + + + + + Determine all the line segments in two chains which may overlap, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the overlap action on chain segments + which it can determine do not overlap. + However, it *may* call the overlap action on segments + which do not actually interact. + This saves on the overhead of checking intersection + each time, since clients may be able to do this more efficiently. + + The monotone chain + The overlap action to execute on selected segments + + + + + + + + + + + + + + + Gets or sets the Id + + + + + Gets the chain's context + + + + + Gets the chain's envelope + + + + + Gets the start index + + + + + Gets the end index of the underlying linestring + + + + + Return the subsequence of coordinates forming this chain. + Allocates a new array to hold the Coordinates. + + + + + Constructs s + for sequences of s. + + + + + Only static methods! + + + + + + + + + + + + + + + + + + + Return a list of the MonotoneChains + for the given list of coordinates. + + + + + + + Return an array containing lists of start/end indexes of the monotone chains + for the given list of coordinates. + The last entry in the array points to the end point of the point array, + for use as a sentinel. + + + + + + Finds the index of the last point in a monotone chain + starting at a given point. + Any repeated points (0-length segments) will be included + in the monotone chain returned. + + The coordinates + The start index + + The index of the last point in the monotone chain starting at start. + + + + + The action for the internal iterator for performing + overlap queries on a MonotoneChain. + + + + + This envelope is used during the MonotoneChain search process. + + + + + This envelope is used during the MonotoneChain search process. + + + + + + + + + + + + + + + This function can be overridden if the original chains are needed. + + + The index of the start of the overlapping segment from mc1. + + The index of the start of the overlapping segment from mc2. + + + + This is a convenience function which can be overridden to obtain the actual + line segments which overlap. + + + + + + + A visitor for nodes and items in an index. + + + + + + + + + + + A static index on a set of 1-dimensional intervals, + using an R-Tree packed based on the order of the interval midpoints. + + + It supports range searching, + where the range is an interval of the real line (which may be a single point). + A common use is to index 1-dimensional intervals which + are the projection of 2-D objects onto an axis of the coordinate system. + + This index structure is static + - items cannot be added or removed once the first query has been made. + The advantage of this characteristic is that the index performance + can be optimized based on a fixed set of items. + + Martin Davis + + + + + Adds an item to the index which is associated with the given interval + + The lower bound of the item interval + The upper bound of the item interval + The item to insert + if the index has already been queried + + + + Search for intervals in the index which intersect the given closed interval + and apply the visitor to them. + + The lower bound of the query interval + The upper bound of the query interval + The visitor to pass any matched items to + + + + The basic insertion and query operations supported by classes + implementing spatial index algorithms. + A spatial index typically provides a primary filter for range rectangle queries. A + secondary filter is required to test for exact intersection. Of course, this + secondary filter may consist of other tests besides intersection, such as + testing other kinds of spatial relationships. + + + + + Adds a spatial item with an extent specified by the given Envelope to the index. + + + + + Queries the index for all items whose extents intersect the given search Envelope + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A list of the items found by the query. + + + + Queries the index for all items whose extents intersect the given search , + and applies an to them. + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A visitor object to apply to the items found. + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + A node of a , which represents one or more points in the same location. + + The type of the object + dskea + + + + Creates a new KdNode. + + coordinate of point + coordinate of point + A data objects to associate with this node + + + + Creates a new KdNode. + + The point location of new node + A data objects to associate with this node + + + + Gets x-ordinate of this node + + + + + Gets y-ordinate of this node + + + + + Gets the location of this node + + + + + Gets the user data object associated with this node. + + + + + Gets or sets the left node of the tree + + + + + Gets or sets the right node of the tree + + + + + Gets the number of inserted points that are coincident at this location. + + + + + Gets whether more than one point with this value have been inserted (up to the tolerance) + + + + + + An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. + + + This implementation supports detecting and snapping points which are closer + than a given distance tolerance. + If the same point (up to tolerance) is inserted + more than once , it is snapped to the existing node. + In other words, if a point is inserted which lies within the tolerance of a node already in the index, + it is snapped to that node. + When a point is snapped to a node then a new node is not created but the count of the existing node + is incremented. + If more than one node in the tree is within tolerance of an inserted point, + the closest and then lowest node is snapped to. + + The type of the user data object + David Skea + Martin Davis + + + + Converts a collection of s to an array of s. + + A collection of nodes + An array of the coordinates represented by the nodes + + + + Converts a collection of {@link KdNode}s + to an array of s, + specifying whether repeated nodes should be represented + by multiple coordinates. + + a collection of nodes + true if repeated nodes should + be included multiple times + An array of the coordinates represented by the nodes + + + + Creates a new instance of a KdTree with a snapping tolerance of 0.0. + (I.e. distinct points will not be snapped) + + + + + Creates a new instance of a KdTree with a snapping distance + tolerance. Points which lie closer than the tolerance to a point already + in the tree will be treated as identical to the existing point. + + The tolerance distance for considering two points equal + + + + Inserts a new point in the kd-tree, with no data. + + The point to insert + The kdnode containing the point + + + + Inserts a new point into the kd-tree. + + The point to insert + A data item for the point + + A new KdNode if a new point is inserted, else an existing + node is returned with its counter incremented. This can be checked + by testing returnedNode.getCount() > 1. + + + + + Finds the node in the tree which is the best match for a point + being inserted. + The match is made deterministic by returning the lowest of any nodes which + lie the same distance from the point. + There may be no match if the point is not within the distance tolerance of any + existing node. + + The point being inserted + + + the best matching node + null if no match was found + + + + + + Inserts a point known to be beyond the distance tolerance of any existing node. + The point is inserted at the bottom of the exact splitting path, + so that tree shape is deterministic. + + The point to insert + + + The data for the point + The created node + + + + + + Performs a range search of the points in the index. + + The range rectangle to query + + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection of the KdNodes found + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection to accumulate the result nodes into + + + + Performs a nearest neighbor search of the points in the index. + + The point to search the nearset neighbor for + + + + Tests whether the index contains any items. + + + + + DoubleBits manipulates Double numbers + by using bit manipulation and bit-field extraction. + For some operations (such as determining the exponent) + this is more accurate than using mathematical operations + (which suffer from round-off error). + The algorithms and constants in this class + apply only to IEEE-754 double-precision floating point format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This computes the number of common most-significant bits in the mantissa. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + The number of common most-significant mantissa bits. + + + + A representation of the Double bits formatted for easy readability. + + + + + + + + + + Determines the exponent for the number. + + + + + Determines the exponent for the number. + + + + + Provides a test for whether an interval is + so small it should be considered as zero for the purposes of + inserting it into a binary tree. + The reason this check is necessary is that round-off error can + cause the algorithm used to subdivide an interval to fail, by + computing a midpoint value which does not lie strictly between the + endpoints. + + + + + This value is chosen to be a few powers of 2 less than the + number of bits available in the double representation (i.e. 53). + This should allow enough extra precision for simple computations to be correct, + at least for comparison purposes. + + + + + Only static methods! + + + + + Computes whether the interval [min, max] is effectively zero width. + I.e. the width of the interval is so much less than the + location of the interval that the midpoint of the interval cannot be + represented precisely. + + + + + A Key is a unique identifier for a node in a quadtree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a node of a Quadtree. Nodes contain + items which have a spatial extent corresponding to the node's position + in the quadtree. + + + + + The base class for nodes in a Quadtree. + + + + + Gets the index of the subquad that wholly contains the given envelope. + If none does, returns -1. + + The index of the subquad that wholly contains the given envelope
+ or -1 if no subquad wholly contains the envelope
+
+ + + + + + + + subquads are numbered as follows: + 2 | 3 + --+-- + 0 | 1 + + + + + + + + + + + Removes a single item from this subtree. + + The envelope containing the item. + The item to remove. + true if the item was found and removed. + + + + Insert items in this into the parameter! + + IList for adding items. + Parameter IList with this items. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the subquad containing the envelope . + Creates the subquad if + it does not already exist. + + The envelope to search for + The subquad containing the search envelope. + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subquad for the index. + If it doesn't exist, create it. + + + + + + + + + + + + + + + + + + A Quadtree is a spatial index structure for efficient range querying + of items bounded by 2D rectangles.
+ s can be indexed by using their s.
+ Any type of object can also be indexed, as long as it has an extent that can be + represented by an . + + This Quadtree index provides a primary filter + for range rectangle queries. The various query methods return a list of + all items which may intersect the query rectangle. Note that + it may thus return items which do not in fact intersect the query rectangle. + A secondary filter is required to test for actual intersection + between the query rectangle and the envelope of each candidate item. + The secondary filter may be performed explicitly, + or it may be provided implicitly by subsequent operations executed on the items + (for instance, if the index query is followed by computing a spatial predicate + between the query geometry and tree items, + the envelope intersection check is performed automatically. + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + + This data structure is also known as an MX-CIF quadtree + following the terminology usage of Samet and others. +
+
+ + + Ensure that the envelope for the inserted item has non-zero extents. + Use the current minExtent to pad the envelope, if necessary. + + + + + + + minExtent is the minimum envelope extent of all items + inserted into the tree so far. It is used as a heuristic value + to construct non-zero envelopes for features with zero X and/or Y extent. + Start with a non-zero extent, in case the first feature inserted has + a zero extent in both directions. This value may be non-optimal, but + only one feature will be inserted with this value. + + + + + Constructs a Quadtree with zero items. + + + + + + + + + + + + Removes a single item from the tree. + + The Envelope of the item to be removed. + The item to remove. + true if the item was found (and thus removed). + + + + Queries the tree and returns items which may lie in the given search envelope. + + + Precisely, the items that are returned are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be returned as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not returned - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A List of items which may intersect the search envelope + + + + Queries the tree and visits items which may lie in the given search envelope. + + + Precisely, the items that are visited are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be visited as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not visited - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A visitor object which is passed the visited items + + + + Return a list of all items in the Quadtree. + + + + + + + + + + + Returns the number of levels in the tree. + + + + + Tests whether the index contains any items. + + + + + Returns the number of items in the tree. + + + + + QuadRoot is the root of a single Quadtree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the quadtree this is the root of. + + + + + Insert an item which is known to be contained in the tree rooted at + the given QuadNode root. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + + + + + A node of an . A node is one of: + + empty + an interior node containing child s + a leaf node containing data items (s). + + A node stores the bounds of its children, and its level within the index tree. + + + + + Constructs an AbstractNode at the given level in the tree + + + 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Returns a representation of space that encloses this Boundable, + preferably not much bigger than this Boundable's boundary yet fast to + test for intersection with the bounds of other Boundables. The class of + object returned depends on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other + object (for other subclasses of AbstractSTRtree). + + + + + Adds either an AbstractNode, or if this is a leaf node, a data object + (wrapped in an ItemBoundable). + + + + + + Returns either child s, or if this is a leaf node, real data (wrapped + in s). + + + + + Gets the bounds of this node + + + + + Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Gets the count of the s at this node. + + + + + Tests whether there are any s at this node. + + + + + Base class for STRtree and SIRtree. STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + This implementation is based on s rather than just s, + because the STR algorithm operates on both nodes and + data, both of which are treated as s. + + + + + Set to null when index is built, to avoid retaining memory. + + + + Constructs an AbstractSTRtree with the specified maximum number of child + nodes that a node may have. + + + + + + Creates parent nodes, grandparent nodes, and so forth up to the root + node, for the data that has been inserted into the tree. Can only be + called once, and thus can be called only after all of the data has been + inserted into the tree. + + + + + + + + + + + + Sorts the childBoundables then divides them into groups of size M, where + M is the node capacity. + + + + + + + Creates the levels higher than the given level. + + The level to build on. + the level of the Boundables, or -1 if the boundables are item + boundables (that is, below level 0). + The root, which may be a ParentNode or a LeafNode. + + + + Also builds the tree, if necessary. + + + + + + Gets a tree structure (as a nested list) + corresponding to the structure of the items and nodes in this tree. + The returned Lists contain either Object items, + or Lists which correspond to subtrees of the tree + Subtrees which do not contain any items are not included. + Builds the tree if necessary. + + a List of items and/or Lists + + + + Removes an item from the tree. + (Builds the tree, if necessary.) + + + + + Returns the maximum number of child nodes that a node may have. + + + + + Tests whether the index contains any items. + This method does not build the index, + so items can still be inserted after it has been called. + + + + + Gets the number of elements in the tree + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + For STRtrees, the bounds will be Envelopes; + for SIRtrees, Intervals; + for other subclasses of AbstractSTRtree, some other class. + + The bounds of one spatial object. + The bounds of another spatial object. + Whether the two bounds intersect. + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Boundable wrapper for a non-Boundable spatial object. Used internally by + AbstractSTRtree. + + + + + + + + + + + + The bounds + + + + + The item + + + + + One-dimensional version of an STR-packed R-tree. SIR stands for + "Sort-Interval-Recursive". STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an SIRtree with the default (10) node capacity. + + + + + Constructs an SIRtree with the given maximum number of child nodes that + a node may have. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + + Returns items whose bounds intersect the given value. + + + + + + Returns items whose bounds intersect the given bounds. + + Possibly equal to x2. + Possibly equal to x1. + + + + + + + + + + + + + + + + + + + + + + + + + + + A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. + For two-dimensional spatial data. + The STR packed R-tree is simple to implement and maximizes space + utilization; that is, as many leaves as possible are filled to capacity. + Overlap between nodes is far less than in a basic R-tree. However, once the + tree has been built (explicitly or on the first call to #query), items may + not be added or removed. + Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an STRtree with the default (10) node capacity. + + + + + Constructs an STRtree with the given maximum number of child nodes that + a node may have. + + The minimum recommended capacity setting is 4. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates the parent level for the given child level. First, orders the items + by the x-values of the midpoints, and groups them into vertical slices. + For each slice, orders the items by the y-values of the midpoints, and + group them into runs of size M (the node capacity). For each run, creates + a new (parent) node. + + + + + + + + + + + + + + + + + + + + + + + + + Must be sorted by the x-value of the envelope midpoints. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + + + + + + + Finds the two nearest items in the tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + A distance metric applicable to the items in this tree + The pair of the nearest items + + + + Finds the item in this tree which is nearest to the given , + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + The query does not have to be + contained in the tree, but it does + have to be compatible with the + distance metric. + + The envelope of the query item + The item to find the nearest neighbour of + A distance metric applicable to the items in this tree and the query item + The nearest item in this tree + + + + Finds the two nearest items from this tree + and another tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + The result value is a pair of items, + the first from this tree and the second + from the argument tree. + + Another tree + A distance metric applicable to the items in the trees + The pair of the nearest items, one from each tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ProjectionEvents are ordered first by their x-value, and then by their eventType. + It is important that Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sweepline implements a sorted index on a set of intervals. + It is used to compute all overlaps between the interval in the index. + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a sequence of s in WKT format from a text file. + + The geometries in the file may be separated by any amount of whitespace and newlines. + + Martin Davis + + + + + Creates a new given the to read from and a to use to parse the geometries. + + the to read from + the geometry reader to use + + + + Creates a new , given the name of the file to read from. + + The name of the file to read from + The geometry reader to use + + + + Creates a new , given a to read with. + + The stream reader of the file to read from + The geometry reader to use + + + + Reads a sequence of geometries. + + + + If an offset is specified, geometries read up to the offset count are skipped. + If a limit is specified, no more than geometries are read. + + The list of geometries read + + + + Tests if reader is at EOF. + + + + + Gets/Sets the maximum number of geometries to read. + + + + + Gets/Sets the number of geometries to skip before reading. + + + + + Finds if two sets of s intersect. + + + Uses indexing for fast performance and to optimize repeated tests + against a target set of lines. + Short-circuited to return as soon an intersection is found. + + Immutable and thread-safe. + + + + + Creates an intersection finder against a given set of segment strings. + + The segment strings to search for intersections + + + + Tests for intersections with a given set of target {@link SegmentString}s. + + The SegmentStrings to test + true if an intersection was found + + + + Tests for intersections with a given set of target s. + using a given SegmentIntersectionDetector. + + The SegmentStrings to test + The intersection detector to use + true if the detector reports intersections + + + Gets the segment set intersector used by this class. + This allows other uses of the same underlying indexed structure. + + + + Intersects two sets of s using a index based + on s and a . + + Thread-safe and immutable. + + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of indexed segments. + + + + + + + Gets the index constructed over the base segment strings + + NOTE: To retain thread-safety, treat returned value as immutable + + + + Segment overlap action class + + + + + Creates an instance of this class using the provided + + The segment intersector to use + + + + Detects and records an intersection between two s, + if one exists. Only a single intersection is recorded. + + + This strategy can be configured to search for proper intersections. + In this case, the presence of any intersection will still be recorded, + but searching will continue until either a proper intersection has been found + or no intersections are detected. + + + + + Creates an intersection finder using a + + + + + Creates an intersection finder using a given + + The LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected. + + + Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). + + + + + Gets or sets whether processing must continue until a proper intersection is found + + + + + Gets or sets whether processing can terminate once any intersection is found. + + + + + Tests whether an intersection was found. + + + + + Tests whether a proper intersection was found. + + + + + Tests whether a non-proper intersection was found. + + + + + Gets the computed location of the intersection. Due to round-off, the location may not be exact. + + + + Gets the endpoints of the intersecting segments. + + An array of the segment endpoints (p00, p01, p10, p11) + + + + Tests whether processing can terminate, + because all required information has been obtained + (e.g. an intersection of the desired type has been detected). + + + + + Utility methods for processing s + + Martin Davis + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Converts a collection of s into a . + The geometry will be either a + or a (possibly empty). + + A collection of . + A geometry factory + A or a . + + + + Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. + These kinds of geometries are useful as a more complex geometry for testing algorithms. + + + Martin Davis + + + + + Computes various kinds of common geometric shapes. + Allows various ways of specifying the location and extent of the shapes, + as well as number of line segments used to form them. + + + + + Create a shape factory which will create shapes using the default GeometryFactory. + + + + + Create a shape factory which will create shapes using the given GeometryFactory. + + The factory to use. + + + + Creates a rectangular Polygon. + + A rectangular polygon. + + + + Creates a circular Polygon. + + A circular polygon. + + + + Creates an elliptical Polygon. + If the supplied envelope is square the + result will be a circle. + + An an ellipse or circle. + + + + Creates a squircular . + + a squircle + + + + Creates a supercircular + of a given positive power. + + a supercircle + + + + Creates a elliptical arc, as a LineString. + + The arc is always created in a counter-clockwise direction. + + Start angle in radians + Size of angle in radians + + + + + Creates an elliptical arc polygon. + + + The polygon is formed from the specified arc of an ellipse + and the two radii connecting the endpoints to the centre of the ellipse. + + Start angle in radians + Size of angle in radians + An elliptical arc polygon + + + + Gets/Sets the location of the shape by specifying the base coordinate + (which in most cases is the + lower left point of the envelope containing the shape). + + + + + Gets/Sets the location of the shape by specifying the centre of + the shape's bounding box. + + + + + Gets or sets the envelope of the shape + + + + + Gets/Sets the total number of points in the created Geometry. + + + + + Gets/Sets the size of the extent of the shape in both x and y directions. + + + + + Gets/Sets the width of the shape. + + + + + Gets/Sets the height of the shape. + + + + + Gets/Sets the rotation angle, in radians, to use for the shape. + The rotation is applied relative to the centre of the shape. + + + + + Creates a factory which will create sine stars using the default + + + + + Creates a factory which will create sine stars using the given + + The factory to use + + + + Generates the geometry for the sine star + + The geometry representing the sine star + + + Gets/Sets the number of arms in the star + + + + Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. + + Value should be between 0.0 and 1.0 + + + + Extends the class to allow reading values in the BigEndian format. + + + While extends + adding methods for reading integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for reading values in the BigEndian format. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + encoding is null. + The stream does not support reading, the stream is null, or the stream is already closed. + + + + Reads a 2-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by two bytes. + + + A 2-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 2-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by two bytes. + + + A 2-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by four bytes. + + + A 4-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by eight bytes. + + + An 8-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a string from the current stream. + The string is prefixed with the length, encoded as an integer seven bits at a time. + + The string being read. + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a decimal value from the current stream + and advances the current position of the stream by sixteen bytes. + + + A decimal value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Extends the class to allow writing values in the BigEndian format. + + + While extends + adding methods for writing integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for writing values in the BigEndian format. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The supplied stream. + output is null. + + The stream does not support writing, or the stream is already closed. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + output or encoding is null. + + The stream does not support writing, or the stream is already closed. + + + + Writes a two-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a two-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes a length-prefixed string to this stream in the current encoding + of the , + and advances the current position of the stream in accordance + with the encoding used and the specific characters being written to the stream. + + The value to write. + The stream is closed. + An I/O error occurs. + value is null. + + + + Writes a decimal value to the current stream and advances the stream position by sixteen bytes. + + The decimal value to write. + The stream is closed. + An I/O error occurs. + + + + Reads a GML document and creates a representation of the features based on NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + + + + Initialize reader with a standard . + + + + + Initialize reader with the given . + + + + + Read a GML document and returns relative . + + + + + + + Reads the coordinate. + + The reader. + + + + + Extract a from a x,y string value. + + + + + + + Extract a from a pos entity string value. + + + + + + + Extract a from a x,y string value. + + + + + builder. + + + + + Writes the GML representation of the features of NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + Thanks to rstuven for improvements :) + + + + + + Returns an XmlReader with feature informations. + Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. + + + + + + + Writes a GML feature into a generic Stream, such a FileStream or other streams. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formatter for double values of coordinates + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Converts a Well-Known Binary byte data to a Geometry. + + + The reader repairs structurally-invalid input + (specifically, LineStrings and LinearRings which contain + too few points have vertices added, + and non-closed rings are closed). + s + + + + Converts a hexadecimal string to a byte array. + The hexadecimal digit symbols are case-insensitive. + + A string containing hex digits + An array of bytes with the value of the hex string + + + true if structurally invalid input should be reported rather than repaired. + At some point this could be made client-controllable. + + + + Initialize reader with a standard . + + + + + Initialize reader with the given GeometryFactory. + + + + + + Reads a in binary WKB format from an array of s. + + The byte array to read from + The geometry read + if the WKB data is ill-formed. + + + + Reads a in binary WKB format from an . + + The stream to read from + The geometry read + if the WKB data is ill-formed. + + + + + + + + + + + + + + + + + Function to read a coordinate sequence. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to form a ring. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to serve a line string. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to convert from to + + The coordinate system + The corresponding + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Function to determine whether an ordinate should be handled or not. + + + + + + + The builder. + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + WKB Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + Point with Z coordinate. + + + + + LineString with Z coordinate. + + + + + Polygon with Z coordinate. + + + + + MultiPoint with Z coordinate. + + + + + MultiLineString with Z coordinate. + + + + + MultiPolygon with Z coordinate. + + + + + GeometryCollection with Z coordinate. + + + + + Point with M ordinate value. + + + + + LineString with M ordinate value. + + + + + Polygon with M ordinate value. + + + + + MultiPoint with M ordinate value. + + + + + MultiLineString with M ordinate value. + + + + + MultiPolygon with M ordinate value. + + + + + GeometryCollection with M ordinate value. + + + + + Point with Z coordinate and M ordinate value. + + + + + LineString with Z coordinate and M ordinate value. + + + + + Polygon with Z coordinate and M ordinate value. + + + + + MultiPoint with Z coordinate and M ordinate value. + + + + + MultiLineString with Z coordinate and M ordinate value. + + + + + MultiPolygon with Z coordinate and M ordinate value. + + + + + GeometryCollection with Z coordinate and M ordinate value. + + + + + Writes a Well-Known Binary byte data representation of a Geometry. + + + WKBWriter stores X,Y,Z values if is not , + otherwise value is discarded and only X,Y are stored. + + + + Converts a byte array to a hexadecimal string. + A byte array + + + Converts a byte array to a hexadecimal string. + A byte array + + + + Initializes writer with LittleIndian byte order. + + + + + Initializes writer with the specified byte order. + + Encoding type + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + M values, present or not, should be emitted + + + + Writes a WKB representation of a given point. + + + + + + + Writes a WKB representation of a given point. + + + + + + + + + + + + + + + Writes LittleIndian ByteOrder. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets or sets whether the value should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Standard byte size for each complex point. + Each complex point (LineString, Polygon, ...) contains: + 1 byte for ByteOrder and + 4 bytes for WKBType. + 4 bytes for SRID value + + + + + Gets a value whether or not EWKB featues may be used. + EWKB features are + 0x80000000 flag if geometry's z-ordinate values are written + 0x40000000 flag if geometry's m-ordinate values are written + 0x20000000 flag if geometry's SRID value is written + + + + + Converts a Well-Known Text string to a Geometry. + + The WKTReader allows + extracting Geometry objects from either input streams or + internal strings. This allows it to function as a parser to read Geometry + objects from text blocks embedded in other data formats (e.g. XML). + + The Well-known + Text format is defined in the + OpenGIS Simple Features Specification for SQL . + + NOTE: There is an inconsistency in the SFS. + The WKT grammar states that MultiPoints are represented by + MULTIPOINT ( ( x y), (x y) ), + but the examples show MultiPoints as MULTIPOINT ( x y, x y ). + Other implementations follow the latter syntax, so NTS will adopt it as well. + A WKTReader is parameterized by a GeometryFactory, + to allow it to create Geometry objects of the appropriate + implementation. In particular, the GeometryFactory will + determine the PrecisionModel and SRID that is used. + The WKTReader will convert the input numbers to the precise + internal representation. + + reads also non-standard "LINEARRING" tags. + + + + + + Creates a WKTReader that creates objects using a basic GeometryFactory. + + + + + Creates a WKTReader that creates objects using the given + GeometryFactory. + + The factory used to create Geometrys. + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + A Reader which will return a "Geometry Tagged Text" + string (see the OpenGIS Simple Features Specification). + + A Geometry read from reader. + + + + + Returns the next array of Coordinates in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next element returned by the stream should be "(" (the + beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". + + + if set to true skip extra parenthesis around coordinates. + + + The next array of Coordinates in the + stream, or an empty array if "EMPTY" is the next element returned by + the stream. + + + + + + + + + + + + + + + + + + + + Returns the next number in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a number. + + The next number in the stream. + if the next token is not a valid number + + + + Returns the next "EMPTY" or "(" in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be "EMPTY" or "(". + + + The next "EMPTY" or "(" in the stream as uppercase text. + + + + Returns the next ")" or "," in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")" or ",". + + + The next ")" or "," in the stream. + + + + Returns the next ")" in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")". + + + The next ")" in the stream. + + + + Returns the next word in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a word. + + The next word in the stream as uppercase text. + + + + Creates a Geometry using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Geometry Tagged Text. + + A Geometry specified by the next token + in the stream. + + + + Creates a Point using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Point Text. + + + A Point specified by the next token in + the stream. + + + + Creates a LineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + + A LineString specified by the next + token in the stream. + + + + Creates a LinearRing using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + A LinearRing specified by the next + token in the stream. + + + + Creates a MultiPoint using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <MultiPoint Text. + + + + A MultiPoint specified by the next + token in the stream. + + + + Creates an array of Points having the given Coordinates. + + + The Coordinates with which to create the Points + + The factory to create the points + + Points created using this WKTReader + s GeometryFactory. + + + + + Creates a Polygon using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a Polygon Text. + + + + A Polygon specified by the next token + in the stream. + + + + + Creates a MultiLineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiLineString Text. + + + + A MultiLineString specified by the + next token in the stream. + + + + Creates a MultiPolygon using the next token in the stream. + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiPolygon Text. + + + + A MultiPolygon specified by the next + token in the stream, or if if the coordinates used to create the + Polygon shells and holes do not form closed linestrings. + + + + Creates a GeometryCollection using the next token in the + stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <GeometryCollection Text. + + + + A GeometryCollection specified by the + next token in the stream. + + + + Gets or sets the factory to create geometries + + + + + Gets or sets the default SRID + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Outputs the textual representation of a . + The outputs coordinates rounded to the precision + model. No more than the maximum number of necessary decimal places will be + output. + The Well-known Text format is defined in the OpenGIS Simple Features + Specification for SQL. + A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does + not define a special tag for LinearRings. The standard tag to use is + "LINESTRING". + + + + + Generates the WKT for a Point specified by a . + + The point coordinate. + The WKT + + + + Generates the WKT for a N-point LineString specified by a . + + The sequence to write. + The WKT + + + Generates the WKT for a LINESTRING + specified by a {@link CoordinateSequence}. + + @param seq the sequence to write + + @return the WKT string + + + + Generates the WKT for a LineString specified by two s. + + The first coordinate. + The second coordinate. + The WKT + + + + Creates the NumberFormatInfo used to write doubles + with a sufficient number of decimal places. + + + The PrecisionModel used to determine + the number of decimal places to write. + + + A NumberFormatInfo that write doubles + without scientific notation. + + + + + Returns a String of repeated characters. + + The character to repeat. + The number of times to repeat the character. + A string of characters. + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Stream to write into + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + + A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + + A Geometry Tagged Text string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process + + + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification). + + + + + Converts a Geometry to <Geometry Tagged Text format, + then appends it to the writer. + + /he Geometry to process. + + /he output writer to append to. + + + + Converts a Coordinate to Point Tagged Text format, + then appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a LineString to <LineString Tagged Text + format, then appends it to the writer. + + The LineString to process. + + The output writer to append to. + + + + Converts a LinearRing to <LinearRing Tagged Text + format, then appends it to the writer. + + The LinearRing to process. + + The output writer to append to. + + + + Converts a Polygon to Polygon Tagged Text format, + then appends it to the writer. + + The Polygon to process. + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Tagged Text + format, then appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to MultiLineString Tagged + Text format, then appends it to the writer. + + The MultiLineString to process. + + The output writer to append to. + + + + Converts a MultiPolygon to MultiPolygon Tagged Text + format, then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollection + Tagged Text format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + Converts a Coordinate to Point Text format, then + appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + Appends the i'th coordinate from the sequence to the writer + the to process + the index of the coordinate to write + writer the output writer to append to + + + + + Converts a Coordinate to Point format, then appends + it to the writer. + + The Coordinate to process. + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a to a . + + The to convert. + + The as a . + + + + Converts a to <LineString Text> format, then appends it to the writer + + + + + Converts a LineString to <LineString Text format, then + appends it to the writer. + + The LineString to process. + + + The output writer to append to. + + + + Converts a Polygon to Polygon Text format, then + appends it to the writer. + + The Polygon to process. + + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Text format, then + appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to <MultiLineString Text + format, then appends it to the writer. + + The MultiLineString to process. + + + The output writer to append to. + + + + Converts a MultiPolygon to <MultiPolygon Text format, + then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollectionText + format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + + + + + + + + + + + + + + + + + Gets/sets whther the output woll be formatted + + + + + Gets/sets the maximum number of coordinates per line written in formatted output. + + If the provided coordinate number is < 0, coordinates will be written all on one line. + + + Gets/sets the tab size to use for indenting. + If the size is non-positive + + + + Extracts the subline of a linear between + two s on the line. + + + + + Computes the subline of a between + two s on the line. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The line to use as the baseline. + The start location. + The end location. + The extracted subline. + + + + Initializes a new instance of the class. + + + + + + Extracts a subline of the input. + If is minor that , + the linear geometry computed will be reversed. + + The start location. + The end location. + A linear geometry. + + + + + + + + + + + Assumes input is valid + (e.g. minor or equals to ). + + + + + + + + Supports linear referencing along a linear + using the length along the line as the index. + Negative length values are taken as measured in the reverse direction + from the end of the geometry. + Out-of-range index values are handled by clamping + them to the valid range of values. + Non-simple lines (i.e. which loop back to cross or touch + themselves) are supported. + + + + + Constructs an object which allows a linear + to be linearly referenced using length as an index. + + The linear geometry to reference along. + + + + Computes the for the point + on the line at the given index. + If the index is out of range the first or last point on the + line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the lies before the , + the computed geometry is reversed. + + + + + + + + + + + + + + + Computes the minimum index for a point on the line. + If the line is not simple (i.e. loops back on itself) + a single point may have more than one possible index. + In this case, the smallest index is returned. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The minimum index of the point. + + + + + Finds the index for a point on the line + which is greater than the given index. + If no such index exists, returns . + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The value the returned index must be greater than. + The index of the point greater than the given minimum index. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline.. + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + + + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line + by clamping the given index to the valid range of index values + + A valid index value + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Finds the nearest index along the linear + to a given after the specified minimum index. + If possible the location returned will be strictly + greater than the . + If this is not possible, the value returned + will equal . + (An example where this is not possible is when + = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + + + + + + + + + + + + + + + + + + Computes the for a given length + along a linear + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + + + + + Computes the for a + given length along a linear . + + The linear geometry to use. + The length index of the location. + The for the length. + + + + Computes the for a + given length along a linear , + with control over how the location + is resolved at component endpoints. + + The linear geometry to use + The length index of the location + If true lengths are resolved to the lowest possible index + + + + Computes the length for a given + on a linear . + + The linear geometry to use. + The index of the location. + The length for the . + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest possible location value. + + The length index. + The corresponding . + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest or highest possible location value, + depending on the value of resolveLower + + The length index + + The corresponding . + + + + + + + + + + + + + + + + + + Builds a linear geometry ( or ) + incrementally (point-by-point). + + + + + Creates an instance of this class. + + The geometry factory to use. + + + + Adds a point to the current line. + + The to add. + + + + Adds a point to the current line. + + The to add. + If true, allows the insertions of repeated points. + + + + Terminate the current . + + + + + + + + + + + + Builds and returns the . + + + + + + Allows invalid lines to be fixed rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + Allows invalid lines to be ignored rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + + + + + + An iterator over the components and coordinates of a linear geometry + (s and s. + + + + + + + + + + + + Invariant: currentLine <> null if the iterator is pointing at a valid coordinate + + + + + Creates an iterator initialized to the start of a linear . + + The linear geometry to iterate over. + if is not + + + + Creates an iterator starting at a on a linear . + + The linear geometry to iterate over. + The location to start at. + if is not + + + + Creates an iterator starting at + a component and vertex in a linear . + + The linear geometry to iterate over. + The component to start at. + The vertex to start at. + if is not + + + + + + + + + Tests whether there are any vertices left to iterator over. + Specifically, HasNext() returns true if the + current state of the iterator represents a valid location + on the linear geometry. + + true if there are more vertices to scan. + + + + Jump to the next element of the iteration. + + + + + Checks whether the iterator cursor is pointing to the + endpoint of a component . + + + + + The component index of the vertex the iterator is currently at. + + + + + The vertex index of the vertex the iterator is currently at. + + + + + Gets the component the iterator is current at. + + + + + Gets the first of the current segment + (the coordinate of the current vertex). + + + + + Gets the second of the current segment + (the coordinate of the next vertex). + If the iterator is at the end of a line, null is returned. + + + + + Represents a location along a or .
+ The referenced geometry is not maintained within this location, + but must be provided for operations which require it. + Various methods are provided to manipulate the location value + and query the geometry it references. +
+
+ + + Gets a location which refers to the end of a linear . + + The linear geometry. + A new LinearLocation. + + + + Computes the of a point a given fraction + along the line segment (p0, p1). + + + + If the fraction is greater than 1.0 the last + point of the segment is returned. + If the fraction is less than or equal to 0.0 the first point + of the segment is returned. + + The Z ordinate is interpolated from the Z-ordinates of the given points, + if they are specified. + + The first point of the line segment. + The last point of the line segment. + The length to the desired point. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + If true, ensures the individual values are locally valid. + + + + Creates a new location equal to a given one. + + A linear location + + + + Ensures the individual values are locally valid. + Does not ensure that the indexes are valid for + a particular linear geometry. + + + + + Ensures the indexes are valid for a given linear . + + A linear geometry. + + + + Snaps the value of this location to + the nearest vertex on the given linear , + if the vertex is closer than . + + A linear geometry. + The minimum allowable distance to a vertex. + + + + Gets the length of the segment in the given + Geometry containing this location. + + A linear geometry. + The length of the segment. + + + + Sets the value of this location to + refer to the end of a linear geometry. + + The linear geometry to use to set the end. + + + + Gets the along the + given linear which is + referenced by this location. + + A linear geometry. + The at the location. + + + + Gets a representing the segment of the given linear which contains this location. + + A linear geometry + the LineSegment containing the location + + + + Tests whether this location refers to a valid + location on the given linear . + + A linear geometry. + true if this location is valid. + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + is not the same type as this instance. + + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + + + Compares this object with the specified index values for order. + + The component index. + The segment index. + The segment fraction. + + A negative integer, zero, or a positive integer as this LineStringLocation + is less than, equal to, or greater than the specified locationValues. + + + + + Compares two sets of location values for order. + + The first component index. + The first segment index. + The first segment fraction. + The second component index. + The second segment index. + The second segment fraction. + + A negative integer, zero, or a positive integer + as the first set of location values is less than, equal to, + or greater than the second set of locationValues. + + + + + Tests whether two locations are on the same segment in the parent . + + A location on the same geometry + true if the locations are on the same segment of the parent geometry + + + + Tests whether this location is an endpoint of + the linear component it refers to. + + The linear geometry referenced by this location + True if the location is a component endpoint + + + + Converts a linear location to the lowest equivalent location index. + The lowest index has the lowest possible component and segment indices. + Specifically: + * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) + * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned + If the location index is already the lowest possible value, the original location is returned. + + The linear geometry referenced by this location. + The lowest equivalent location. + + + + Copies this location. + + A copy of this location. + + + + Gets the component index for this location. + + + + + Gets the segment index for this location. + + + + + Gets the segment fraction for this location. + + + + + Tests whether this location refers to a vertex: + returns true if the location is a vertex. + + + + + Supports linear referencing along a linear + using s as the index. + + + + + Constructs an object which allows linear referencing along + a given linear . + + The linear geometry to reference alo + + + + Computes the for the point on the line at the given index. + If the is out of range, + the first or last point on the line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point + on the line at the given index, offset by the given distance. + If the index is out of range the first or last point on the + line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment + (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The index of the start of the interval. + The index of the end of the interval. + The linear interval between the indices. + + + + Computes the index for a given point on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The index of the point. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline. + + + + Finds the index for a point on the line which is greater than the given index. + If no such index exists, returns . + + + + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + + + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + + A point on the line + The value the returned index must be greater than + The index of the point greater than the given minimum index + + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + A point on the line. + The index of the point. + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line by clamping + the given index to the valid range of index values. + + + A valid index value. + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + Determines the location of a subline along a linear . + The location is reported as a pair of s. + NOTE: Currently this algorithm is not guaranteed to + return the correct substring in some situations where + an endpoint of the test line occurs more than once in the input line. + (However, the common case of a ring is always handled correctly). + + + + + + + + + + + + + Initializes a new instance of the class. + + The linear geom. + + + + + + + + + + + Computes the of the point + on a linear nearest a given . + The nearest point is not necessarily unique; this class + always computes the nearest point closest + to the start of the geometry. + + + + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Find the nearest along the linear + to a given after the specified minimum . + If possible the location returned will be strictly greater than the . + If this is not possible, the value returned will equal . + (An example where this is not possible is when = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + Represents a list of contiguous line segments, + and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + An interface for classes which represent a sequence of contiguous line segments. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + + + + + Gets/Sets the user-defined data for this segment string. + + + + + Points that make up ISegmentString + + + + + Size of Coordinate Sequence + + + + + States whether ISegmentString is closed + + + + + Creates a new segment string from a list of vertices. + + the vertices of the segment string + the user-defined data of this segment string (may be null) + + + + Gets the octant of the segment starting at vertex index + + the index of the vertex starting the segment. Must not be the last index in the vertex list + octant of the segment at the vertex + + + Gets the user-defined data for this segment string. + + + + + Validates that a collection of s is correctly noded. + Indexing is used to improve performance. + + + + In the most common use case, validation stops after a single + non-noded intersection is detected, + but the class can be requested to detect all intersections + by using the property. + + The validator does not check for a-b-a topology collapse situations. + + The validator does not check for endpoint-interior vertex intersections. + This should not be a problem, since the JTS noders should be + able to compute intersections between vertices correctly. + + + The client may either test the condition, + or request that a suitable be thrown. + + + + + + Creates a new noding validator for a given set of linework. + + A collection of s + + + + Returns an error message indicating the segments containing the intersection. + + an error message documenting the intersection location + + + + Checks for an intersection and throws + a TopologyException if one is found. + + if an intersection is found + + + + Gets or sets whether all intersections should be found. + + + + + Gets a list of all intersections found. + + Intersections are represented as s. + List is empty if none were found. + + + + + + Checks for an intersection and reports if one is found. + + + + + An interface for classes which support adding nodes to a segment string. + + + + Adds an intersection node for a given point and segment to this segment string. + + the location of the intersection + the index of the segment containing the intersection + + + + + + + + Creates an intersection finder which tests if there is at least one interior intersection. + Uses short-circuiting for efficient performance. + The intersection found is recorded. + + A line intersector. + A intersection finder which tests if there is at least one interior intersection. + + + + Creates an intersection finder which finds all interior intersections. + The intersections are recorded for later inspection. + + A line intersector. + a intersection finder which finds all interior intersections. + + + + Creates an intersection finder which counts all interior intersections. + The intersections are note recorded to reduce memory usage. + + A line intersector. + a intersection finder which counts all interior intersections. + + + + Creates an intersection finder which finds an interior intersection if one exists + + the LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + Tests whether a segment in a is an end segment. + (either the first or last). + + a segment string + the index of a segment in the segment string + true if the segment is an end segment + + + + Gets/Sets whether all intersections should be computed. + + When this is false (the default value), the value of + is true after the first intersection is found. + Default is false. + + + + + + Gets/Sets whether intersection points are recorded. + + If the only need is to count intersection points, this can be set to false. + Default is true. + + + + + + Gets/Sets whether only end segments should be tested for interior intersection. + This is a performance optimization that may be used if + the segments have been previously noded by an appropriate algorithm. + It may be known that any potential noding failures will occur only in + end segments. + + + + + Tests whether an intersection was found. + + + + + Gets the intersections found. + + A list of . + + + + Gets the count of intersections found. + + The intersection count. + + + + Gets the computed location of the intersection. + Due to round-off, the location may not be exact. + + + + + Gets the endpoints of the intersecting segments. + + + + + Computes the possible intersections between two line segments in s + and adds them to each string + using . + + + + + + + + + + + + These variables keep track of what types of intersections were + found during ALL edges that have been intersected. + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning and end segments. + + + + + + + + + + This method is called by clients + of the class to process + intersections for two segments of the being intersected.
+ Note that some clients (such as MonotoneChain") may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Returns the proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire , since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the . + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this . + + + + + An interior intersection is an intersection which is + in the interior of some segment. + + + + + Always process all intersections + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + This class is obsolete. + Use instead. + + + + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Nodes a set of s completely. + The set of s is fully noded; + i.e. noding is repeated until no further intersections are detected. + + Iterated noding using a precision model is not guaranteed to converge, + due to roundoff error. This problem is detected and an exception is thrown. + Clients can choose to rerun the noding using a lower precision model. + + + + + + Computes all intersections between segments in a set of s. + Intersections found are represented as s and added to the + s in which they occur. + As a final step in the noding a new set of segment strings split at the nodes may be returned. + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Fully nodes a list of s, i.e. peforms noding iteratively + until no intersections are found between segments. + Maintains labelling of edges correctly through the noding. + + A collection of SegmentStrings to be noded. + If the iterated noding fails to converge. + + + + Node the input segment strings once + and create the split edges between the nodes. + + + + + + + Gets/Sets the maximum number of noding iterations performed before + the noding is aborted. Experience suggests that this should rarely need to be changed + from the default. The default is . + + + + + Nodes a set of s using a index based + on s and a . + The used should be something that supports + envelope (range) queries efficiently (such as a Quadtree" + or . + + + + + Base class for s which make a single pass to find intersections. + This allows using a custom + (which for instance may simply identify intersections, rather than insert them). + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Gets/sets the to use with this noder. + A will normally add intersection nodes + to the input segment strings, but it may not - it may + simply record the presence of intersections. + However, some s may require that intersections be added. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The + + + + + + + + + + + + + Validates that a collection of s is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Creates a new validator for the given collection + of s. + + The seg strings. + + + + Checks whether the supplied segment strings + are correctly noded. Throws an exception if they are not. + + + + + Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). + + + + + Checks all pairs of segments for intersections at an interior point of a segment. + + + + + Checks for intersections between an endpoint of a segment string + and an interior vertex of another segment string + + + + + Octants in the Cartesian plane. + Octants are numbered as follows: + + \2|1/ + 3 \|/ 0 + ---+-- + 4 /|\ 7 + /5|6\ + + If line segments lie along a coordinate axis, the octant is the lower of the two possible values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Methods for computing and working with of the Cartesian plane. + + + + + Returns the octant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + + + + + Returns the octant of a directed line segment from p0 to p1. + + + + + + + + Allows comparing arrays in an orientation-independent way. + + + + + Creates a new } + for the given array. + + + + + + Computes the canonical orientation for a coordinate array. + + + + true if the points are oriented forwards
+ or falseif the points are oriented in reverse. +
+
+ + + Compares two s for their relative order. + + + + -1 this one is smaller;
+ 0 the two objects are equal;
+ 1 this one is greater. +
+
+ + + + + + + + + + + + + Wraps a and transforms its input into the integer domain. + This is intended for use with Snap-Rounding noders, + which typically are only intended to work in the integer domain. + Offsets can be provided to increase the number of digits of available precision. + + Clients should be aware that rescaling can involve loss of precision, + which can cause zero-length line segments to be created. + These in turn can cause problems when used to build a planar graph. + This situation should be checked for and collapsed segments removed if necessary. + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an intersection point between two s. + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + -1 this SegmentNode is located before the argument location;
+ 0 this SegmentNode is at the argument location;
+ 1 this SegmentNode is located after the argument location. +
+
+ + + + + + + + + Gets the giving the location of this node. + + + + + + + + + + + A list of the s present along a noded . + + + + + Initializes a new instance of the class. + + The edge. + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + The SegmentIntersection found or added. + + + + Returns an iterator of SegmentNodes. + + An iterator of SegmentNodes. + + + + Adds nodes for the first and last points of the edge. + + + + + Adds nodes for any collapsed edge pairs. + Collapsed edge pairs can be caused by inserted nodes, or they can be + pre-existing in the edge vertex list. + In order to provide the correct fully noded semantics, + the vertex at the base of a collapsed pair must also be added as a node. + + + + + Adds nodes for any collapsed edge pairs + which are pre-existing in the vertex list. + + + + + + Adds nodes for any collapsed edge pairs caused by inserted nodes + Collapsed edge pairs occur when the same coordinate is inserted as a node + both before and after an existing edge vertex. + To provide the correct fully noded semantics, + the vertex must be added as a node as well. + + + + + + + + + + + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the provided argument list + (this is so a single list can be used to accumulate all split edges + for a set of s). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + Gets the list of coordinates for the fully noded segment string, + including all original segment string vertices and vertices + introduced by nodes in this list. + Repeated coordinates are collapsed. + + An array of s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not implemented. + + This method is not implemented. + + + + + + + + + + + + + + + + + + + + Implements a robust method of comparing the relative position of two points along the same segment. + The coordinates are assumed to lie "near" the segment. + This means that this algorithm will only return correct results + if the input coordinates have the same precision and correspond to rounded values + of exact coordinates lying on the segment. + + + + + Compares two s for their relative position along a segment + lying in the specified . + + + + + + -1 if node0 occurs first, or
+ 0 if the two nodes are equal, or
+ 1 if node1 occurs first. +
+
+ + + + + + + + + + + + + + + + + + + Represents a list of contiguous line segments, and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + s can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + Gets the s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A collection of NodedSegmentStrings representing the substrings + + + + Adds the noded s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A list which will collect the NodedSegmentStrings representing the substrings + + + + Creates a new segment string from a list of vertices. + + The vertices of the segment string. + The user-defined data of this segment string (may be null). + + + + + + + + + + + Gets the octant of the segment starting at vertex index. + + + The index of the vertex starting the segment. + Must not be the last index in the vertex list + + The octant of the segment at the vertex + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an for intersection intIndex. + An intersection that falls exactly on a vertex + of the is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + + + + + + + + Gets/Sets the user-defined data for this segment string. + + + + + + + + + + + + + + + + + + + + + + + + + + Dissolves a noded collection of s to produce + a set of merged linework with unique segments. + + + A custom merging strategy + can be supplied. + This strategy will be called when two identical (up to orientation) + strings are dissolved together. + The default merging strategy is simply to discard one of the merged strings. + + A common use for this class is to merge noded edges + while preserving topological labelling. + This requires a custom merging strategy to be supplied + to merge the topology labels appropriately. + + + + + + Creates a dissolver with a user-defined merge strategy. + + + + + + Creates a dissolver with the default merging strategy. + + + + + Dissolve all s in the input . + + + + + + + + + + + + + Dissolve the given . + + + + + + + + + Gets the collection of dissolved (i.e. unique) s + + + + + A merging strategy which can be used to update the context data of s + which are merged during the dissolve process. + + mbdavis + + + + Updates the context data of a + when an identical (up to orientation) one is found during dissolving. + + The segment string to update. + The segment string being dissolved. + + true if the strings are in the same direction, + false if they are opposite. + + + + + Nodes a set of s by + performing a brute-force comparison of every segment to every other one. + This has n^2 performance, so is too slow for use on large numbers of segments. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Nodes the linework in a list of s using Snap-Rounding + to a given . + + The input coordinates are expected to be rounded + to the given precision model. + This class does not perform that function. + GeometryPrecisionReducer" may be used to do this. + + This class does not dissolve the output linework, + so there may be duplicate linestrings in the output. + Subsequent processing (e.g. polygonization) may require + the linework to be unique. Using UnaryUnion is one way + to do this (although this is an inefficient approach). + + + + + Creates a new noder which snap-rounds to a grid specified by the given + + The precision model for the grid to snap-round to. + + + + Nodes the linework of a set of Geometrys using SnapRounding. + + A collection of Geometrys of any type + A list of LineStrings representing the noded linework of the input + + + + Gets or sets whether noding validity is checked after noding is performed. + + + + + Implements a "hot pixel" as used in the Snap Rounding algorithm. + A hot pixel contains the interior of the tolerance square and the boundary + minus the top and right segments. + The hot pixel operations are all computed in the integer domain + to avoid rounding problems. + + + + + Initializes a new instance of the class. + + The coordinate at the center of the hot pixel + The scale factor determining the pixel size + THe intersector to use for testing intersection with line segments + + + + Returns a "safe" envelope that is guaranteed to contain the hot pixel. + The envelope returned will be larger than the exact envelope of the pixel. + + An envelope which contains the pixel + + + + + + + + + + + + + + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + The first coordinate of the line segment to test + The second coordinate of the line segment to test + true if the line segment intersects this hot pixel. + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + + + + + + + + + + + + + + Tests whether the segment p0-p1 intersects the hot pixel tolerance square. + Because the tolerance square point set is partially open (along the + top and right) the test needs to be more sophisticated than + simply checking for any intersection. + However, it can take advantage of the fact that the hot pixel edges + do not lie on the coordinate grid. + It is sufficient to check if any of the following occur: + - a proper intersection between the segment and any hot pixel edge. + - an intersection between the segment and BOTH the left and bottom hot pixel edges + (which detects the case where the segment intersects the bottom left hot pixel corner). + - an intersection between a segment endpoint and the hot pixel coordinate. + + + + + + + + Test whether the given segment intersects + the closure of this hot pixel. + This is NOT the test used in the standard snap-rounding + algorithm, which uses the partially closed tolerance square instead. + This routine is provided for testing purposes only. + + + + + + + + Adds a new node (equal to the snap pt) to the specified segment + if the segment passes through the hot pixel + + + + true if a node was added to the segment + + + + Gets the coordinate this hot pixel is based at. + + + + + "Snaps" all s in a containing + s to a given . + + + + + Initializes a new instance of the class. + + + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + The edge containing the vertex, if applicable, or null. + + true if a node was added for this pixel. + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + true if a node was added for this pixel. + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + Uses Snap Rounding to compute a rounded, + fully noded arrangement from a set of s. + Implements the Snap Rounding technique described in + papers by Hobby, Guibas and Marimont, and Goodrich et al. + Snap Rounding assumes that all vertices lie on a uniform grid; + hence the precision model of the input must be fixed precision, + and all the input vertices must be rounded to that precision. + + This implementation uses a monotone chains and a spatial index to + speed up the intersection tests. + This implementation appears to be fully robust using an integer precision model. + It will function with non-integer precision models, but the + results are not 100% guaranteed to be correctly noded. + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + + Does NOT node the segStrings. + + + + A list of Coordinates for the intersections. + + + + Snaps segments to nodes created by segment intersections. + + + + + + Snaps segments to all vertices + + The list of segment strings to snap together + + + + Snaps segments to the vertices of a Segment String. + + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + A Collection of NodedSegmentStrings representing the substrings + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + A collection of NodedSegmentStrings + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + Does NOT node the segStrings. + + + + A list of s for the intersections. + + + + Computes nodes introduced as a result of snapping segments to snap points (hot pixels). + + + + + + + + + + + + + + Computes nodes introduced as a result of + snapping segments to vertices of other segments. + + The list of segment strings to snap together + + + + Performs a brute-force comparison of every segment in each . + This has n^2 performance. + + + + + + + Computes the boundary of a . + Allows specifying the to be used. + This operation will always return a of the appropriate + dimension for the boundary (even if the input geometry is empty). + The boundary of zero-dimensional geometries (Points) is + always the empty . + + Martin Davis + + + + A map which maintains the edges in sorted order around the node. + + + + + Stores an integer count, for use as a Map entry. + + Martin Davis + + + + Builds the buffer geometry for a given input geometry and precision model. + Allows setting the level of approximation for circular arcs, + and the precision model in which to carry out the computation. + + + When computing buffers in floating point double-precision + it can happen that the process of iterated noding can fail to converge (terminate). + In this case a will be thrown. + Retrying the computation in a fixed precision + can produce more robust results. + + + + Compute the change in depth as an edge is crossed from R to L + + + Creates a new BufferBuilder + + + + Inserted edges are checked to see if an identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + + + + Completes the building of the input subgraphs by depth-labelling them, + and adds them to the PolygonBuilder. + + + The subgraph list must be sorted in rightmost-coordinate order. + + the subgraphs to build + the PolygonBuilder which will build the final polygons + + + + Gets the standard result for an empty buffer. + Since buffer always returns a polygonal result, this is chosen to be an empty polygon. + + The empty result geometry + + + + Sets the precision model to use during the curve computation and noding, + if it is different to the precision model of the Geometry. + + + If the precision model is less than the precision of the Geometry precision model, + the Geometry must have previously been rounded to that precision. + + + + + Sets the to use during noding. + This allows choosing fast but non-robust noding, or slower + but robust noding. + + + + + Simplifies a buffer input line to remove concavities with shallow depth. + + + + The most important benefit of doing this + is to reduce the number of points and the complexity of + shape which will be buffered. + It also reduces the risk of gores created by + the quantized fillet arcs (although this issue + should be eliminated in any case by the + offset curve generation logic). + + + A key aspect of the simplification is that it + affects inside (concave or inward) corners only. + Convex (outward) corners are preserved, since they + are required to ensure that the generated buffer curve + lies at the correct distance from the input geometry. + + + Another important heuristic used is that the end segments + of the input are never simplified. This ensures that + the client buffer code is able to generate end caps faithfully. + + + No attempt is made to avoid self-intersections in the output. + This is acceptable for use for generating a buffer offset curve, + since the buffer algorithm is insensitive to invalid polygonal + geometry. However, + this means that this algorithm + cannot be used as a general-purpose polygon simplification technique. + + + Martin Davis + + + + Simplify the input coordinate list. + If the distance tolerance is positive, + concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, + concavities on the RIGHT side of the line are simplified. + + The coordinate list to simplify + simplification distance tolerance to use + The simplified coordinate list + + + + Simplify the input coordinate list. + + + If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. + + Simplification distance tolerance to use + + The simplified coordinates list + + + + + Uses a sliding window containing 3 vertices to detect shallow angles + in which the middle vertex can be deleted, since it does not + affect the shape of the resulting buffer in a significant way. + + + + + + Finds the next non-deleted index, or the end of the point array if none + + The start index to search from + The next non-deleted index, if any
+ or _inputLine.Length if there are no more non-deleted indices +
+
+ + + Checks for shallowness over a sample of points in the given section. + This helps to prevent the siplification from incrementally + "skipping" over points which are in fact non-shallow. + + A coordinate of section + A coordinate of section + The start index of section + The end index of section + The tolerated distance + + + + Computes the buffer of a geometry, for both positive and negative buffer distances. + + + + In GIS, the positive (or negative) buffer of a geometry is defined as + the Minkowski sum (or difference) of the geometry + with a circle of radius equal to the absolute value of the buffer distance. + In the CAD/CAM world buffers are known as offset curves. + In morphological analysis the + operation of positive and negative buffering + is referred to as erosion and dilation + + + The buffer operation always returns a polygonal result. + The negative or zero-distance buffer of lines and points is always an empty . + + + Since true buffer curves may contain circular arcs, + computed buffer polygons are only approximations to the true geometry. + The user can control the accuracy of the approximation by specifying + the number of linear segments used to approximate arcs. + This is specified via + or . + + + The of a linear buffer may be specified. + The following end cap styles are supported: +
    +
  • - the usual round end caps
  • +
  • - end caps are truncated flat at the line ends
  • +
  • - end caps are squared off at the buffer distance beyond the line ends
  • +
+
+ + The of the corners in a buffer may be specified. + The following join styles are supported: +
    +
  • - the usual round join
  • +
  • - corners are "sharp" (up to a distance limit})
  • +
  • - corners are beveled (clipped off)
  • +
+
+ + The buffer algorithm can perform simplification on the input to increase performance. + The simplification is performed a way that always increases the buffer area + (so that the simplified input covers the original input). + The degree of simplification can be specified with , + with a used otherwise. + Note that if the buffer distance is zero then so is the computed simplify tolerance, + no matter what the simplify factor. + +
+
+ + + A number of digits of precision which leaves some computational "headroom" + for floating point operations. + + + This value should be less than the decimal precision of double-precision values (16). + + + + + Compute a scale factor to limit the precision of + a given combination of Geometry and buffer distance. + The scale factor is determined by + the number of digits of precision in the (geometry + buffer distance), + limited by the supplied value. + + The scale factor is based on the absolute magnitude of the (geometry + buffer distance). + since this determines the number of digits of precision which must be handled. + + the Geometry being buffered + the buffer distance + the max # of digits that should be allowed by + the precision determined by the computed scale factor + + a scale factor for the buffer computation + + + + Computes the buffer of a geometry for a given buffer distance. + + the geometry to buffer + the buffer distance + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the buffer parameters to use + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the end cap style to use + the buffer of the input geometry + + + + Initializes a buffer computation for the given geometry + + the geometry to buffer + + + + Initializes a buffer computation for the given geometry + with the given set of parameters + + the geometry to buffer + the buffer parameters to use + + + + Returns the buffer computed for a geometry for a given buffer distance. + + the buffer distance + the buffer of the input geometry + + + + Specifies the end cap style of the generated buffer. + The styles supported are , , and . + The default is . + + + + + Sets the number of segments used to approximate a angle fillet + + + + + A value class containing the parameters which + specify how a buffer should be constructed. + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + Martin Davis + + + + The default number of facets into which to divide a fillet of 90 degrees. + A value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + + + + + The default mitre limit + Allows fairly pointy mitres. + + + + + The default simplify factor. + Provides an accuracy of about 1%, which matches + the accuracy of the parameter. + + + + + Creates a default set of parameters + + + + + Creates a set of parameters with the given quadrantSegments value. + + The number of quadrant segments to use + + + + Creates a set of parameters with the + given quadrantSegments and endCapStyle values. + + the number of quadrant segments to use + the end cap style to use + + + + Creates a set of parameters with the + given parameter values. + + the number of quadrant segments to use + the end cap style to use + the join style to use + the mitre limit to use + + + + Computes the maximum distance error due to a given level of approximation to a true arc. + + The number of segments used to approximate a quarter-circle + The error of approximation + + + + Gets/sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. + QuadrantSegments = 0joins are beveled + QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| + + For round joins, QuadrantSegments determines the maximum + error in the approximation to the true buffer curve. + The default value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + The error is always less than the buffer distance + (in other words, the computed buffer curve is always inside the true + curve). + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , + , and + . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), + and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + A connected subset of the graph of + DirectedEdges and Nodes. + Its edges will generate either + a single polygon in the complete buffer, with zero or more holes, or + one or more connected holes. + + + + + + + + + + Creates the subgraph consisting of all edges reachable from this node. + Finds the edges in the graph and the rightmost coordinate. + + A node to start the graph traversal from. + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + A node known to be in the subgraph. + + + + Adds the argument node and all its out edges to the subgraph + + The node to add. + The current set of nodes being traversed. + + + + + + + + + + + + + + + Compute depths for all dirEdges via breadth-first traversal of nodes in graph. + + Edge to start processing with. + + + + + + + + + + + + + + + + Find all edges whose depths indicates that they are in the result area(s). + Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + BufferSubgraphs are compared on the x-value of their rightmost Coordinate. + This defines a partial ordering on the graphs such that: + g1 >= g2 - Ring(g2) does not contain Ring(g1) + where Polygon(g) is the buffer polygon that is built from g. + This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to + be built before holes. + + + + + + + + + + + + + + + Gets the rightmost coordinate in the edges of the subgraph. + + + + + Computes the raw offset curve for a + single component (ring, line or point). + A raw offset curve line is not noded - + it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded + to a given . + + + + + This method handles single points as well as LineStrings. + LineStrings are assumed not to be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + The vertices of the line to offset + The offset distance + A Coordinate array representing the curve
+ or null if the curve is empty +
+
+ + + This method handles the degenerate cases of single points and lines, + as well as rings. + + A Coordinate array representing the curve
+ or null if the curve is empty
+
+ + + Computes the distance tolerance to use during input + line simplification. + + The buffer distance + The simplification tolerance + + + + Gets the buffer parameters being used to generate the curve. + + + + + Generates segments which form an offset curve. + Supports all end cap and join options + provided for buffering. + This algorithm implements various heuristics to + produce smoother, simpler curves which are + still within a reasonable tolerance of the + true curve. + + Martin Davis + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + The Closing Segment Length Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + Add last offset point + + + + + Adds the offset points for an outside (convex) turn + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point , terminating a line segment coming from + + + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments + around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. + Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc + between two specified angles. + The start and end point for the fillet are not added - + the caller must add them if required. + + Is -1 for a angle, 1 for a angle + The radius of the fillet + + + + Creates a circle around a point + + + + + Creates a square around a point + + + + + Gets whether the input has a narrow concave angle + (relative to the offset distance). + In this case the generated offset curve will contain self-intersections + and heuristic closing segments. + This is expected behaviour in the case of buffer curves. + For pure offset curves, + the output needs to be further treated + before it can be used. + + + + + A dynamic list of the vertices in a constructed offset curve. + Automatically removes adjacent vertices + which are closer than a given tolerance. + + Martin Davis + + + The distance below which two adjacent points on the curve + are considered to be coincident. + This is chosen to be a small fraction of the offset distance. + + + + Tests whether the given point is redundant + relative to the previous + point in the list (up to tolerance). + + + true if the point is redundant + + + + Computes the raw offset curve for a single component (ring, line or point). + + + A raw offset curve line is not noded - it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded to the required precision model. + + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + Use a value which results in a potential distance error which is + significantly less than the error due to + the quadrant segment discretization. + For QS = 8 a value of 100 is reasonable. + This should produce a maximum of 1% distance error. + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The Closing Segment Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + + This method handles single points as well as lines. + Lines are assumed to not be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + a List of Coordinate[] + + + + This method handles the degenerate cases of single points and lines, as well as rings. + + a List of Coordinate[] + + + Computes the distance tolerance to use during input + line simplification. + + @param distance the buffer distance + @return the simplification tolerance + + + + Adds the offset points for an outside (convex) turn + + + + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Add last offset point + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment () the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point p1, terminating a line segment coming from p0 + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + The base point + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + + + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc between two specified angles. + + + The start and end point for the fillet are not added - the caller must add them if required. + + The point around which to add the fillet points + The start angle (in radians) + The end angle (in radians) + Is -1 for a CW angle, 1 for a CCW angle + The radius of the fillet + + + + Adds a CW circle around a point + + + + + Adds a CW square around a point + + + + + Creates all the raw offset curves for a buffer of a Geometry. + Raw curves need to be noded together and polygonized to form the final buffer area. + + + + + + + + + + + + + Computes the set of raw offset curves for the buffer. + Each offset curve has an attached {Label} indicating + its left and right location. + + A Collection of SegmentStrings representing the raw buffer curves. + + + + Creates a {SegmentString} for a coordinate list which is a raw offset curve, + and adds it to the list of buffer curves. + The SegmentString is tagged with a Label giving the topology of the curve. + The curve may be oriented in either direction. + If the curve is oriented CW, the locations will be: + Left: Location.Exterior. + Right: Location.Interior. + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + + + + + + + + + + + + + Adds an offset curve for a polygon ring. + The side and left and right topological location arguments + assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged and the side flipped. + + The coordinates of the ring (must not contain repeated points). + The distance at which to create the buffer. + The side of the ring on which to construct the buffer line. + The location on the L side of the ring (if it is CW). + The location on the R side of the ring (if it is CW). + + + + The ringCoord is assumed to contain no repeated points. + It may be degenerate (i.e. contain only 1, 2, or 3 points). + In this case it has no area, and hence has a minimum diameter of 0. + + + + + + + + Tests whether a triangular ring would be eroded completely by the given + buffer distance. + This is a precise test. It uses the fact that the inner buffer of a + triangle converges on the inCentre of the triangle (the point + equidistant from all sides). If the buffer distance is greater than the + distance of the inCentre from a side, the triangle will be eroded completely. + This test is important, since it removes a problematic case where + the buffer distance is slightly larger than the inCentre distance. + In this case the triangle buffer curve "inverts" with incorrect topology, + producing an incorrect hole in the buffer. + + + + + + + + A list of the vertices in a constructed offset curve. + + Automatically removes close adjacent vertices. + Martin Davis + + + + Function to add a point + + + The point is only added if evaluates to false. + + The point to add. + + + + Tests whether the given point duplicates the previous point in the list (up to tolerance) + + The point to test + true if the point duplicates the previous point + + + + Automatically closes the ring (if it not alread is). + + + + + Gets/Sets the precision model to use when adding new points. + + + + + The distance below which two adjacent points on the curve are considered to be coincident. + + This is chosen to be a small fraction of the offset distance. + + + + Gets the Coordinates for the curve. + + + + + A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, + and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Locates a subgraph inside a set of subgraphs, + in order to determine the outside depth of the subgraph. + The input subgraphs are assumed to have had depths + already calculated for their edges. + + + + + + + + + + + + + + + + + + Finds all non-horizontal segments intersecting the stabbing line. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + A List of {DepthSegments} intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the list of dirEdges. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the input dirEdge. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + A segment from a directed edge which has been assigned a depth value + for its sides. + + + + + + + + + + + + Defines a comparison operation on DepthSegments + which orders them left to right. + Assumes the segments are normalized. + + The definition of ordering is: + + -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). + 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). + 0 : if the segments are identical + + + + Known Bugs: + + The logic does not obey the contract. + This is acceptable for the intended usage, but may cause problems if used with some + utilities in the .Net standard library (e.g. . + + + A DepthSegment + The comparison value + + + + Compare two collinear segments for left-most ordering. + If segs are vertical, use vertical ordering for comparison. + If segs are equal, return 0. + Segments are assumed to be directed so that the second coordinate is >= to the first + (e.g. up and to the right). + + A segment to compare. + A segment to compare. + + + + + + + + + + Finds the approximate maximum distance from a buffer curve to + the originating geometry. + + The approximate maximum distance is determined by testing + all vertices in the buffer curve, as well + as midpoints of the curve segments. + Due to the way buffer curves are constructed, this + should be a very close approximation. + This is similar to the Discrete Oriented Hausdorff distance + from the buffer curve to the input. + + mbdavis + + + + Validates that a given buffer curve lies an appropriate distance + from the input generating it. + + + Useful only for round buffers (cap and join). + Can be used for either positive or negative distances. + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + mbdavis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + + Checks that two geometries are at least a minumum distance apart. + + A geometry + A geometry + The minimum distance the geometries should be separated by + + + + Checks that the furthest distance from the buffer curve to the input + is less than the given maximum distance. + + + This uses the Oriented Hausdorff distance metric. It corresponds to finding + the point on the buffer curve which is furthest from some point on the input. + + A geometry + A geometry + The maximum distance that a buffer result can be from the input + + + + Gets a geometry which indicates the location and nature of a validation failure. + + The indicator is a line segment showing the location and size + of the distance discrepancy. + + + A geometric error indicator + or null, if no error was found + + + + Validates that the result of a buffer operation + is geometrically correct, within a computed tolerance. + + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + This test may be (much) more expensive than the original buffer computation. + + Martin Davis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + Checks whether the geometry buffer is valid, and returns an error message if not. + + + + + An appropriate error message
+ or nullif the buffer is valid
+ +
+ + + Gets the error message + + + + + Gets the error location + + + + + Gets a geometry which indicates the location and nature of a validation failure. + + If the failure is due to the buffer curve being too far or too close + to the input, the indicator is a line segment showing the location and size + of the discrepancy. + + + A geometric error indicator
+ or null, if no error was found
+
+ + + Computes the Euclidean distance (L2 metric) from a Point to a Geometry. + Also computes two points which are separated by the distance. + + + + + Contains a pair of points and the distance between them. + Provides methods to update with a new point pair with + either maximum or minimum distance. + + + + + Initializes the points, avoiding recomputing the distance. + + The first point + The second point + The distance between and + + + + A wrapper which + projects 3D coordinates into one of the + three Cartesian axis planes, + using the standard orthonormal projection + (i.e. simply selecting the appropriate ordinates into the XY ordinates). + The projected data is represented as 2D coordinates. + + Martin Davis + + + + Creates a wrapper projecting to the XY plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the XZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the YZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Find two points on two 3D s which lie within a given distance, + or else are the nearest points on the geometries (in which case this also + provides the distance between the geometries). + + 3D geometries have vertex Z ordinates defined. + 3D s are assumed to lie in a single plane (which is enforced if not actually the case). + 3D s and s may have any configuration. + + The distance computation also finds a pair of points in the input geometries + which have the minimum distance between them. If a point lies in the interior + of a line segment, the coordinate computed is a close approximation to the + exact point. + + The algorithms used are straightforward O(n^2) comparisons. This worst-case + performance could be improved on by using Voronoi techniques or spatial + indexes. + + 1.13 + + + + Compute the distance between the nearest points of two geometries. + + A geometry + A geometry + The distance between the geometries + + + + Test whether two geometries lie within a given distance of each other. + + A geometry + A geometry + The distance to test + true if g0.distance(g1) <= + + + + Compute the the nearest points of two geometries. The points are + presented in the same order as the input Geometries. + + A geometry + A geometry + The nearest points in the geometries + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + The distance on which to terminate the search + + + + Report the distance between the nearest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty
+ Thrown if either input geometry is null. +
+ + + Report the coordinates of the nearest points in the input geometries. The + points are presented in the same order as the input Geometries. + + A pair of s of the nearest points + + + + Gets the locations of the nearest points in the input geometries. The + locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points + + + + Finds the index of the "most polygonal" input geometry. + This optimizes the computation of the best-fit plane, + since it is cached only for the left-hand geometry. + + The index of the most polygonal geometry + + + + Convenience method to create a Plane3DPolygon + + + + + Computes distance between two polygons. + + + To compute the distance, compute the distance + between the rings of one polygon and the other polygon, + and vice-versa. + If the polygons intersect, then at least one ring must + intersect the other polygon. + Note that it is NOT sufficient to test only the shell rings. + A counter-example is a "figure-8" polygon A + and a simple polygon B at right angles to A, with the ring of B + passing through the holes of A. + The polygons intersect, + but A's shell does not intersect B, and B's shell does not intersect A. + + + Compute distance between a polygon and the rings of another. + + + Computes a point at a distance along a segment + specified by two relatively proportional values. + The fractional distance along the segment is d0/(d0+d1). + + @param p0 + start point of the segment + @param p1 + end point of the segment + @param d0 + proportional distance from start point to computed point + @param d1 + proportional distance from computed point to end point + @return the computed point + + + + Models a polygon lying in a plane in 3-dimensional Cartesian space. + The polygon representation is supplied + by a , + containing coordinates with XYZ ordinates. + 3D polygons are assumed to lie in a single plane. + The plane best fitting the polygon coordinates is + computed and is represented by a . + + Martin Davis + + + + Computes an average normal vector from a list of polygon coordinates. + Uses Newell's method, which is based + on the fact that the vector with components + equal to the areas of the projection of the polygon onto + the Cartesian axis planes is normal. + + @param seq the sequence of coordinates for the polygon + @return a normal vector + + + Computes a point which is the average of all coordinates + in a sequence. + If the sequence lies in a single plane, + the computed point also lies in the plane. + + @param seq a coordinate sequence + @return a Coordinate with averaged ordinates + + + + A ConnectedElementPointFilter extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list. The elements of the list are + com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + Returns a list containing a point from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. The elements of the list + are com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + + + + + + + + + + + + + Extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list + + + + + Returns a list containing a Coordinate from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. + + + + + + + + + + + + + + + + + Computes the distance and + closest points between two Geometrys. + The distance computation finds a pair of points in the input geometries + which have minimum distance between them. These points may + not be vertices of the geometries, but may lie in the interior of + a line segment. In this case the coordinate computed is a close + approximation to the exact point. + The algorithms used are straightforward O(n^2) + comparisons. This worst-case performance could be improved on + by using Voronoi techniques. + + + + + Compute the distance between the closest points of two geometries. + + A Geometry. + Another Geometry. + The distance between the geometries. + + + + Test whether two geometries lie within a given distance of each other. + + + + + + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + The distance on which to terminate the search. + + + + Report the distance between the closest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty.
+ if either input geometry is null +
+ + + Report the coordinates of the closest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the closest points. + + + + Report the locations of the closest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the closest points. + + + + Report the coordinates of the nearest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the nearest points. + + + + Report the locations of the nearest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points. + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes distance between facets (lines and points) of input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a sequence of facets (points or line segments) of a + specified by a subsequence of a . + + Martin Davis + + + + Creates a new section based on a CoordinateSequence. + + The sequence holding the points in the section + The index of the start point + The index of the end point + 1 + + + + Creates a new sequence for a single point from a CoordinateSequence. + + The sequence holding the points in the facet sequence + the index of the point + + + + Gets the coordinate at the given index + + The index + The coordinate at the given index + + + + Computes the distance to another facet sequence + + The other facet sequence + The distance between this and . + + + + Gets the envelope of this facet sequence + + + + + Gets the number of coordinates in this facet sequence + + + + + Tests if this facet sequence consists of only one point + + + + + Utility class to build facet sequencs STRtrees- + + + + + + + + + + + + Creates facet sequences from a given geometry + + The geometry + A list of s + + + + Represents the location of a point on a Geometry. + Maintains both the actual point location + (which may not be exact, if the point is not a vertex) + as well as information about the component + and segment index where the point occurs. + Locations inside area Geometrys will not have an associated segment index, + so in this case the segment index will have the sentinel value of . + + + + + A special value of segmentIndex used for locations inside area geometries. + These locations are not located on a segment, + and thus do not have an associated segment index. + + + + + Constructs a GeometryLocation specifying a point on a point, as well as the + segment that the point is on (or if the point is not on a segment). + + The component of the geometry containing the point + The segment index of the location, or + The coordinate of the location + + + + Constructs a GeometryLocation specifying a point inside an area point. + + The component of the geometry containing the point + The coordinate of the location + + + + Returns the geometry component on (or in) which this location occurs. + + + + + Returns the segment index for this location. If the location is inside an + area, the index will have the value . + + + + + Returns the of this location. + + + + + Tests whether this location represents a point inside an area geometry. + + + + + Computes the distance between the facets (segments and vertices) + of two s + using a Branch-and-Bound algorithm. + The Branch-and-Bound algorithm operates over a + traversal of R-trees built + on the target and possibly also the query geometries. + + This approach provides the following benefits: + + + Performance is improved due to the effects of the R-tree index + and the pruning due to the Branch-and-Bound approach + + The spatial index on the target geometry can be cached + to allow reuse in an incremental query situation. + + Using this technique can be much more performant + than using + when one or both input geometries are large, + or when evaluating many distance computations against + a single geometry. + + + This class is not thread-safe. + + Martin Davis + + + + + Computes the distance between two geometries using the indexed approach. + + + For geometries with many segments or points, + this can be faster than using a simple distance + algorithm. + + A geometry + A geometry + The distance between the two geometries + + + + Creates a new distance-finding instance for a given target . + + + + Distances will be computed to all facets of the input geometry. + The facets of the geometry are the discrete segments and points + contained in its components. + + In the case of and inputs, + this is equivalent to computing the conventional distance. + + In the case of inputs, this is equivalent + to computing the distance to the polygons boundaries. + + + A Geometry, which may be of any type. + + + + Computes the distance from the base geometry to the given geometry. + + The geometry to compute the distance to. + The computed distance + + + * Tests whether the base geometry lies within + * a specified distance of the given geometry. + * + //* @param g the geomtry to test + //* @param maximumDistance the maximum distance to test + //* @return true if the geometry lies with the specified distance + + + + The base class for operations that require s. + + + + + + + + + + The operation args into an array so they can be accessed by index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether a is simple. + In general, the SFS specification of simplicity + follows the rule: + + + A Geometry is simple if and only if the only self-intersections are at boundary points. + + + + + Simplicity is defined for each } subclass as follows: + + Valid geometries are simple by definition, so + IsSimple trivially returns true.
+ (Note: this means that IsSimple cannot be used to test + for (invalid) self-intersections in Polygons. + In order to check if a Polygonal geometry has self-intersections, + use ).
+ geometries are simple if and only if they do not self-intersect at interior points + (i.e. points other than boundary points). + This is equivalent to saying that no two linear components satisfy the SFS + predicate. + Zero-dimensional () geometries are simple if and only if they have no + repeated points. + Empty s are always simple by definition. +
+ For geometries the evaluation of simplicity + can be customized by supplying a + to define how boundary points are determined. + The default is the SFS-standard . + Note that under the Mod-2 rule, closed LineStrings (rings) + will never satisfy the touches predicate at their endpoints, since these are + interior points, not boundary points. + If it is required to test whether a set of LineStrings touch + only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. + For example, this can be used to validate that a set of lines form a topologically valid + linear network. +
+
+ + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + + + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + The geometry to test + + + + Creates a simplicity checker using a given + + The geometry to test + The rule to use + + + + Tests whether the geometry is simple. + + true if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + A MultiPoint is simple if it has no repeated points. + + + + + Computes simplicity for polygonal geometries. + Polygonal geometries are simple if and only if + all of their component rings are simple. + + A Polygonal geometry + true if the geometry is simple + + + Semantics for GeometryCollection is + simple iff all components are simple. + A GeometryCollection + true if the geometry is simple + + + + For all edges, check if there are any intersections which are NOT at an endpoint. + The Geometry is not simple if there are intersections not at endpoints. + + + + + + Tests that no edge intersection is the endpoint of a closed line. + This ensures that closed lines are not touched at their endpoint, + which is an interior point according to the Mod-2 rule + To check this we compute the degree of each endpoint. + The degree of endpoints of closed lines + must be exactly 2. + + + + + Add an endpoint to the map, creating an entry for it if none exists. + + + + + + + + Gets a coordinate for the location where the geometry fails to be simple. + (i.e. where it has a non-boundary self-intersection). + must be called before this location is accessed + + a coordinate for the location of the non-boundary self-intersection + or null if the geometry is simple + + + + + + + + + Creates an instance of this class + + The endpoint + + + + A sequence of LineMergeDirectedEdges forming one of the lines that will + be output by the line-merging process. + + + + + Constructs an EdgeString with the given factory used to convert this EdgeString + to a LineString. + + + + + + Adds a directed edge which is known to form part of this line. + + + + + + Converts this EdgeString into a LineString. + + + + + + + + + + A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. + + + + + Represents a directed edge in a PlanarGraph. A DirectedEdge may or + may not have a reference to a parent Edge (some applications of + planar graphs may not require explicit Edge objects to be created). Usually + a client using a PlanarGraph will subclass DirectedEdge + to add its own application-specific data and methods. + + + + + The base class for all graph component classes. + Maintains flags of use in generic graph algorithms. + Provides two flags: + marked - typically this is used to indicate a state that persists + for the course of the graph's lifetime. For instance, it can be + used to indicate that a component has been logically deleted from the graph. + visited - this is used to indicate that a component has been processed + or visited by an single graph algorithm. For instance, a breadth-first traversal of the + graph might use this to indicate that a node has already been traversed. + The visited flag may be set and cleared many times during the lifetime of a graph. + + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Finds the first + in a set + which has the specified state. + + A to scan. + The state to test. + The first found, or null if none found. + + + + Tests if a component has been visited during the course of a graph algorithm. + + + + + Gets/Sets the visited flag for this component. + + + + + Tests if a component has been marked at some point during the processing + involving this graph. + + + + + Gets/Sets the marked flag for this component. + + + + + Tests whether this component has been removed from its containing graph. + + + + + Gets or sets user defined data for this component + + + + + Returns a List containing the parent Edge (possibly null) for each of the given + DirectedEdges. + + + + + + + Constructs a DirectedEdge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Writes a detailed string representation of this DirectedEdge to the given PrintStream. + + + + + + Removes this directed edge from its containing graph. + + + + + Returns this DirectedEdge's parent Edge, or null if it has none. + Associates this DirectedEdge with an Edge (possibly null, indicating no associated + Edge). + + + + + Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's + orientation lies. + + + + + Returns a point to which an imaginary line is drawn from the from-node to + specify this DirectedEdge's orientation. + + + + + Returns whether the direction of the parent Edge (if any) is the same as that + of this Directed Edge. + + + + + Returns the node from which this DirectedEdge leaves. + + + + + Returns the node to which this DirectedEdge goes. + + + + + Returns the coordinate of the from-node. + + + + + Returns the angle that the start of this DirectedEdge makes with the + positive x-axis, in radians. + + + + + Returns the symmetric DirectedEdge -- the other DirectedEdge associated with + this DirectedEdge's parent Edge. + Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite + direction. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeDirectedEdge connecting the from node to the to node. + + + + + specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the directed edge that starts at this directed edge's end point, or null + if there are zero or multiple directed edges starting there. + + + + + An edge of a LineMergeGraph. The marked field indicates + whether this Edge has been logically deleted from the graph. + + + + + Represents an undirected edge of a {PlanarGraph}. An undirected edge + in fact simply acts as a central point of reference for two opposite + DirectedEdges. + Usually a client using a PlanarGraph will subclass Edge + to add its own application-specific data and methods. + + + + + The two DirectedEdges associated with this Edge. + + + + + Constructs an Edge whose DirectedEdges are not yet set. Be sure to call + SetDirectedEdges(DirectedEdge, DirectedEdge). + + + + + Constructs an Edge initialized with the given DirectedEdges, and for each + DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds + this Edge to its from-Node. + + + + + + + Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the + Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. + + + + + + + Returns one of the DirectedEdges associated with this Edge. + + 0 or 1. + + + + + Returns the DirectedEdge that starts from the given node, or null if the + node is not one of the two nodes associated with this Edge. + + + + + + + If node is one of the two nodes associated with this Edge, + returns the other node; otherwise returns null. + + + + + + + Removes this edge from its containing graph. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeEdge with vertices given by the specified LineString. + + + + + + Returns the LineString specifying the vertices of this edge. + + + + + A planar graph of edges that is analyzed to sew the edges together. The + marked flag on com.vividsolutions.planargraph.Edges + and com.vividsolutions.planargraph.Nodes indicates whether they have been + logically deleted from the graph. + + + + + Represents a directed graph which is embeddable in a planar surface. + This class and the other classes in this package serve as a framework for + building planar graphs for specific algorithms. This class must be + subclassed to expose appropriate methods to construct the graph. This allows + controlling the types of graph components ({DirectedEdge}s, + Edges and Nodes) which can be added to the graph. An + application which uses the graph framework will almost always provide + subclasses for one or more graph components, which hold application-specific + data and graph algorithms. + + + + + + + + + + + + + + + + + + + + Returns the at the given location, or null if no was there. + + The location + The node found
+ or null if this graph contains no node at the location +
+
+ + + Adds a node to the map, replacing any that is already at that location. + Only subclasses can add Nodes, to ensure Nodes are of the right type. + + + The added node. + + + + Adds the Edge and its DirectedEdges with this PlanarGraph. + Assumes that the Edge has already been created with its associated DirectEdges. + Only subclasses can add Edges, to ensure the edges added are of the right class. + + + + + + Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, + to ensure the edges added are of the right class. + + + + + + Returns an IEnumerator over the Nodes in this PlanarGraph. + + + + + + Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they + were added. + + + + + + Returns an Iterator over the Edges in this PlanarGraph, in the order in which they + were added. + + + + + + Removes an Edge and its associated DirectedEdges from their from-Nodes and + from this PlanarGraph. Note: This method does not remove the Nodes associated + with the Edge, even if the removal of the Edge reduces the degree of a + Node to zero. + + + + + + Removes a from its from- and from this PlanarGraph. + + + This method does not remove the s associated with the DirectedEdge, + even if the removal of the DirectedEdge reduces the degree of a Node to zero. + + + + + + Removes a node from the graph, along with any associated DirectedEdges and + Edges. + + + + + + Returns all Nodes with the given number of Edges around it. + + + + + + + Returns the Nodes in this PlanarGraph. + + + + + Returns the Edges that have been added to this PlanarGraph. + + + + + Adds an Edge, DirectedEdges, and Nodes for the given LineString representation + of an edge. + + + + + + + + + + + + Sews together a set of fully noded LineStrings. + + + Sewing stops at nodes of degree 1 + or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, + in which case a node is simply chosen as a starting point. The direction of each + merged LineString will be that of the majority of the LineStrings from which it + was derived. + + Any dimension of Geometry is handled -- the constituent linework is extracted to + form the edges. The edges must be correctly noded; that is, they must only meet + at their endpoints. The LineMerger will still run on incorrectly noded input + but will not form polygons from incorrected noded edges. + + NOTE:once merging has been performed, no more + + + + + Adds a Geometry to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the LineStrings built by the merging process. + + + + + + + + + + + + + + + + + + + + + + + + Builds a sequence from a set of s, + so that they are ordered end to end. + A sequence is a complete non-repeating list of the linear + components of the input. Each linestring is oriented + so that identical endpoints are adjacent in the list. + + + The input linestrings may form one or more connected sets. + The input linestrings should be correctly noded, or the results may + not be what is expected. + The output of this method is a single , + containing the ordered linestrings in the sequence. + + + The sequencing employs the classic 'Eulerian path' graph algorithm. + Since Eulerian paths are not uniquely determined, further rules are used to + make the computed sequence preserve as much as possible of the input ordering. + Within a connected subset of lines, the ordering rules are: + - If there is degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If there is a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + + + Not all arrangements of lines can be sequenced. + For a connected set of edges in a graph, + Euler's Theorem states that there is a sequence containing each edge once + if and only if there are no more than 2 nodes of odd degree. + If it is not possible to find a sequence, the + property will return false. + + + + + + Tests whether a is sequenced correctly. + s are trivially sequenced. + s are checked for correct sequencing. + Otherwise, IsSequenced is defined + to be true for geometries that are not lineal. + + The to test. + + true if the is sequenced or is not lineal. + + + + + Adds a of s to be sequenced. + May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be extracted. + + A of geometries to add. + + + + Adds a to be sequenced. + May be called multiple times. + Any dimension of may be added; + the constituent linework will be extracted. + + + + + + Tests whether the arrangement of linestrings has a valid sequence. + + true if a valid sequence exists. + + + + Returns the or + built by the sequencing process, if one exists. + + The sequenced linestrings, + or null if a valid sequence does not exist. + + + + Tests whether a complete unique path exists in a graph + using Euler's Theorem. + + The containing the edges. + true if a sequence exists. + + + + Finds an for an unvisited edge (if any), + choosing the which preserves orientation, if possible. + + The to examine. + + The found, + or null if none were unvisited. + + + + + Computes a version of the sequence which is optimally + oriented relative to the underlying geometry. + + Heuristics used are: + - If the path has a degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If the path has a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + (NOTE: in this case could orient the sequence according to the majority of the + linestring orientations). + + + A of s. + + A of s oriented appropriately. + + + + + Reverse the sequence. + This requires reversing the order of the s, + and flipping each as well. + + + A enumeration of s, + in sequential order. + + The reversed sequence. + + + + Builds a geometry ( or ) + representing the sequence. + + + An enumeration of s of s + with s as their parent edges. + + + The sequenced geometry, or null if no sequence exists. + + + + + A private implementation for + + + + + Initializes a new instance of the class. + + The sequencer. + + + + Performs an operation with or on + + + A to which the filter is applied. + + + + + Nodes a set of edges. + Takes one or more sets of edges and constructs a + new set of edges consisting of all the split edges created by + noding the input edges together. + + + + + + + + + + + + + + + + + + + + + + Forms NTS LineStrings out of a the graph of DirectedEdges + created by an OverlayOp. + + + + + + + + + + + + + + + + + A list of the LineStrings in the result of the specified overlay operation. + + + + + Find and mark L edges which are "covered" by the result area (if any). + L edges at nodes which also have A edges can be checked by checking + their depth at that node. + L edges at nodes which do not have A edges can be checked by doing a + point-in-polygon test with the previously computed result areas. + + + + + + + + + + + + + + + + + + + Collect edges from Area inputs which should be in the result but + which have not been included in a result area. + This happens ONLY: + during an intersection when the boundaries of two + areas touch in a line segment + OR as a result of a dimensional collapse. + + + + + + + + + + + + + + + + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A ring of edges which may contain nodes of degree > 2. + A MaximalEdgeRing may represent two different spatial entities: + a single polygon possibly containing inversions (if the ring is oriented CW) + a single hole possibly containing exversions (if the ring is oriented CCW) + If the MaximalEdgeRing represents a polygon, + the interior of the polygon is strongly connected. + These are the form of rings used to define polygons under some spatial data models. + However, under the OGC SFS model, MinimalEdgeRings are required. + A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the + BuildMinimalRings() method. + + + + + + + + + + + + + + + + + + + + + + + + + + For all nodes in this EdgeRing, + link the DirectedEdges at the node to form minimalEdgeRings + + + + + + + + + + + A ring of edges with the property that no node + has degree greater than 2. These are the form of rings required + to represent polygons under the OGC SFS spatial data model. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates nodes for use in the PlanarGraphs constructed during + overlay operations. + + + + + + + + + + + + The spatial functions supported by this class. + These operations implement various bool combinations of the resultants of the overlay. + + + + + The code for the Intersection overlay operation + + + + + The code for the Union overlay operation + + + + + The code for the Difference overlay operation + + + + + The code for the Symmetric Difference overlay operation + + + + + Computes the geometric overlay of two s. The overlay + can be used to determine any bool combination of the geometries. + + + + + Computes an overlay operation + for the given geometry arguments. + + The first geometry argument + The second geometry argument + The code for the desired overlay operation + The result of the overlay operation + Thrown if a robustness problem is encountered. + + + + Tests whether a point with a given topological + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + The topological label of the point + The code for the overlay operation to test + true if the label locations correspond to the overlayOpCode + + + + Tests whether a point with given s + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + the code for the location in the first geometry + the code for the location in the second geometry + the code for the overlay operation to test + true if the locations correspond to the overlayOpCode. + + + + Constructs an instance to compute a single overlay operation + for the given geometries. + + The first geometry argument + The second geometry argument + + + + Gets the result of the overlay for a given overlay operation. + + Note: this method can be called once only. + + The code of the overlay operation to perform + The computed result geometry + Thrown if a robustness problem is encountered + + + + Insert an edge from one of the noded input graphs. + Checks edges that are inserted to see if an + identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + The edge to insert + + + + Update the labels for edges according to their depths. + For each edge, the depths are first normalized. + Then, if the depths for the edge are equal, + this edge must have collapsed into a line edge. + If the depths are not equal, update the label + with the locations corresponding to the depths + (i.e. a depth of 0 corresponds to a Location of Exterior, + a depth of 1 corresponds to Interior) + + + + + If edges which have undergone dimensional collapse are found, + replace them with a new edge which is a L edge + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a previously computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Compute initial labelling for all DirectedEdges at each node. + In this step, DirectedEdges will acquire a complete labelling + (i.e. one with labels for both Geometries) + only if they + are incident on a node which has edges for both Geometries + + + + + For nodes which have edges from only one Geometry incident on them, + the previous step will have left their dirEdges with no labelling for the other + Geometry. However, the sym dirEdge may have a labelling for the other + Geometry, so merge the two labels. + + + + + Incomplete nodes are nodes whose labels are incomplete. + (e.g. the location for one Geometry is null). + These are either isolated nodes, + or nodes which have edges from only a single Geometry incident on them. + Isolated nodes are found because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + When each node labelling is completed, the labelling of the incident + edges is updated, to complete their labelling as well. + + + + + Label an isolated node with its relationship to the target point. + + + + + Find all edges whose label indicates that they are in the result area(s), + according to the operation being performed. Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + If both a dirEdge and its sym are marked as being in the result, cancel + them out. + + + + + Tests if a point node should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Line or Area geometry. + + + + Tests if an L edge should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Area geometry. + + + + true if the coord is located in the interior or boundary of + a point in the list. + + + + + Creates an empty result geometry of the appropriate dimension, + based on the given overlay operation and the dimensions of the inputs. + The created geometry is always an atomic geometry, + not a collection. + + The empty result is constructed using the following rules: + + - result has the dimension of the lowest input dimension + - result has the dimension of the highest input dimension + - result has the dimension of the left-hand input + - result has the dimension of the highest input dimension + (since symDifference is the union of the differences). + + + The overlay operation being performed + An input geometry + An input geometry + The geometry factory being used for the operation + An empty atomic geometry of the appropriate dimension + + + + Disable + when an intersection is made (), + so performances are dramatically improved but failures are not managed. + + + Use ay your own risk! + + + + + Gets the graph constructed to compute the overlay. + + + + + Constructs Points from the nodes of an overlay graph. + + + + + + + + + + + + + + + + + A list of the Points in the result of the specified overlay operation. + + + + + + + + + + + + This method simplifies the resultant Geometry by finding and eliminating + "covered" points. + A point is covered if it is contained in another element Geometry + with higher dimension (e.g. a point might be contained in a polygon, + in which case the point can be eliminated from the resultant). + + + + + + + Forms Polygons out of a graph of {DirectedEdge}s. + The edges to use are marked as being in the result Area. + + + + + + + + + + + Add a complete graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + Add a set of edges and nodes, which form a graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + + For all DirectedEdges in result, form them into MaximalEdgeRings. + + + + + + + + + + + + + + + + This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, + and tests whether they form a Polygon. This is the case if there is a single shell + in the list. In this case the shell is returned. + The other possibility is that they are a series of connected holes, in which case + no shell is returned. + + The shell EdgeRing, if there is one
or + null, if all the rings are holes.
+
+ + + This method assigns the holes for a Polygon (formed from a list of + MinimalEdgeRings) to its shell. + Determining the holes for a MinimalEdgeRing polygon serves two purposes: + it is faster than using a point-in-polygon check later on. + it ensures correctness, since if the PIP test was used the point + chosen might lie on the shell, which might return an incorrect result from the + PIP test. + + + + + + + For all rings in the input list, + determine whether the ring is a shell or a hole + and add it to the appropriate list. + Due to the way the DirectedEdges were linked, + a ring is a shell if it is oriented CW, a hole otherwise. + + + + + + + + This method determines finds a containing shell for all holes + which have not yet been assigned to a shell. + These "free" holes should + all be properly contained in their parent shells, so it is safe to use the + findEdgeRingContaining method. + (This is the case because any holes which are NOT + properly contained (i.e. are connected to their + parent shell) would have formed part of a MaximalEdgeRing + and been handled in a previous step). + + + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
or + null if no containing EdgeRing is found.
+
+ + + + + + + + + + Checks the current set of shells (with their associated holes) to + see if any of them contain the point. + + + + + + + + + + + + Snaps the vertices and segments of a + to another Geometry's vertices. + A snap distance tolerance is used to control where snapping is performed. + Snapping one geometry to another can improve + robustness for overlay operations by eliminating + nearly-coincident edges + (which cause problems during noding and intersection calculation). + It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. + Too much snapping can result in invalid topology + beging created, so the number and location of snapped vertices + is decided using heuristics to determine when it + is safe to snap. + This can result in some potential snaps being omitted, however. + + Martin Davis + + + + Estimates the snap tolerance for a Geometry, taking into account its precision model. + + + The estimated snap tolerance + + + + + + + + + + + + + + + + + + + Snaps two geometries together with a given tolerance. + + + + + + + + + Snaps a geometry to itself. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. + + the geometry to snap + the snapping tolerance + whether the result should be made valid + a new snapped + + + + Creates a new snapper acting on the given geometry + + the geometry to snap + + + + Snaps the vertices in the component s + of the source geometry to the vertices of the given snap geometry. + + a geometry to snap the source to + + a new snapped Geometry + + + Snaps the vertices in the component s + of the source geometry to the vertices of the same geometry. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + The snapping tolerance + Whether the result should be made valid + The geometry snapped to itself + + + + + + + + + + + Computes the snap tolerance based on the input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snaps the vertices and segments of a + to a set of target snap vertices. + A snap distance tolerance is used to control where snapping is performed. + The implementation handles empty geometry and empty snap vertex sets. + + + + + Creates a new snapper using the points in the given + as target snap points. + + A LineString to snap (may be empty) + the snap tolerance to use + + + + Creates a new snapper using the given points + as source points to be snapped. + + + + + + + Snaps the vertices and segments of the source LineString + to the given set of snap points. + + the vertices to snap to + list of the snapped points + + + + Snap source vertices to vertices in the target. + + the points to snap + the points to snap to + + + + + + + + + + + + Snap segments of the source to nearby snap vertices. + Source segments are "cracked" at a snap vertex. + A single input segment may be snapped several times + to different snap vertices. + For each distinct snap vertex, at most one source segment + is snapped to. This prevents "cracking" multiple segments + at the same point, which would likely cause + topology collapse when being used on polygonal linework. + + The coordinates of the source linestring to snap + The target snap vertices + + + + Finds a src segment which snaps to (is close to) the given snap point + Only a single segment is selected for snapping. + This prevents multiple segments snapping to the same snap vertex, + which would almost certainly cause invalid geometry + to be created. + (The heuristic approach of snapping used here + is really only appropriate when + snap pts snap to a unique spot on the src geometry) + Also, if the snap vertex occurs as a vertex in the src coordinate list, + no snapping is performed. + + The point to snap to + The source segment coordinates + The index of the snapped segment
+ or -1 if no segment snaps to the snap point.
+
+ + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class only uses snapping + if an error is detected when running the standard JTS overlay code. + Errors detected include thrown exceptions + (in particular, ) + and invalid overlay computations. + + + + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class always uses snapping. + This is less performant than the standard JTS overlay code, + and may even introduce errors which were not present in the original data. + For this reason, this class should only be used + if the standard overlay code fails to produce a correct result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds the most likely of a point relative to + the polygonal components of a geometry, using a tolerance value. + + + If a point is not clearly in the Interior or Exterior, + it is considered to be on the Boundary. + In other words, if the point is within the tolerance of the Boundary, + it is considered to be on the Boundary; otherwise, + whether it is Interior or Exterior is determined directly. + + Martin Davis + + + + Extracts linework for polygonal components. + + The geometry from which to extract + A lineal geometry containing the extracted linework + + + + Extracts the LineStrings in the boundaries of all the polygonal elements in the target . + + Martin Davis + + + + Filters out all linework for polygonal elements + + + + + Gets the list of polygonal linework. + + + + + Generates points offset by a given distance from both sides of the midpoint of all segments in a . + + + + Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. + + + The input geometry may have any orientation for its rings, + but is + only meaningful if the orientation is known. + + + Martin Davis + + + Set the sides on which to generate offset points. + + @param doLeft + @param doRight + + + + Gets the computed offset points. + + + + + Generates the two points which are offset from the + midpoint of the segment (p0, p1) by the offsetDistance + + The first point of the segment to offset from. + The second point of the segment to offset from + + + + + + Validates that the result of an overlay operation is geometrically correct within a determined tolerance. + Uses fuzzy point location to find points which are + definitely in either the interior or exterior of the result + geometry, and compares these results with the expected ones. + + + This algorithm is only useful where the inputs are polygonal. + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + Martin Davis + + + + + Represents a ring of PolygonizeDirectedEdges which form + a ring of a polygon. The ring may be either an outer shell or a hole. + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
+ or null if no containing EdgeRing is found.
+
+ + + Finds a point in a list of points which is not contained in another list of points. + + The Coordinates to test. + An array of Coordinates to test the input points against. + A Coordinate from testPts which is not in pts,
+ or null.
+
+ + + Tests whether a given point is in an array of points. + Uses a value-based test. + + A Coordinate for the test point. + An array of Coordinates to test, + true if the point is in the array. + + + Traverses a ring of DirectedEdges, accumulating them into a list. + This assumes that all dangling directed edges have been removed + from the graph, so that there is always a next dirEdge. + + @param startDE the DirectedEdge to start traversing at + @return a List of DirectedEdges that form a ring + + + + + + + + + + Adds a DirectedEdge which is known to form part of this ring. + + The DirectedEdge to add. + + + + Computes whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + + + + Adds a hole to the polygon formed by this ring. + + The LinearRing forming the hole. + + + + Adds a hole to the polygon formed by this ring. + + the forming the hole. + + + + + + + + + + + + Updates the included status for currently non-included shells + based on whether they are adjacent to an included shell. + + + + + Gets a string representation of this object. + + + + + Tests whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + true if this ring is a hole. + + + + Computes and returns the Polygon formed by this ring and any contained holes. + + + + + Tests if the ring formed by this edge ring is topologically valid. + + true if the ring is valid. + + + + Computes and returns the list of coordinates which are contained in this ring. + The coordinatea are computed once only and cached. + + + + + Gets the coordinates for this ring as a LineString. + Used to return the coordinates in this ring + as a valid point, when it has been detected that the ring is topologically + invalid. + + + + + Returns this ring as a LinearRing, or null if an Exception occurs while + creating it (such as a topology problem). Details of problems are written to + standard output. + + + + + Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. + + + + + Gets a value indicating whether this ring has a shell assigned to it. + + + + + Tests whether this ring is an outer hole. + A hole is an outer hole if it is not contained by a shell. + + + + + Tests whether this ring is an outer shell. + + + + + Gets or sets a value indicating whether this ring has been processed. + + + + + Compares EdgeRings based on their envelope, + using the standard lexicographic ordering. + This ordering is sufficient to make edge ring sorting deterministic. + + mbdavis + + + + A DirectedEdge of a PolygonizeGraph, which represents + an edge of a polygon formed by the graph. + May be logically deleted from the graph by setting the marked flag. + + + + + Constructs a directed edge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the identifier attached to this directed edge. + Attaches an identifier to this directed edge. + + + + + Returns the next directed edge in the EdgeRing that this directed edge is a member of. + Sets the next directed edge in the EdgeRing that this directed edge is a member of. + + + + + Returns the ring of directed edges that this directed edge is + a member of, or null if the ring has not been set. + + + + + Gets/Sets the ring of directed edges that this directed edge is + a member of. + + + + + An edge of a polygonization graph. + + + + + + + + + + + + + + + + Represents a planar graph of edges that can be used to compute a + polygonization, and implements the algorithms to compute the + EdgeRings formed by the graph. + The marked flag on DirectedEdges is used to indicate that a directed edge + has be logically deleted from the graph. + + + + + + + + + + + + + + + + + + + + Deletes all edges at a node. + + + + + + Create a new polygonization graph. + + + + + + Add a LineString forming an edge of the polygon graph. + + The line to add. + + + + + + + + + + + + + + + + Convert the maximal edge rings found by the initial graph traversal + into the minimal edge rings required by NTS polygon topology rules. + + The list of start edges for the edgeRings to convert. + + + + Finds all nodes in a maximal edgering which are self-intersection nodes + + + + + The list of intersection nodes found, + or null if no intersection nodes were found. + + + + + Computes the minimal EdgeRings formed by the edges in this graph. + + A list of the{EdgeRings found by the polygonization process. + + + + Finds and labels all edgerings in the graph. + The edge rings are labeling with unique integers. + The labeling allows detecting cut edges. + + A List of the DirectedEdges in the graph. + A List of DirectedEdges, one for each edge ring found. + + + + Finds and removes all cut edges from the graph. + + A list of the LineStrings forming the removed cut edges. + + + + + + + + + + + + + + + + + Computes the next edge pointers going CCW around the given node, for the + given edgering label. + This algorithm has the effect of converting maximal edgerings into minimal edgerings + + + + + + + + + + + + + + Marks all edges from the graph which are "dangles". + Dangles are which are incident on a node with degree 1. + This process is recursive, since removing a dangling edge + may result in another edge becoming a dangle. + In order to handle large recursion depths efficiently, + an explicit recursion stack is used. + + A List containing the s that formed dangles. + + + + Traverses the polygonized edge rings in the graph + and computes the depth parity (odd or even) + relative to the exterior of the graph. + + If the client has requested that the output + be polygonally valid, only odd polygons will be constructed. + + + + + Traverses all connected edges, computing the depth parity of the associated polygons. + + + + + + Polygonizes a set of s which contain linework that + represents the edges of a planar graph. + + + All types of Geometry are accepted as input; + the constituent linework is extracted as the edges to be polygonized. + The processed edges must be correctly noded; that is, they must only meet + at their endpoints. Polygonization will accept incorrectly noded input + but will not form polygons from non-noded edges, + and reports them as errors. + + The Polygonizer reports the follow kinds of errors: + Dangles - edges which have one or both ends which are not incident on another edge endpoint + Cut Edges - edges which are connected at both ends but which do not form part of polygon + Invalid Ring Lines - edges which form rings which are invalid + (e.g. the component lines contain a self-intersection). + + Polygonization supports extracting only polygons which form a valid polygonal geometry. + The set of extracted polygons is guaranteed to be edge-disjoint. + This is useful for situations where it is known that the input lines form a + valid polygonal geometry. + + + + + + The default polygonizer output behavior + + + + + Default linestring adder. + + + + + Creates a polygonizer with the same + as the input Geometrys. + The output mask is + + + + + + Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. + + true if only polygons which form a valid polygonal geometry are to be extracted + + + + Adds a collection of s to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used. + + A list of Geometrys with linework to be polygonized. + + + + Adds a to the linework to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used + + A Geometry with linework to be polygonized. + + + + Adds a to the graph of polygon edges. + + The to add. + + + + Gets the list of polygons formed by the polygonization. + + + + + Gets a geometry representing the polygons formed by the polygonization. + If a valid polygonal geometry was extracted the result is a geometry. + + A geometry containing the polygons + + + + Gets the list of dangling lines found during polygonization. + + + + + Gets the list of cut edges found during polygonization. + + + + + Gets the list of lines forming invalid rings found during polygonization. + + + + + Performs the polygonization, if it has not already been carried out. + + + + + For each outer hole finds and includes a single outer shell. + This seeds the travesal algorithm for finding only polygonal shells. + + The list of shell EdgeRings + + + + Allows disabling the valid ring checking, + to optimize situations where invalid rings are not expected. + + The default is true + + + + Adds every linear element in a into the polygonizer graph. + + + + + Filters all geometry instances + + The geometry instance + + + + Optimized implementation of spatial predicate "contains" + for cases where the first Geometry is a rectangle. + As a further optimization, + this class can be used directly to test many geometries against a single rectangle. + + + + + + + + + + + + + Create a new contains computer for two geometries. + + A rectangular geometry. + + + + + + + + + + + + + + + + + + + + + + + + + Tests if a point is contained in the boundary of the target rectangle. + + the point to test + true if the point is contained in the boundary + + + + Tests if a linestring is completely contained in the boundary of the target rectangle. + + the linestring to test + true if the linestring is contained in the boundary + + + + Tests if a line segment is contained in the boundary of the target rectangle. + + an endpoint of the segment + an endpoint of the segment + true if the line segment is contained in the boundary + + + I + Implementation of the Intersects spatial predicate + optimized for the case where one is a rectangle. + + + This class works for all input geometries, including s. + + As a further optimization, this class can be used in batch style + to test many geometries against a single rectangle. + + + + + Crossover size at which brute-force intersection scanning + is slower than indexed intersection detection. + Must be determined empirically. Should err on the + safe side by making value smaller rather than larger. + + + + + Tests whether a rectangle intersects a given geometry. + + A rectangular polygon + A geometry of any kind + true if the geometries intersect. + + + + Create a new intersects computer for a rectangle. + + A rectangular polygon. + + + + Tests whether the given Geometry intersects the query rectangle. + + The Geometry to test (may be of any type) + true if an intersection must occur + or false if no conclusion about intersection can be made + + + + Tests whether it can be concluded that a rectangle intersects a geometry, + based on the relationship of the envelope(s) of the geometry. + + Martin Davis + + + + Creates an instance of this class using the provided Envelope + + The query envelope + + + + + + + + + + + + + + + + Reports whether it can be concluded that an intersection occurs, + or whether further testing is required. + + true if an intersection must occur
+ or false if no conclusion about intersection can be made
+
+ + + A visitor which tests whether it can be + concluded that a geometry contains a vertex of + a query geometry. + + Martin Davis + + + + + + + + + + + + + + + + + + + + + + Gets a value indicating whether it can be concluded that a corner point of the rectangle is + contained in the geometry, or whether further testing is required. + + true if a corner point is contained + or false if no conclusion about intersection can be made + + + + + A visitor to test for intersection between the query rectangle and the line segments of the geometry. + + Martin Davis + + + + Creates a visitor for checking rectangle intersection with segments + + the query rectangle + + + Reports whether any segment intersection exists. + true if a segment intersection exists or + false if no segment intersection exists + + + + Tests if any line segments in two sets of intersect. + Optimized for use when at least one input is of small size. + Short-circuited to return as soon an intersection is found. + + + + + + + + + + + + + + + + + + + + + An EdgeEndBuilder creates EdgeEnds for all the "split edges" + created by the intersections determined for an Edge. + Computes the EdgeEnds which arise from a noded Edge. + + + + + + + + + + + + Creates stub edges for all the intersections in this + Edge (if any) and inserts them into the graph. + + + + + + + Create a EdgeStub for the edge before the intersection eiCurr. + The previous intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the previous point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiPrev may be null. + + + + + + + + + Create a StubEdge for the edge after the intersection eiCurr. + The next intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the next point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiNext may be null. + + + + + + + + + A collection of EdgeStubs which obey the following invariant: + They originate at the same node and have the same direction. + Contains all EdgeEnds which start at the same point and are parallel. + + + + + + + + + + + + + + + + + + + + + + + + This computes the overall edge label for the set of + edges in this EdgeStubBundle. It essentially merges + the ON and side labels for each edge. + These labels must be compatible + + + + + + Compute the overall ON location for the list of EdgeStubs. + (This is essentially equivalent to computing the self-overlay of a single Geometry) + edgeStubs can be either on the boundary (eg Polygon edge) + OR in the interior (e.g. segment of a LineString) + of their parent Geometry. + In addition, GeometryCollections use the to determine + whether a segment is on the boundary or not. + Finally, in GeometryCollections it can occur that an edge is both + on the boundary and in the interior (e.g. a LineString segment lying on + top of a Polygon edge.) In this case the Boundary is given precendence. + These observations result in the following rules for computing the ON location: + if there are an odd number of Bdy edges, the attribute is Bdy + if there are an even number >= 2 of Bdy edges, the attribute is Int + if there are any Int edges, the attribute is Int + otherwise, the attribute is Null. + + + + + + + Compute the labelling for each side + + + + + + To compute the summary label for a side, the algorithm is: + FOR all edges + IF any edge's location is Interior for the side, side location = Interior + ELSE IF there is at least one Exterior attribute, side location = Exterior + ELSE side location = Null + Note that it is possible for two sides to have apparently contradictory information + i.e. one edge side may indicate that it is in the interior of a point, while + another edge side may indicate the exterior of the same point. This is + not an incompatibility - GeometryCollections may contain two Polygons that touch + along an edge. This is the reason for Interior-primacy rule above - it + results in the summary label having the Geometry interior on both sides. + + + + + + + Update the IM with the contribution for the computed label for the EdgeStubs. + + + + + + + + + + + + + + + + + An ordered list of EdgeEndBundles around a RelateNode. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + Insert a EdgeEnd in order in the list. + If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is + added to the bundle. Otherwise, a new EdgeEndBundle is created + to contain the EdgeEnd. + + + + + + Update the IM with the contribution for the EdgeStubs around the node. + + + + + + Computes the topological relationship between two Geometries. + RelateComputer does not need to build a complete graph structure to compute + the IntersectionMatrix. The relationship between the geometries can + be computed by simply examining the labelling of edges incident on each node. + RelateComputer does not currently support arbitrary GeometryCollections. + This is because GeometryCollections can contain overlapping Polygons. + In order to correct compute relate on overlapping Polygons, they + would first need to be noded and merged (if not explicitly, at least + implicitly). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + For all intersections on the edges of a Geometry, + label the corresponding node IF it doesn't already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + If the Geometries are disjoint, we need to enter their dimension and + boundary dimension in the Ext rows in the IM + + + + + + + + + + + Update the IM with the sum of the IMs for each component. + + + + + + Processes isolated edges by computing their labelling and adding them + to the isolated edges list. + Isolated edges are guaranteed not to touch the boundary of the target (since if they + did, they would have caused an intersection to be computed and hence would + not be isolated). + + + + + + + Label an isolated edge of a graph with its relationship to the target point. + If the target has dim 2 or 1, the edge can either be in the interior or the exterior. + If the target has dim 0, the edge must be in the exterior. + + + + + + + + Isolated nodes are nodes whose labels are incomplete + (e.g. the location for one Geometry is null). + This is the case because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A RelateNode is a Node that maintains a list of EdgeStubs + for the edges that are incident on it. + + + + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + Update the IM with the contribution for the EdgeEnds incident on this node. + + + + + + Used by the NodeMap in a RelateNodeGraph to create RelateNodes. + + + + + + + + + + + + Implements the simple graph of Nodes and EdgeEnd which is all that is + required to determine topological relationships between Geometries. + Also supports building a topological graph of a single Geometry, to + allow verification of valid topology. + It is not necessary to create a fully linked + PlanarGraph to determine relationships, since it is sufficient + to know how the Geometries interact locally around the nodes. + In fact, this is not even feasible, since it is not possible to compute + exact intersection points, and hence the topology around those nodes + cannot be computed robustly. + The only Nodes that are created are for improper intersections; + that is, nodes which occur at existing vertices of the Geometries. + Proper intersections (e.g. ones which occur between the interior of line segments) + have their topology determined implicitly, without creating a Node object + to represent them. + + + + + + + + + + + + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + Precondition: edge intersections have been computed. + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule). + + + + + + + + + + + + + Implements the SFS relate() generalized spatial predicate on two s. +
+ The class supports specifying a custom + to be used during the relate computation. +
+ + If named spatial predicates are used on the result + of the RelateOp, the result may or not be affected by the + choice of BoundaryNodeRule, depending on the exact nature of the pattern. + For instance, is insensitive + to the choice of BoundaryNodeRule, + whereas is affected by the rule chosen. + + Note: custom Boundary Node Rules do not (currently) + affect the results of other methods (such + as . The results of + these methods may not be consistent with the relationship computed by + a custom Boundary Node Rule. + +
+ + + Computes the for the spatial relationship + between two s, using the default (OGC SFS) Boundary Node Rule + + A geometry to test + A geometry to test + The IntersectonMatrix for the spatial relationship between the geometries + + + + Computes the for the spatial relationship + between two s, using the specified Boundary Node Rule + + A geometry to test + A geometry to test + The Boundary Node Rule to use + The IntersectonMatrix for the spatial relationship between the geometries + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + The Boundary Node Rule to use + + + + Gets the IntersectionMatrix for the spatial relationship + between the input geometries. + + + + + Provides an efficient method of unioning a collection of + geometrys. + The geometries are indexed using a spatial index, + and unioned recursively in index order. + For geometries with a high degree of overlap, + this has the effect of reducing the number of vertices + early in the process, which increases speed + and robustness. + + This algorithm is faster and more robust than + the simple iterated approach of + repeatedly unioning each polygon to a result geometry. + + The buffer(0) trick is sometimes faster, but can be less robust and + can sometimes take a long time to complete. + This is particularly the case where there is a high degree of overlap + between the polygons. In this case, buffer(0) is forced to compute + with all line segments from the outset, + whereas cascading can eliminate many segments + at each stage of processing. + The best situation for using buffer(0) is the trivial case + where there is no overlap between the input geometries. + However, this case is likely rare in practice. + + Martin Davis + + + + The effectiveness of the index is somewhat sensitive + to the node capacity. + Testing indicates that a smaller capacity is better. + For an STRtree, 4 is probably a good number (since + this produces 2x2 "squares"). + + + + Computes the union of + a collection of s. + + A collection of s. + + + + + Creates a new instance to union + the given collection of s. + + A collection of s + + + + Computes the union of the input geometries. + + + + This method discards the input geometries as they are processed. + In many input cases this reduces the memory retained + as the operation proceeds. + Optimal memory usage is achieved + by disposing of the original input collection + before calling this method. + + The union of the input geometries, + or null if no input geometries were provided + + if this method is called more than once + + + + Unions a list of geometries + by treating the list as a flattened binary tree, + and performing a cascaded union on the tree. + + The list of geometries to union + The union of the list + + + + Unions a section of a list using a recursive binary union on each half + of the section. + + The list of geometries containing the section to union + The start index of the section + The index after the end of the section + The union of the list section + + + + Gets the element at a given list index, or + null if the index is out of range. + + The list of geometries + The index + The geometry at the given index or + null if the index is out of range + + + + Reduces a tree of geometries to a list of geometries + by recursively unioning the subtrees in the list. + + A tree-structured list of geometries + A list of Geometrys + + + + Computes the union of two geometries, + either or both of which may be null. + + A Geometry + A Geometry + The union of the input(s) or + null if both inputs are null + + + + Unions two polygonal geometries, restricting computation + to the envelope intersection where possible. + The case of MultiPolygons is optimized to union only + the polygons which lie in the intersection of the two geometry's envelopes. + Polygons outside this region can simply be combined with the union result, + which is potentially much faster. + This case is likely to occur often during cascaded union, and may also + occur in real world data (such as unioning data for parcels on different street blocks). + + A polygonal geometry + A polygonal geometry + The intersection of the envelopes of the inputs + The union of the inputs + + + + Encapsulates the actual unioning of two polygonal geometries. + + + + Computes a containing only components. + Extracts the s from the input + and returns them as an appropriate geometry. + + If the input is already Polygonal, it is returned unchanged. + + A particular use case is to filter out non-polygonal components + returned from an overlay operation. + + The geometry to filter + A polygonal geometry + + + + Computes the union of a geometry with + another arbitrary . + Does not copy any component geometries. + + + + + + + + Unions a Collection of s or a single Geometry (which may be a ) together. + + + + By using this special-purpose operation over a collection of geometries + it is possible to take advantage of various optimizations to improve performance. + + + Heterogeneous s are fully supported. + + + The result obeys the following contract: + + Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). + Unioning a set of s has the effect of fully noding + and dissolving the input linework. + In this context "fully noded" means that there will be + an endpoint or node in the result + for every endpoint or line segment crossing in the input. + "Dissolved" means that any duplicate (e.g. coincident) line segments or portions + of line segments will be reduced to a single line segment in the output. + This is consistent with the semantics of the + operation. + If merged linework is required, the class can be used. + Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). + + + UnaryUnion always operates on the individual components of MultiGeometries. + So it is possible to use it to "clean" invalid self-intersecting MultiPolygons + (although the polygon components must all still be individually valid.) + + + + mbdavis + + + + + Computes the geometric union of a + + A collection of geometries + The union of the geometries, + or null if the input is empty + + + + Computes the geometric union of a + If no input geometries were provided but a was provided, + an empty is returned. + + A collection of geometries + The geometry factory to use if the collection is empty + The union of the geometries + or an empty GEOMETRYCOLLECTION + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + The union of the elements of the geometry + or an empty GEOMETRYCOLLECTION + + + + Constructs a unary union operation for an enumeration + of s, using the + of the input geometries. + + An enumeration of geometries + + + + Constructs a unary union operation for an enumeration + of s. + If no input geometries were provided but a was provided, + + An enumeration of geometries + The geometry factory to use if the enumeration is empty + + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + + + + Gets the union of the input geometries. + If no input geometries were provided but a was provided, + an empty is returned. + Otherwise, the return value is null + + + A Geometry containing the union + or an empty if no geometries were provided in the input, + or null if not GeometryFactory was provided + + + + + Computes the union of two geometries, either of both of which may be null. + + + + + The union of the input(s) + or null if both inputs are null + + + + + Computes a unary union with no extra optimization, and no short-circuiting. + + + Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. + + A geometry + The union of the input geometry + + + + Experimental code to union MultiPolygons with processing limited to the elements which actually interact. + + Not currently used, since it doesn't seem to offer much of a performance advantage. + mbdavis + + + + This class tests that the interior of an area + ( or ) + is connected. An area Geometry is invalid if the interior is disconnected. + This can happen if: + - a shell self-intersects, + - one or more holes form a connected chain touching a shell at two different points, + - one or more holes form a ring around a subset of the interior. + If a disconnected situation is found the location of the problem is recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form s in graph into Minimal EdgeRings. + (Minimal Edgerings must be used, because only they are guaranteed to provide + a correct isHole computation). + + + + + + + Mark all the edges for the edgeRings corresponding to the shells of the input polygons. + Only ONE ring gets marked for each shell - if there are others which remain unmarked + this indicates a disconnected interior. + + + + + + + + + + + + + + + + + + + + Check if any shell ring has an unvisited edge. + A shell ring is a ring which is not a hole and which has the interior + of the parent area on the RHS. + (Note that there may be non-hole rings with the interior on the LHS, + since the interior of holes will also be polygonized into CW rings + by the LinkAllDirectedEdges() step). + + + true if there is an unvisited edge in a non-hole ring. + + + + + + + + + Checks that a {GeometryGraph} representing an area + (a Polygon or MultiPolygon ) + is consistent with the SFS semantics for area geometries. + Checks include: + Testing for rings which self-intersect (both properly and at nodes). + Testing for duplicate rings. + If an inconsistency if found the location of the problem is recorded. + + + + + + + + + + + Returns the intersection point, or null if none was found. + + + + + + + + + + Check all nodes to see if their labels are consistent. + If any are not, return false. + + + + + Checks for two duplicate rings in an area. + Duplicate rings are rings that are topologically equal + (that is, which have the same sequence of points up to point order). + If the area is topologically consistent (determined by calling the + isNodeConsistentArea, + duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. + (This is because topologically consistent areas cannot have two rings sharing + the same line segment, unless the rings are equal). + The start point of one of the equal rings will be placed in invalidPoint. + Returns true if this area Geometry is topologically consistent but has two duplicate rings. + + + + Tests whether any of a set of {@link LinearRing}s are + nested inside another ring in the set, using a spatial + index to speed up the comparisons. + + @version 1.7 + + + + Implements the algorithsm required to compute the + method for s. + See the documentation for the various geometry types for a specification of validity. + + + + + Checks whether a coordinate is valid for processing. + Coordinates are valid iff their x and y ordinates are in the + range of the floating point representation. + + The coordinate to validate. + true if the coordinate is valid. + + + + Find a point from the list of testCoords + that is NOT a node in the edge for the list of searchCoords. + + + + + The point found, or null if none found. + + + If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). + + + + + + + + + + + + + + + + Checks validity of a Point. + + + + + + Checks validity of a MultiPoint. + + + + + + Checks validity of a LineString. + Almost anything goes for lineStrings! + + + + + + Checks validity of a LinearRing. + + + + + + Checks the validity of a polygon and sets the validErr flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there is no ring which self-intersects (except of course at its endpoints). + This is required by OGC topology rules (but not by other models + such as ESRI SDE, which allow inverted shells and exverted holes). + + + + + + Check that a ring does not self-intersect, except at its endpoints. + Algorithm is to count the number of times each node along edge occurs. + If any occur more than once, that must be a self-intersection. + + + + + Tests that each hole is inside the polygon shell. + This routine assumes that the holes have previously been tested + to ensure that all vertices lie on the shell or inside it. + A simple test of a single point in the hole can be used, + provide the point is chosen such that it does not lie on the + boundary of the shell. + + The polygon to be tested for hole inclusion. + A GeometryGraph incorporating the polygon. + + + + Tests that no hole is nested inside another hole. + This routine assumes that the holes are disjoint. + To ensure this, holes have previously been tested + to ensure that: + They do not partially overlap + (checked by checkRelateConsistency). + They are not identical + (checked by checkRelateConsistency). + + + + + Tests that no element polygon is wholly in the interior of another element polygon. + Preconditions: + Shells do not partially overlap. + Shells do not touch along an edge. + No duplicate rings exists. + This routine relies on the fact that while polygon shells may touch at one or + more vertices, they cannot touch at ALL vertices. + + + + + Check if a shell is incorrectly nested within a polygon. This is the case + if the shell is inside the polygon shell, but not inside a polygon hole. + (If the shell is inside a polygon hole, the nesting is valid.) + The algorithm used relies on the fact that the rings must be properly contained. + E.g. they cannot partially overlap (this has been previously checked by + CheckRelateConsistency). + + + + + This routine checks to see if a shell is properly contained in a hole. + It assumes that the edges of the shell and hole do not + properly intersect. + + + + + + null if the shell is properly contained, or + a Coordinate which is not inside the hole if it is not. + + + + + + + + + + + + Gets/Sets whether polygons using Self-Touching Rings to form + holes are reported as valid. + If this flag is set, the following Self-Touching conditions + are treated as being valid: + - The shell ring self-touches to create a hole touching the shell. + - A hole ring self-touches to create two holes touching at a point. + + + The default (following the OGC SFS standard) + is that this condition is not valid (false). + + + This does not affect whether Self-Touching Rings + disconnecting the polygon interior are considered valid + (these are considered to be invalid under the SFS, and many other + spatial models as well). + This includes "bow-tie" shells, + which self-touch at a single point causing the interior to be disconnected, + and "C-shaped" holes which self-touch at a single point causing an island to be formed. + + + States whether geometry with this condition is valid. + + + + Computes the validity of the geometry, + and returns true if it is valid. + + + + + Computes the validity of the geometry, + and if not valid returns the validation error for the geometry, + or null if the geometry is valid. + + The validation error, if the geometry is invalid
+ or null if the geometry is valid
+
+ + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a Quadtree + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the appropriate checks for repeated points + (consecutive identical coordinates) as defined in the + NTS spec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a simple O(n^2) + comparison. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a SweepLineIndex + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about the nature and location of + a validation error. + + + + + Not used. + + + + + No longer used: + repeated points are considered valid as per the SFS. + + + + + Indicates that a hole of a polygon lies partially + or completely in the exterior of the shell. + + + + + Indicates that a hole lies + in the interior of another hole in the same polygon. + + + + + Indicates that the interior of a polygon is disjoint + (often caused by set of contiguous holes splitting + the polygon into two parts). + + + + + Indicates that two rings of a polygonal geometry intersect. + + + + + Indicates that a ring self-intersects. + + + + + Indicates that a polygon component of a + lies inside another polygonal component. + + + + + Indicates that a polygonal geometry + contains two rings which are identical. + + + + + Indicates that either: + - A contains a single point. + - A contains 2 or 3 points. + + + + + Indicates that the X or Y ordinate of + a is not a valid + numeric value (e.g. ). + + + + + Indicates that a ring is not correctly closed + (the first and the last coordinate are different). + + + + + Contains information about the nature and location of a Geometry + validation error. + + + + + These messages must synch up with the indexes above + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds all connected s of a . + + + + + Initializes a new instance of the class. + + The . + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + + + + + + Adds the argument node and all its out edges to the subgraph. + + + + + + + + A sorted collection of DirectedEdges which leave a Node + in a PlanarGraph. + + + + + The underlying list of outgoing DirectedEdges. + + + + + Adds a new member to this DirectedEdgeStar. + + + + + + Drops a member of this DirectedEdgeStar. + + + + + + Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the zero-based index of the given DirectedEdge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the remainder when i is divided by the number of edges in this + DirectedEdgeStar. + + + + + + + Returns the on the left-hand + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + + + Returns the on the right-hand (CW) + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + Returns the number of edges around the Node associated with this DirectedEdgeStar. + + + + + Returns the coordinate for the node at wich this star is based. + + + + + Returns the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + A node in a PlanarGraph is a location where 0 or more Edges + meet. A node is connected to each of its incident Edges via an outgoing + DirectedEdge. Some clients using a PlanarGraph may want to + subclass Node to add their own application-specific + data and methods. + + + + + Returns all Edges that connect the two nodes (which are assumed to be different). + + + + + + + + The location of this Node. + + + + + The collection of DirectedEdges that leave this Node. + + + + + Constructs a Node with the given location. + + + + + + Constructs a Node with the given location and collection of outgoing DirectedEdges. + + + + + + + Adds an outgoing DirectedEdge to this Node. + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Removes a incident on this node. Does not change the state of the directed edge. + + + + + Removes this node from its containing graph. + + + + + + + + + + + Returns the location of this Node. + + + + + Returns the collection of DirectedEdges that leave this Node. + + + + + Returns the number of edges around this Node. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + Adds a node to the map, replacing any that is already at that location. + + + The added node. + + + + Removes the Node at the given location, and returns it (or null if no Node was there). + + + + + + + Returns the Node at the given location, or null if no Node was there. + + + + + + + Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the number of Nodes in this NodeMap. + + + + + A subgraph of a . + A subgraph may contain any subset of s + from the parent graph. + It will also automatically contain all s + and s associated with those edges. + No new objects are created when edges are added - + all associated components must already exist in the parent graph. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new subgraph of the given . + + + + + + Gets the which this subgraph is part of. + + + + + + Adds an to the subgraph. + The associated s and s are also added. + + The to add. + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph. + + + + + + Tests whether an is contained in this subgraph. + + The to test. + true if the is contained in this subgraph. + + + + Determines the maximum number of common most-significant + bits in the mantissa of one or numbers. + Can be used to compute the double-precision number which + is represented by the common bits. + If there are no common bits, the number computed is 0.0. + + + + + Computes the bit pattern for the sign and exponent of a + double-precision number. + + + The bit pattern for the sign and exponent. + + + + This computes the number of common most-significant bits in the mantissas + of two double-precision numbers. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + /// + The number of common most-significant mantissa bits. + + + + Zeroes the lower n bits of a bitstring. + + The bitstring to alter. + the number of bits to zero. + The zeroed bitstring. + + + + Extracts the i'th bit of a bitstring. + + The bitstring to extract from. + The bit to extract. + The value of the extracted bit. + + + + + + + + + + A representation of the Double bits formatted for easy readability + + + + + + + + + + + + Provides versions of Geometry spatial functions which use + common bit removal to reduce the likelihood of robustness problems. + In the current implementation no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + Client classes should check the validity of the returned result themselves. + + + + + Creates a new instance of class, which reshifts result Geometrys. + + + + + Creates a new instance of class, specifying whether + the result Geometrys should be reshifted. + + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry, to be subtracted from the first. + The Geometry representing the set-theoretic difference of the input Geometries. + + + Computes the set-theoretic symmetric difference of two geometries, + using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer a point, using enhanced precision. + + The Geometry to buffer. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + If required, returning the result to the orginal precision if required. + In this current implementation, no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + + The result Geometry to modify. + The result Geometry with the required precision. + + + + Computes a copy of the input Geometry with the calculated common bits + removed from each coordinate. + + The Geometry to remove common bits from. + A copy of the input Geometry with common bits removed. + + + + Computes a copy of each input Geometrys with the calculated common bits + removed from each coordinate. + + A Geometry to remove common bits from. + A Geometry to remove common bits from. + + An array containing copies + of the input Geometry's with common bits removed. + + + + + Removes common most-significant mantissa bits + from one or more s. + + The CommonBitsRemover "scavenges" precision + which is "wasted" by a large displacement of the geometry + from the origin. + For example, if a small geometry is displaced from the origin + by a large distance, + the displacement increases the significant figures in the coordinates, + but does not affect the relative topology of the geometry. + Thus the geometry can be translated back to the origin + without affecting its topology. + In order to compute the translation without affecting + the full precision of the coordinate values, + the translation is performed at the bit level by + removing the common leading mantissa bits. + + If the geometry envelope already contains the origin, + the translation procedure cannot be applied. + In this case, the common bits value is computed as zero. + + If the geometry crosses the Y axis but not the X axis + (and mutatis mutandum), + the common bits for Y are zero, + but the common bits for X are non-zero. + + + + + Add a point to the set of geometries whose common bits are + being computed. After this method has executed the + common coordinate reflects the common bits of all added + geometries. + + A Geometry to test for common bits. + + + + Removes the common coordinate bits from a Geometry. + The coordinates of the Geometry are changed. + + The Geometry from which to remove the common coordinate bits. + The shifted Geometry. + + + + Adds the common coordinate bits back into a Geometry. + The coordinates of the Geometry are changed. + + The Geometry to which to add the common coordinate bits. + + + + The common bits of the Coordinates in the supplied Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate sequence + + + + Reduces the precision of the s in a + to match the supplied . + + + Uses . + The input is modified in-place, so + it should be cloned beforehand if the + original should not be modified. + + mbdavis + + + + Creates a new precision reducer filter. + + The PrecisionModel to use + + + + Rounds the Coordinates in the sequence to match the PrecisionModel + + + + + Always runs over all geometry components. + + + + + Always reports that the geometry has changed + + + + + Provides versions of Geometry spatial functions which use + enhanced precision techniques to reduce the likelihood of robustness problems. + + + + + Only static methods! + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic difference of the input Geometries. + + + + Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer of a Geometry, using enhanced precision. + This method should no longer be necessary, since the buffer algorithm + now is highly robust. + + The first Geometry. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + Reduces the precision of a + according to the supplied , + ensuring that the result is topologically valid. + + + + + Convenience method for doing precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + and preserving polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Convenience method for doing pointwise precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + but NOT preserving valid polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Duplicates a geometry to one that uses a different PrecisionModel, + without changing any coordinate values. + + The geometry to duplicate + The precision model to use + The geometry value with a new precision model + + + Gets or sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + The default is to remove collapsed components. + + + + + /// Gets or sets whether the of the new reduced Geometry + will be changed to be the supplied to + specify the precision reduction. + + The default is to not change the precision model + + + + + Gets or sets whether the precision reduction will be done + in pointwise fashion only. + Pointwise precision reduction reduces the precision + of the individual coordinates only, but does + not attempt to recreate valid topology. + This is only relevant for geometries containing polygonal components. + + + + + Computes the Minimum Clearance of a . + + The Minimum Clearance is a measure of + what magnitude of perturbation of + the vertices of a geometry can be tolerated + before the geometry becomes topologically invalid. + The smaller the Minimum Clearance distance, + the less vertex pertubation the geometry can tolerate + before becoming invalid. + + + The concept was introduced by Thompson and Van Oosterom + [TV06], based on earlier work by Milenkovic [Mi88]. + + The Minimum Clearance of a geometry G + is defined to be the value r + such that "the movement of all points by a distance + of r in any direction will + guarantee to leave the geometry valid" [TV06]. + An equivalent constructive definition [Mi88] is that + r is the largest value such: + + No two distinct vertices of G are closer than r. + No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint + + The following image shows an example of the Minimum Clearance + of a simple polygon. + +
+ + If G has only a single vertex (i.e. is a + ), the value of the minimum clearance + is . + + If G is a or geometry, + then in fact no amount of perturbation + will render the geometry invalid. + In this case a Minimum Clearance is still computed + based on the vertex and segment distances + according to the constructive definition. + + It is possible for no Minimum Clearance to exist. + For instance, a with all members identical + has no Minimum Clearance + (i.e. no amount of perturbation will cause + the member points to become non-identical). + Empty geometries also have no such distance. + The lack of a meaningful MinimumClearance distance is detected + and suitable values are returned by + and . + + The computation of Minimum Clearance utilizes + the + method to provide good performance even for + large inputs. + + An interesting note is that for the case of s, + the computed Minimum Clearance line + effectively determines the Nearest Neighbours in the collection. +

References

+ + [Mi88] Milenkovic, V. J., + Verifiable implementations of geometric algorithms + using finite precision arithmetic. + in Artificial Intelligence, 377-401. 1988 + [TV06] Thompson, Rod and van Oosterom, Peter, + Interchange of Spatial Data-Inhibiting Factors, + Agile 2006, Visegrad, Hungary. 2006 + +
+ /// Martin Davis +
+ + + Computes the Minimum Clearance distance for + the given Geometry. + + The input geometry + The minimum clearance + + + + Gets a LineString containing two points + which are at the Minimum Clearance distance + for the given Geometry. + + The input geometry + The value of the minimum clearance distance
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + Creates an object to compute the Minimum Clearance for the given Geometry + + The input geometry + + + + Gets the Minimum Clearance distance. + If no distance exists + (e.g. in the case of two identical points) + is returned. + + + The value of the minimum clearance distance
+ or if no Minimum Clearance distance exists +
+
+ + + Gets a LineString containing two points + which are at the Minimum Clearance distance. + If no distance could be found + (e.g. in the case of two identical points) + LINESTRING EMPTY is returned. + + The value of the minimum clearance distance,
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + + Reduces the precision of the coordinates of a Geometry + according to the supplied {PrecisionModel}, without + attempting to preserve valid topology. + + + In case of geometries, + the topology of the resulting geometry may be invalid if + topological collapse occurs due to coordinates being shifted. + It is up to the client to check this and handle it if necessary. + Collapses may not matter for some uses. An example + is simplifying the input to the buffer algorithm. + The buffer algorithm does not depend on the validity of the input point. + + + + + Convenience method for doing precision reduction on a single geometry, + with collapses removed and keeping the geometry precision model the same. + + The reduced geometry + + + + + + + + + + + + + + + + + Sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + + + + + Gets/Sets whether the PrecisionModel of the new reduced Geometry + will be changed to be the PrecisionModel supplied to + specify the precision reduction. + The default is to not change the precision model. + + + + + + + + + + + + + + + + + + + + + + + + Computes the minimum clearance of a geometry or + set of geometries. + The Minimum Clearance is a measure of + what magnitude of perturbation of its vertices can be tolerated + by a geometry before it becomes topologically invalid. + + This class uses an inefficient O(N^2) scan. + It is primarily for testing purposes. + + + Martin Davis + + + + Gets or sets the total number of points in the created . + The created geometry will have no more than this number of points, + unless more are needed to create a valid geometry. + + + + + The height of an equilateral triangle of side one + + + + + Creates random point sets contained in a + region defined by either a rectangular or a polygonal extent. + + mbdavis + + + + Create a shape factory which will create shapes using the default + . + + + + + Create a shape factory which will create shapes using the given + + + The factory to use + + + + Sets a polygonal mask. + + if the mask is not polygonal + + + + Creates random point sets where the points + are constrained to lie in the cells of a grid. + + mbdavis + + + + Create a builder which will create shapes using the default + . + + + + + Create a builder which will create shapes using the given + . + + The factory to use + + + + Gets the containing the generated point + + A MultiPoint + + + + Gets or sets whether generated points are constrained to lie + within a circle contained within each grid cell. + This provides greater separation between points + in adjacent cells. + + The default is to not be constrained to a circle. + + + + + Gets or sets the fraction of the grid cell side which will be treated as + a gutter, in which no points will be created. + + The provided value is clamped to the range [0.0, 1.0]. + + + + + Simplifies a line (sequence of points) using + the standard Douglas-Peucker algorithm. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a using the Douglas-Peucker algorithm. + + + Ensures that any polygonal geometries returned are valid. + Simple lines are not guaranteed to remain simple after simplification. + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + Note that in general D-P does not preserve topology - + e.g. polygons can be split, collapse to lines or disappear + holes can be created or disappear, + and lines can cross. + To simplify point while preserving topology use TopologySafeSimplifier. + (However, using D-P is significantly faster). + + KNOWN BUGS: + In some cases the approach used to clean invalid simplified polygons + can distort the output geometry severely. + + + + + + Simplifies a geometry using a given tolerance. + + The geometry to simplify. + The tolerance to use. + A simplified version of the geometry. + + + + Creates a simplifier for a given geometry. + + The geometry to simplify. + + + + Gets the simplified geometry. + + The simplified geometry. + + + + The distance tolerance for the simplification. + + + All vertices in the simplified geometry will be within this + distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" + to have valid topology. + + + The caller may choose to disable this because: + + valid topology is not required + fixing topology is a relative expensive operation + in some pathological cases the topology fixing operation may either fail or run for too long + + The default is to fix polygon topology. + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a polygon, fixing it if required. + + + + + + + + Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. + + null if the simplification results in a degenerate ring + + + + + + + + + + + + Creates a valid area point from one that possibly has + bad topology (i.e. self-intersections). + Since buffer can handle invalid topology, but always returns + valid point, constructing a 0-width buffer "corrects" the + topology. + Note this only works for area geometries, since buffer always returns + areas. This also may return empty geometries, if the input + has no actual area. + + An area point possibly containing self-intersections. + A valid area point. + + + + An index of LineSegments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemVisitor subclass to reduce volume of query results. + + + + + + + + + + + + + + + + + + + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + A LineSegment which is tagged with its location in a Geometry. + Used to index the segments in a point and recover the segment locations + from the index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a collection of TaggedLineStrings, preserving topology + (in the sense that no new intersections are introduced). + This class is essentially just a container for the common + indexes used by . + + + + + Simplifies a collection of TaggedLineStrings. + + The collection of lines to simplify. + + + + Gets or sets the distance tolerance for the simplification.
+ Points closer than this tolerance to a simplified segment may + be removed. +
+
+ + + Represents a which can be modified to a simplified shape. + This class provides an attribute which specifies the minimum allowable length + for the modified result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a TaggedLineString, preserving topology + (in the sense that no new intersections are introduced). + Uses the recursive Douglas-Peucker algorithm. + + + + + Simplifies the given + using the distance tolerance specified. + + The linestring to simplify. + + + + Flattens a section of the line between + indexes and , + replacing them with a line between the endpoints. + The input and output indexes are updated + to reflect this. + + The start index of the flattened section. + The end index of the flattened section. + The new segment created. + + + + Tests whether a segment is in a section of a . + + + + + + + + + Remove the segs in the section of the line. + + + + + + + + Sets the distance tolerance for the simplification. + All vertices in the simplified geometry will be within this + distance of the original geometry. + + + + + Simplifies a point and ensures that + the result is a valid point having the + same dimension and number of components as the input, + and with the components having the same topological + relationship. + + If the input is a polygonal geometry + ( or ): + + The result has the same number of shells and holes as the input, + with the same topological structure + The result rings touch at no more than the number of touching points in the input + (although they may touch at fewer points). + The key implication of this statement is that if the + input is topologically valid, so is the simplified output. + + For linear geometries, if the input does not contain + any intersecting line segments, this property + will be preserved in the output. + + For all geometry types, the result will contain + enough vertices to ensure validity. For polygons + and closed linear geometries, the result will have at + least 4 vertices; for open linestrings the result + will have at least 2 vertices. + + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + The simplification uses a maximum-distance difference algorithm + similar to the Douglas-Peucker algorithm. + + +

KNOWN BUGS

+ + May create invalid topology if there are components which are small + relative to the tolerance value. + In particular, if a small hole is very near an edge, + it is possible for the edge to be moved by a relatively large tolerance value + and end up with the hole outside the result shell (or inside another hole). + Similarly, it is possible for a small polygon component to end up inside + a nearby larger polygon. + A workaround is to test for this situation in post-processing and remove + any invalid holes or polygons. + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A filter to add linear geometries to the linestring map + with the appropriate minimum size constraint. + Closed s (including s + have a minimum output size constraint of 4, + to ensure the output is valid. + For all other linestrings, the minimum size is 2 points. + + Martin Davis + + + + Filters linear geometries. + + A geometry of any type + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a using the Visvalingam-Whyatt area-based algorithm. + Ensures that any polygonal geometries returned are valid. Simple lines are not + guaranteed to remain simple after simplification. All geometry types are + handled. Empty and point geometries are returned unchanged. Empty geometry + components are deleted. + The simplification tolerance is specified as a distance. + This is converted to an area tolerance by squaring it. + + Known Bugs + * Not yet optimized for performance. + * Does not simplify the endpoint of rings. + To Do + * Allow specifying desired number of vertices in the output. + + + + Note that in general this algorithm does not preserve topology - e.g. polygons can be split, + collapse to lines or disappear holes can be created or disappear, and lines + can cross. + + 1.7 + + + + Simplifies a using a given tolerance. + + The to simplify. + The tolerance to use. + A simplified version of the . + + + + Creates a simplifier for a given . + + The to simplify. + + + + Gets the semplified . + + The semplified . + + + + Sets the distance tolerance for the simplification. All vertices in the + simplified will be within this distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" to have valid + topology. The caller may choose to disable this because: + * valid topology is not required. + * fixing topology is a relative expensive operation. + * in some pathological cases the topology fixing operation may either + fail or run for too long. + + The default is to fix polygon topology. + + + + Simplifies a , fixing it if required. + + + + + + + + Simplifies a . If the simplification results in a degenerate + ring, remove the component. + + + + null if the simplification results in a degenerate ring. + + + + Simplifies a , fixing it if required. + + + + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections. + A valid area geometry. + + + + A utility class which creates Conforming Delaunay Trianglulations + from collections of points and linear constraints, and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Sets the sites (point or vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + The site vertices do not have to contain the constraint + vertices as well; any site vertices which are + identical to a constraint vertex will be removed + from the site vertex set. + + The geometry from which the sites will be extracted. + + + + Gets the QuadEdgeSubdivision which models the computed triangulation. + + The subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + The geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the linear constraints to be conformed to. + All linear components in the input will be used as constraints. + The constraint vertices do not have to be disjoint from + the site vertices. + The constraints must not contain duplicate segments (up to orientation). + + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + + Creates a Conforming Delaunay Triangulation based on the given + unconstrained initial vertices. The initial vertex set should not contain + any vertices which appear in the constraint set. + + a collection of + the distance tolerance below which points are considered identical + + + + Sets the constraints to be conformed to by the computed triangulation. + The constraints must not contain duplicate segments (up to orientation). + The unique set of vertices (as es) + forming the constraints must also be supplied. + Supplying it explicitly allows the ConstraintVertexes to be initialized + appropriately(e.g. with external data), and avoids re-computing the unique set + if it is already available. + + list of the constraint {@link Segment}s + the set of unique es referenced by the segments + + + + Creates a vertex on a constraint segment + + the location of the vertex to create + the constraint segment it lies on + the new constraint vertex + + + + Inserts all sites in a collection + + a collection of ConstraintVertex + + + + Inserts a site into the triangulation, maintaining the conformal Delaunay property. + This can be used to further refine the triangulation if required + (e.g. to approximate the medial axis of the constraints, + or to improve the grading of the triangulation). + + the location of the site to insert + + + + Computes the Delaunay triangulation of the initial sites. + + + + + Enforces the supplied constraints into the triangulation. + + + if the constraints cannot be enforced + + + + Given a set of points stored in the kd-tree and a line segment defined by + two points in this set, finds a in the circumcircle of + the line segment, if one exists. This is called the Gabriel point - if none + exists then the segment is said to have the Gabriel condition. Uses the + heuristic of finding the non-Gabriel point closest to the midpoint of the + segment. + + the line segment + + A point which is non-Gabriel, + or null if no point is non-Gabriel + + + + + Gets or sets the to be + used during constraint enforcement. + Different splitting strategies may be appropriate + for special situations. + + the ConstraintSplitPointFinder to be used + + + + Gets the tolerance value used to construct the triangulation. + + a tolerance value + + + + Gets and sets the used to create new constraint vertices at split points. + + Allows the setting of a custom {@link ConstraintVertexFactory} to be used + to allow vertices carrying extra information to be created. + + + + + Gets the which represents the triangulation. + + + + + Gets the which contains the vertices of the triangulation. + + + + + Gets the sites (vertices) used to initialize the triangulation. + + + + + Gets the s which represent the constraints. + + + + + Gets the convex hull of all the sites in the triangulation, + including constraint vertices. + Only valid after the constraints have been enforced. + + the convex hull of the sites + + + + Indicates a failure during constraint enforcement. + + Martin Davis + 1.0 + + + + Creates a new instance with a given message. + + a string + + + + Creates a new instance with a given message and approximate location. + + a string + the location of the error + + + + Gets the approximate location of this error. + + a location + + + + An interface for strategies for determining the location of split points on constraint segments. + The location of split points has a large effect on the performance and robustness of enforcing a + constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, + especially at narrow constraint angles, since the split point will end up encroaching on the + segment containing the original encroaching point. With detailed knowledge of the geometry of the + constraints, it is sometimes possible to choose better locations for splitting. + + mbdavis + + + + Finds a point at which to split an encroached segment to allow the original segment to appear + as edges in a constrained Delaunay triangulation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + A vertex in a Constrained Delaunay Triangulation. + The vertex may or may not lie on a constraint. + If it does it may carry extra information about the original constraint. + + Martin Davis + + + + Models a site (node) in a . + The sites can be points on a line string representing a + linear site. + The vertex can be considered as a vector with a norm, length, inner product, cross + product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle + defined by this point and two others, etc.) are also defined in this class. + + It is common to want to attach user-defined data to + the vertices of a subdivision. + One way to do this is to subclass Vertex + to carry any desired information. + + David Skea + Martin Davis + + + + Creates an instance of this class using the given x- and y-ordinate valuse + + x-ordinate value + y-ordinate value + + + + Creates an instance of this class using the given x-, y- and z-ordinate values + + x-ordinate value + y-ordinate value + z-ordinate value + + + + Creates an instance of this class using a clone of the given . + + The coordinate + + + + Computes the cross product k = u X v. + + a vertex + returns the magnitude of u X v + + + + Computes the inner or dot product + + A vertex + The dot product u.v + + + + Computes the scalar product c(v) + + A vertex + The scaled vector + + + + Tests if this is inside the circle defined by the points a, b, c. This test uses simple + double-precision arithmetic, and thus may not be robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + true if this vertex is inside the circumcircle (a, b, c) + + + + Tests whether the triangle formed by this vertex and two + other vertices is in CCW orientation. + + a vertex + a vertex + true if the triangle is oriented CCW + + + + Computes the value of the ratio of the circumradius to shortest edge. If smaller than some + given tolerance B, the associated triangle is considered skinny. For an equal lateral + triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: + circumRadius/shortestEdge = 1/(2sin(theta)). + + second vertex of the triangle + third vertex of the triangle + ratio of circumradius to shortest edge. + + + + returns a new vertex that is mid-way between this vertex and another end point. + + the other end point. + the point mid-way between this and that. + + + + Computes the centre of the circumcircle of this vertex and two others. + + + + the Coordinate which is the circumcircle of the 3 points. + + + + For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate + a z value from the surrounding vertices. + + + + + Interpolates the Z-value (height) of a point enclosed in a triangle + whose vertices all have Z values. + The containing triangle must not be degenerate + (in other words, the three vertices must enclose a + non-zero area). + + The point to interpolate the Z value of + A vertex of a triangle containing the + A vertex of a triangle containing the + A vertex of a triangle containing the + The interpolated Z-value (height) of the point + + + + Computes the interpolated Z-value for a point p lying on the segment p0-p1 + + The point to interpolate the Z value of + A vertex of the segment is lying on + A vertex of the segment is lying on + The interpolated Z-value (height) of the point + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + Gets the z-ordinate value + + + + + Gets the coordinate + + + + + Creates a new constraint vertex + + the location of the vertex + + + + Merges the constraint data in the vertex other into this vertex. + This method is called when an inserted vertex is + very close to an existing vertex in the triangulation. + + the constraint vertex to merge + + + + Gets or sets whether this vertex lies on a constraint. + + true if the vertex lies on a constraint + + + + Gets or sets the external constraint object + + object which carries information about the constraint this vertex lies on + + + + An interface for factories which create a {@link ConstraintVertex} + + Martin Davis + + + + A utility class which creates Delaunay Trianglulations + from collections of points and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Extracts the unique s from the given . + + the geometry to extract from + a List of the unique Coordinates + + + + Converts all s in a collection to es. + + the coordinates to convert + a List of Vertex objects + + + + Computes the of a collection of s. + + a List of Coordinates + the envelope of the set of coordinates + + + + Sets the sites (vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + + the geometry from which the sites will be extracted. + + + + Sets the sites (vertices) which will be triangulated + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed triangulation. + + the subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + the geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + Computes a Delauanay Triangulation of a set of es, using an + incrementatal insertion algorithm. + + Martin Davis + 1.0 + + + + Creates a new triangulator using the given . + The triangulator uses the tolerance of the supplied subdivision. + + a subdivision in which to build the TIN + + + + Inserts all sites in a collection. The inserted vertices MUST be + unique up to the provided tolerance value. (i.e. no two vertices should be + closer than the provided tolerance value). They do not have to be rounded + to the tolerance grid, however. + + a Collection of Vertex + if the location algorithm fails to converge in a reasonable number of iterations + + + + Inserts a new point into a subdivision representing a Delaunay + triangulation, and fixes the affected edges so that the result is still a + Delaunay triangulation. + + a quadedge containing the inserted vertex + + + + A simple split point finder which returns the midpoint of the split segment. This is a default + strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. + Other points which could be used are: +
    +
  • The projection of the encroaching point on the segment
  • +
  • A point on the segment which will produce two segments which will not be further encroached
  • +
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • + point +
+
+ Martin Davis +
+ + + Gets the midpoint of the split segment + + + + + A strategy for finding constraint split points which attempts to maximise the length of the split + segments while preventing further encroachment. (This is not always possible for narrow angles). + + Martin Davis + + + + A basic strategy for finding split points when nothing extra is known about the geometry of + the situation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a split point which is the projection of the encroaching point on the segment + + The segment + The enchroaching point + A split point on the segment + + + + A framework to visit sets of edge-connected s in breadth-first order + + Martin Davis + 1.0 + + + + Called to initialize the traversal queue with a given set of s + + a collection of QuadEdgeTriangle + + + + Subclasses call this method to perform the visiting process. + + + + + An interface for classes which locate an edge in a + which either contains a given V + or is an edge of a triangle which contains V. + Implementors may utilized different strategies for + optimizing locating containing edges/triangles. + + Martin Davis + + + + Interface for classes which process triangles visited during travesals of a + + + Martin Davis + + + + Visits a triangle during a traversal of a . An implementation of + this method may perform processing on the current triangle. It must also decide whether a + neighbouring triangle should be added to the queue so its neighbours are visited. Often it + will perform processing on the neighbour triangle as well, in order to mark it as processed + (visited) and/or to determine if it should be visited. Note that choosing not to + visit the neighbouring triangle is the terminating condition for many traversal algorithms. + In particular, if the neighbour triangle has already been visited, it should not be visited + again. + + the current triangle being processed + the index of the edge in the current triangle being traversed + a neighbouring triangle next in line to visit + true if the neighbour triangle should be visited + + + + An interface for algorithms which process the triangles in a . + + Martin Davis + 1.0 + + + + + Locates s in a , + optimizing the search by starting in the + locality of the last edge found. + + Martin Davis + + + + Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. + The search starts from the last located edge amd proceeds on the general direction of v. + + + + + A class that represents the edge data structure which implements the quadedge algebra. + The quadedge algebra was described in a well-known paper by Guibas and Stolfi, + "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", + ACM Transactions on Graphics, 4(2), 1985, 75-123. + + Each edge object is part of a quartet of 4 edges, + linked via their Rot references. + Any edge in the group may be accessed using a series of operations. + Quadedges in a subdivision are linked together via their Next references. + The linkage between the quadedge quartets determines the topology + of the subdivision. + + + The edge class does not contain separate information for vertice or faces; a vertex is implicitly + defined as a ring of edges (created using the Next field). + + + David Skea + Martin Davis + + + + Creates a new QuadEdge quartet from o to d. + + the origin Vertex + the destination Vertex + the new QuadEdge quartet + + + + Creates a new QuadEdge connecting the destination of a to the origin of + b, in such a way that all three have the same left face after the + connection is complete. Additionally, the data pointers of the new edge + are set. + + the connected edge + + + + Splices two edges together or apart. + Splice affects the two edge rings around the origins of a and b, and, independently, the two + edge rings around the left faces of a and b. + In each case, (i) if the two rings are distinct, + Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it + into two separate pieces. Thus, Splice can be used both to attach the two edges together, and + to break them apart. + + an edge to splice + an edge to splice + + + + Turns an edge counterclockwise inside its enclosing quadrilateral. + + the quadedge to turn + + + + Quadedges must be made using {@link makeEdge}, + to ensure proper construction. + + + + + Gets the primary edge of this quadedge and its sym. + The primary edge is the one for which the origin + and destination coordinates are ordered + according to the standard ordering + + the primary quadedge + + + + Marks this quadedge as being deleted. + This does not free the memory used by + this quadedge quartet, but indicates + that this edge no longer participates + in a subdivision. + + + + + Sets the connected edge + + edge + + + + Tests if this quadedge and another have the same line segment geometry, + regardless of orientation. + + a quadege + true if the quadedges are based on the same line segment regardless of orientation + + + + Tests if this quadedge and another have the same line segment geometry + with the same orientation. + + a quadege + true if the quadedges are based on the same line segment + + + + Creates a representing the + geometry of this edge. + + a LineSegment + + + + Converts this edge to a WKT two-point LINESTRING indicating + the geometry of this edge. + + a String representing this edge's geometry + + + + Gets or sets the external data value for this edge. + + + an object containing external data + + + + + Tests whether this edge has been deleted. + + true if this edge has not been deleted. + + + + Gets the dual of this edge, directed from its right to its left. + + Gets or Sets the rotated edge + + + + Gets the dual of this edge, directed from its left to its right. + + Gets the inverse rotated edge. + + + + Gets the edge from the destination to the origin of this edge. + + Gets the sym of the edge. + + + + Gets the next CCW edge around the origin of this edge. + + Gets the next linked edge. + + + + Gets the next CW edge around (from) the origin of this edge. + + Gets the previous edge. + + + + Gets the next CCW edge around (into) the destination of this edge. + + Get the next destination edge. + + + + Gets the next CW edge around (into) the destination of this edge. + + Get the previous destination edge. + + + + Gets the CCW edge around the left face following this edge. + + Gets the next left face edge. + + + + Gets the CCW edge around the left face before this edge. + + Get the previous left face edge. + + + + Gets the edge around the right face ccw following this edge. + + Gets the next right face edge. + + + + Gets the edge around the right face ccw before this edge. + + Gets the previous right face edge. + + + + Gets or sets the vertex for the edge's origin + + Gets the origin vertex + + + + Gets or sets the vertex for the edge's destination + + Gets the destination vertex + + + + Gets the length of the geometry of this quadedge. + + Gets the length of the quadedge + + + + A class that contains the s representing a planar + subdivision that models a triangulation. + The subdivision is constructed using the + quadedge algebra defined in the classs . + All metric calculations + are done in the class. + In addition to a triangulation, subdivisions + support extraction of Voronoi diagrams. + This is easily accomplished, since the Voronoi diagram is the dual + of the Delaunay triangulation. + + Subdivisions can be provided with a tolerance value. Inserted vertices which + are closer than this value to vertices already in the subdivision will be + ignored. Using a suitable tolerance value can prevent robustness failures + from happening during Delaunay triangulation. + + + Subdivisions maintain a frame triangle around the client-created + edges. The frame is used to provide a bounded "container" for all edges + within a TIN. Normally the frame edges, frame connecting edges, and frame + triangles are not included in client processing. + + + David Skea + Martin Davis + + + + Gets the edges for the triangle to the left of the given . + + + + if the edges do not form a triangle + + + + Creates a new instance of a quad-edge subdivision based on a frame triangle + that encloses a supplied bounding box. A new super-bounding box that + contains the triangle is computed and stored. + + the bouding box to surround + the tolerance value for determining if two sites are equal + + + + Gets the collection of base s (one for every pair of + vertices which is connected). + + a collection of QuadEdges + + + + Sets the to use for locating containing triangles + in this subdivision. + + a QuadEdgeLocator + + + + Creates a new quadedge, recording it in the edges list. + + The origin vertex + The destination vertex + A new quadedge + + + + Creates a new QuadEdge connecting the destination of a to the origin of b, + in such a way that all three have the same left face after the connection + is complete. The quadedge is recorded in the edges list. + + A quadedge + A quadedge + A quadedge + + + + Deletes a quadedge from the subdivision. Linked quadedges are updated to + reflect the deletion. + + the quadedge to delete + + + + Locates an edge of a triangle which contains a location + specified by a Vertex v. + The edge returned has the + property that either v is on e, or e is an edge of a triangle containing v. + The search starts from startEdge amd proceeds on the general direction of v. + + + This locate algorithm relies on the subdivision being Delaunay. For + non-Delaunay subdivisions, this may loop for ever. + + the location to search for + an edge of the subdivision to start searching at + a QuadEdge which contains v, or is on the edge of a triangle containing v + + if the location algorithm fails to converge in a reasonable + number of iterations + + + + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the vertex to locate + a quadedge on the edge of a triangle which touches or contains the location
+ or null if no such triangle exists +
+
+ + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the Coordinate to locate + a quadedge on the edge of a triangle which touches or contains the location, + or null if no such triangle exists + + + + + Locates the edge between the given vertices, if it exists in the + subdivision. + + a coordinate + another coordinate + the edge joining the coordinates, if present, + or null if no such edge exists + + + + + Inserts a new site into the Subdivision, connecting it to the vertices of + the containing triangle (or quadrilateral, if the split point falls on an + existing edge). + + + + This method does NOT maintain the Delaunay condition. If desired, this must + be checked and enforced by the caller. + + + This method does NOT check if the inserted vertex falls on an edge. This + must be checked by the caller, since this situation may cause erroneous + triangulation + + + the vertex to insert + a new quad edge terminating in v + + + + Tests whether a QuadEdge is an edge incident on a frame triangle vertex. + + the edge to test + true if the edge is connected to the frame triangle + + + + Tests whether a QuadEdge is an edge on the border of the frame facets and + the internal facets. E.g. an edge which does not itself touch a frame + vertex, but which touches an edge which does. + + the edge to test + true if the edge is on the border of the frame + + + + Tests whether a vertex is a vertex of the outer triangle. + + the vertex to test + true if the vertex is an outer triangle vertex + + + + Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a + tolerance determined by the subdivision tolerance. + + a QuadEdge + a point + true if the vertex lies on the edge + + + + Tests whether a is the start or end vertex of a + , up to the subdivision tolerance distance. + + + + true if the vertex is a endpoint of the edge + + + + Gets the unique es in the subdivision, + including the frame vertices if desired. + + true if the frame vertices should be included + a collection of the subdivision vertices + + + + + Gets a collection of s whose origin + vertices are a unique set which includes + all vertices in the subdivision. + The frame vertices can be included if required. + + + This is useful for algorithms which require traversing the + subdivision starting at all vertices. + Returning a quadedge for each vertex + is more efficient than + the alternative of finding the actual vertices + using and then locating + quadedges attached to them. + + true if the frame vertices should be included + a collection of QuadEdge with the vertices of the subdivision as their origins + + + + Gets all primary quadedges in the subdivision. + A primary edge is a + which occupies the 0'th position in its array of associated quadedges. + These provide the unique geometric edges of the triangulation. + + true if the frame edges are to be included + a List of QuadEdges + + + + The quadedges forming a single triangle. + Only one visitor is allowed to be active at a + time, so this is safe. + + + + + Stores the edges for a visited triangle. Also pushes sym (neighbour) edges + on stack to visit later. + + + + + + the visited triangle edges,
+ or null if the triangle should not be visited (for instance, if it is outer) +
+
+ + + Gets a list of the triangles + in the subdivision, specified as + an array of the primary quadedges around the triangle. + + true if the frame triangles should be included + a List of QuadEdge[3] arrays + + + + Gets a list of the triangles in the subdivision, + specified as an array of the triangle es. + + true if the frame triangles should be included + a List of Vertex[3] arrays + + + + Gets the coordinates for each triangle in the subdivision as an array. + + true if the frame triangles should be included + a list of Coordinate[4] representing each triangle + + + + Gets the geometry for the edges in the subdivision as a + containing 2-point lines. + + the GeometryFactory to use + a IMultiLineString + + + + Gets the geometry for the triangles in a triangulated subdivision as a + of triangular s. + + the GeometryFactory to use + a GeometryCollection of triangular Polygons + + + + Gets the cells in the Voronoi diagram for this triangulation. + The cells are returned as a of s + + + The userData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a GeometryCollection of Polygons + + + + Gets a List of s for the Voronoi cells + of this triangulation. + + + The UserData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a List of Polygons + + + + Gets the Voronoi cell around a site specified + by the origin of a QuadEdge. + + + The userData of the polygon is set to be the + of the site. This allows attaching external + data associated with the site to this cell polygon. + + a quadedge originating at the cell site + a factory for building the polygon + a polygon indicating the cell extent + + + + Gets the vertex-equality tolerance value + used in this subdivision + + Gets the tolerance value + + + + Gets the envelope of the Subdivision (including the frame). + + Gets the envelope + + + + A TriangleVisitor which computes and sets the + circumcentre as the origin of the dual + edges originating in each triangle. + + mbdavis + + + + Models a triangle formed from s in a + which forms a triangulation. The class provides methods to access the + topological and geometric properties of the triangle and its neighbours in + the triangulation. Triangle vertices are ordered in CCW orientation in the + structure. + + + QuadEdgeTriangles support having an external data attribute attached to them. + Alternatively, this class can be subclassed and attributes can + be defined in the subclass. Subclasses will need to define + their own BuilderVisitor class + and CreateOn method. + + Martin Davis + 1.0 + + + + Creates s for all facets of a + representing a triangulation. + The data attributes of the s in the subdivision + will be set to point to the triangle which contains that edge. + This allows tracing the neighbour triangles of any given triangle. + + The QuadEdgeSubdivision to create the triangles on. + A List of the created QuadEdgeTriangles + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 Vertexes + the point to test + true if the point is contained in the triangle + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 QuadEdges + the point to test + true if the point is contained in the triangle + + + + Creates a new triangle from the given edges. + + An array of the edges of the triangle in CCW order + + + + Gets the vertices for this triangle. + + a new array containing the triangle vertices + + + + Gets the index for the given edge of this triangle + + a QuadEdge + the index of the edge in this triangle,
+ or -1 if the edge is not an edge of this triangle +
+
+ + + Gets the index for the edge that starts at vertex v. + + the vertex to find the edge for + the index of the edge starting at the vertex,
+ or -1 if the vertex is not in the triangle +
+
+ + + Tests whether this triangle is adjacent to the outside of the subdivision. + + true if the triangle is adjacent to the subdivision exterior + + + + Gets the triangles which are adjacent (include) to a + given vertex of this triangle. + + The vertex to query + A list of the vertex-adjacent triangles + + + + Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is + null + + an array containing the 3 neighbours of this triangle + + + + Gets or sets the external data value for this triangle. + + + + + Gets all edges which are incident on the origin of the given edge. + + the edge to start at + a List of edges which have their origin at the origin of the given + edge + + + + Algorithms for computing values and predicates + associated with triangles. + + + For some algorithms extended-precision + implementations are provided, which are more robust + (i.e. they produce correct answers in more cases). + Also, some more robust formulations of + some algorithms are provided, which utilize + normalization to the origin. + + Martin Davis + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + However, by using normalization to the origin + it provides improved robustness and increased performance. + Based on code by J.R.Shewchuk. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the + triangle is oriented counterclockwise. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This method uses more robust computation. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness, but a faster approach. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + a vertex of the triangle + a vertex of the triangle + a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + + + + + + + + + + + Computes the inCircle test using distance from the circumcentre. + Uses standard double-precision arithmetic. + + + In general this doesn't + appear to be any more robust than the standard calculation. However, there + is at least one case where the test point is far enough from the + circumcircle that this test gives the correct answer. +
+            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
+            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
+            
+
+ A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + The area of a triangle defined by the points a, b and c +
+ + + Checks if the computed value for isInCircle is correct, using + double-double precision arithmetic. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + + + + + Creates a new instance for the given ordinates. + + + + + Creates a new instance for the given ordinates, with associated external data. + + + + + Creates a new instance for the given points, with associated external data. + + the start point + the end point + an external data object + + + + Creates a new instance for the given points. + + the start point + the end point + + + + Determines whether two segments are topologically equal. + I.e. equal up to orientation. + + a segment + true if the segments are topologically equal + + + + Computes the intersection point between this segment and another one. + + a segment + the intersection point, or null if there is none + + + + Computes a string representation of this segment. + + a string + + + + Gets the start coordinate of the segment + + a Coordinate + + + + Gets the end coordinate of the segment + + a Coordinate + + + + Gets the start X ordinate of the segment + + the X ordinate value + + + + Gets the start Y ordinate of the segment + + the Y ordinate value + + + + Gets the start Z ordinate of the segment + + the Z ordinate value + + + + Gets the end X ordinate of the segment + + the X ordinate value + + + + Gets the end Y ordinate of the segment + + he Y ordinate value + + + + Gets the end Z ordinate of the segment + + the Z ordinate value + + + + Gets a LineSegment modelling this segment. + + a LineSegment + + + + Gets or sets the external data associated with this segment + + a data object + + + + Models a constraint segment which can be split in two in various ways, + according to certain geometric constraints. + + Martin Davis + + + + Computes the {@link Coordinate} that lies a given fraction along the line defined by the + reverse of the given segment. A fraction of 0.0 returns the end point of the + segment; a fraction of 1.0 returns the start point of the segment. + + the LineSegment + the fraction of the segment length along the line + the point at that distance + + + + Creates a map between the vertex s of a + set of s, + and the parent geometry, and transfers the source geometry + data objects to geometry components tagged with the coordinates. + + + This class can be used in conjunction with + to transfer data objects from the input site geometries + to the constructed Voronoi polygons. + + Martin Davis + + + + + Input is assumed to be a multiGeometry + in which every component has its userData + set to be a Coordinate which is the key to the output data. + The Coordinate is used to determine + the output data object to be written back into the component. + + + + + + A utility class which creates Voronoi Diagrams + from collections of points. + The diagram is returned as a of s, + representing the faces of the Voronoi diagram. + /// The faces are clipped to the larger of: + + + an envelope supplied by . + + + an envelope determined by the input sites. + + + The userData attribute of each face Polygon is set to + the Coordinate of the corresponding input site. + This allows using a Map to link faces to data associated with sites. + + Martin Davis + + + + Sets the sites (point or vertices) which will be diagrammed. + All vertices of the given geometry will be used as sites. + + geom the geometry from which the sites will be extracted. + + + + Sets the sites (point or vertices) which will be diagrammed + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed diagram. + + the subdivision containing the triangulation + + + + Gets the faces of the computed diagram as a + of s, clipped as specified. + + The attribute of each face is set to + the Coordinate of the corresponding input site. + This allows using a to link faces to data associated with sites. + + the geometry factory to use to create the output + a containg the face s of the diagram + + + + Sets the envelope to clip the diagram to. + The diagram will be clipped to the larger + of this envelope or an envelope surrounding the sites. + + the clip envelope. + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + tolerance the tolerance distance to use + + + + An alternative implementation of the priority queue abstract data type. + This allows us to do more than , which we + got from JTS. Ultimately, this queue enables scenarios that have more + favorable execution speed characteristics at the cost of less favorable + memory and usability characteristics. + + + The type of the priority for each queue node. + + + The type of data stored in the queue. + + + When enumerating over the queue, note that the elements will not be in + sorted order. To get at the elements in sorted order, use the copy + constructor and repeatedly elements from it. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to + copy from. + + + is . + + + + + Removes all nodes from this queue. + + + + + Determines whether the given node is contained within this queue. + + + The node to locate in the queue. + + + if is found in the + queue, otherwise . + + + + + Adds a given node to the queue with the given priority. + + + The node to add to the queue. + + + The priority for the node. + + + is . + + + + + Removes and returns the head of the queue. + + + The removed element. + + + + + Changes the priority of the given node. + + + The node whose priority to change. + + + The new priority for the node. + + + is . + + + + + Removes the given node from this queue if it is present. + + + The node to remove if present. + + + A value indicating whether the node was removed. + + + + + + + + + + + Gets the number of nodes currently stored in this queue. + + + + + Gets the node at the head of the queue. + This is the node whose compares + less than or equal to the priority of all other nodes in the queue. + + + + + A container for a prioritized node that sites in an + . + + + The type to use for the priority of the node in the queue. + + + The type to use for the data stored by the node in the queue. + + + + + Initializes a new instance of the class. + + + The to store in this node. + + + + + Gets the that is stored in this node. + + + + + Gets the of this node in the queue. + + + The queue may update this priority while the node is still in the queue. + + + + + Gets or sets the index of this node in the queue. + + + This should only be read and written by the queue itself. + It has no "real" meaning to anyone else. + + + + + A utility for making programming assertions. + + + + + + + + + + + + + + + + + + + + + A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. + + + + + + + + + + + + + + + + + + + Static utility class for casting objects + + + + + Cast function from arbitrary-type to + + The output type + The sequence of items to cast. + as an enumerable of + Thrown if cast cannot be performed + + + + Cast function from sub-type to super-type + + The output (super/base) type + The input (sub/derived) type + The sequence of items to cast. + as an enumerable of + + + + Cast function from super-type to sub-type + + The input (sub/derived) type + The output (super/base) type + The sequence of items to cast. + as an enumerable of + + + + Executes a transformation function on each element of a collection + and returns the results in a new List. + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Copies s in an array to an object array + + + + the source array + An array of objects + + + + + + + + + + + + + + + + + + + + + A CoordinateFilter that creates an array containing every coordinate in a Geometry. + + + + + Constructs a CoordinateArrayFilter. + + The number of points that the CoordinateArrayFilter will collect. + + + + + + + + + + Returns the Coordinates collected by this CoordinateArrayFilter. + + + + + CoordinateCompare is used in the sorting of arrays of Coordinate objects. + Implements a lexicographic comparison. + + + + + Compares two object and returns a value indicating whether one is less than, equal to or greater + than the other. + + First Coordinate object to compare. + Second Coordinate object to compare. + + <table cellspacing="0" class="dtTABLE"> + <TR VALIGN="top"> + <TH width=50%>Value</TH> + <TH width=50%>Condition</TH> + </TR> + <TR VALIGN="top"> + <TD width=50%>Less than zero</TD> + <TD width=50%><I>a</I> is less than <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Zero</TD> + <TD width=50%><I>a</I> equals <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Greater than zero</TD> + <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> + </TR> + </table> + + If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b + implements IComparable, then b. CompareTo (a) is returned. + Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not + generate an exception when using IComparable. When sorting, a null reference (Nothing) is + considered to be less than any other object. + + + + + A CoordinateFilter that counts the total number of coordinates + in a Geometry. + + + + + + + + + + + Returns the result of the filtering. + + + + + Converts degrees to radians. + + + + + Converts degrees to radians. + + The angle in degrees. + The angle in radians. + + + + + + + + + Only static methods! + + + + + Convert the given numeric value (passed as string) of the base specified by baseIn + to the value specified by baseOut. + + Numeric value to be converted, as string. + Base of input value. + Base to use for conversion. + Converted value, as string. + + + + + + + + + + + + + + + + + + + + + + + + + Utility functions to report memory usage. + + mbdavis + + + + A priority queue over a set of objects. + + Objects to add + Martin Davis + + + Insert into the priority queue. Duplicates are allowed. + + The item to insert. + + + + Test if the priority queue is logically empty. + + true if empty, false otherwise. + + + + Make the priority queue logically empty. + + + + + Remove the smallest item from the priority queue. + + The smallest item, or default(T) if empty. + + + + Returns size. + + + + + Converts radians to degress. + + + + + Converts radians to degress. + + Angle in radians. + The angle in degrees. + + + + + + + + + + + + + + + + + Buffer for characters. This approximates StringBuilder + but is designed to be faster for specific operations. + This is about 30% faster for the operations I'm interested in + (Append, Clear, Length, ToString). + This trades off memory for speed. + + + To make Remove from the head fast, this is implemented + as a ring buffer. + This uses head and tail indices into a fixed-size + array. This will grow the array as necessary. + + + + + Default constructor. + + + + + Construct with a specific capacity. + + + + + + Reallocate the buffer to be larger. For the new size, this + uses the max of the requested length and double the current + capacity. + This does not shift, meaning it does not change the head or + tail indices. + + The new requested length. + + + + Ensure that we're set for the requested length by + potentially growing or shifting contents. + + + + + + Move the buffer contents such that headIndex becomes 0. + + + + + Overwrite this object's underlying buffer with the specified + buffer. + + The character array. + The number of characters to consider filled + in the input buffer. + + + + Append a character to this buffer. + + + + + + Append a string to this buffer. + + The string to append. + + + + Append a string to this buffer. + + The string to append. + + + + Remove a character at the specified index. + + The index of the character to remove. + + + + + Remove a specified number of characters at the specified index. + + The index of the characters to remove. + The number of characters to remove. + + + + Find the first instance of a character in the buffer, and + return its index. This returns -1 if the character is + not found. + + The character to find. + The index of the specified character, or -1 + for not found. + + + + Empty the buffer. + + + + + Return the current contents as a string. + + The new string. + + + + Gets/Sets the number of characters in the character buffer. + Increasing the length this way provides indeterminate results. + + + + + Returns the capacity of this character buffer. + + + + + Indexer. + + + + + Exception class for unterminated tokens. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated quotes. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated block comments. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Bitwise enumeration for character types. + + + + word characters (usually alpha, digits, and domain specific) + + + # or something for line comments + + + whitespace + + + ' or " type + + + usually 0 to 9 + + + usually 0 to 9, a-f and A-F + + + eof char + + + + This contains the settings that control the behavior of the tokenizer. + This is separated from the StreamTokenizer so that common settings + are easy to package and keep together. + + + + + Default constructor. + + + + + Copy constructor. + + + + + Sets this object to be the same as the specified object. + Note that some settings which are entirely embodied by the character + type table. + + + + + Setup default parse behavior. + This resets to same behavior as on construction. + + bool - true for success. + + + + Apply settings which are commonly used for code parsing + C-endCapStyle code, including C++, C#, and Java. + + + + + + Clear the character type settings. This leaves them unset, + as opposed to the default. Use SetDefaults() for default + settings. + + + + + Specify that a particular character is a word character. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + The character. + + + + Specify that a range of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + First character. + Last character. + + + + Specify that a string of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + + + + + Specify that a character is a whitespace character. + Character table type manipulation method. + This type is exclusive with other types. + + The character. + + + + Specify that a range of characters are whitespace characters. + Character table type manipulation method. + This adds the characteristic to the char(s), rather + than overwriting other characteristics. + + First character. + Last character. + + + + Remove other type settings from a range of characters. + Character table type manipulation method. + + + + + + + Remove other type settings from a character. + Character table type manipulation method. + + + + + + Specify that a particular character is a comment-starting character. + Character table type manipulation method. + + + + + + Specify that a particular character is a quote character. + Character table type manipulation method. + + + + + + Return a string representation of a character type setting. + Since the type setting is bitwise encoded, a character + can have more than one type. + + The character type byte. + The string representation of the type flags. + + + + Check whether the specified char type byte has a + particular type flag set. + + The char type byte. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + This is the character type table. Each byte is bitwise encoded + with the character attributes, such as whether that character is + word or whitespace. + + + + + Whether or not to return whitespace tokens. If not, they're ignored. + + + + + Whether or not to return EolTokens on end of line. Eol tokens will not + break up other tokens which can be multi-line. For example block comments + and quotes will not be broken by Eol tokens. Therefore the number of + Eol tokens does not give you the line count of a stream. + + + + + Whether or not to look for // comments + + + + + Whether or not to look for /* */ block comments. + + + + + Whether or not to return comments. + + + + + Whether or not to check for unterminated quotes and block comments. + If true, and one is encoutered, an exception is thrown of the appropriate type. + + + + + Whether or not digits are specified as Digit type in the + character table. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + This setting may become incorrect if you modify the character + types table directly. + + + + + Whether or not to parse Hex (0xABCD...) numbers. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + + + + + A StreamTokenizer similar to Java's. This breaks an input stream + (coming from a TextReader) into Tokens based on various settings. The settings + are stored in the TokenizerSettings property, which is a + StreamTokenizerSettings instance. + + + + This is configurable in that you can modify TokenizerSettings.CharTypes[] array + to specify which characters are which type, along with other settings + such as whether to look for comments or not. + + + WARNING: This is not internationalized. This treats all characters beyond + the 7-bit ASCII range (decimal 127) as Word characters. + + + There are two main ways to use this: 1) Parse the entire stream at + once and get an ArrayList of Tokens (see the Tokenize* methods), + and 2) call NextToken() successively. + This reads from a TextReader, which you can set directly, and this + also provides some convenient methods to parse files and strings. + This returns an Eof token if the end of the input is reached. + + + Here's an example of the NextToken() endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer(); + tokenizer.GrabWhitespace = true; + tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging + tokenizer.TextReader = File.OpenText(fileName); + Token token; + while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); + + + + Here's an example of the Tokenize... endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer("some string"); + ArrayList tokens = new ArrayList(); + if (!tokenizer.Tokenize(tokens)) + { + // error handling + } + foreach (Token t in tokens) Console.WriteLine("t = {0}", t); + + + + Comment delimiters are hardcoded (// and /*), not affected by char type table. + + + This sets line numbers in the tokens it produces. These numbers are normally + the line on which the token starts. + There is one known caveat, and that is that when GrabWhitespace setting + is true, and a whitespace token contains a newline, that token's line number + will be set to the following line rather than the line on which the token + started. + + + + + + This is the number of characters in the character table. + + + + + Default constructor. + + + + + Construct and set this object's TextReader to the one specified. + + The TextReader to read from. + + + + Construct and set a string to tokenize. + + The string to tokenize. + + + + Utility function, things common to constructors. + + + + + Clear the stream settings. + + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + The state. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + Exclude this state from the possible next state. + The state. + + + + Read the next character from the stream, or from backString + if we backed up. + + The next character. + + + + Get the next token. The last token will be an EofToken unless + there's an unterminated quote or unterminated block comment + and Settings.DoUntermCheck is true, in which case this throws + an exception of type StreamTokenizerUntermException or sub-class. + + The output token. + bool - true for success, false for failure. + + + + Starting from current stream location, scan forward + over an int. Determine whether it's an integer or not. If so, + push the integer characters to the specified CharBuffer. + If not, put them in backString (essentially leave the + stream as it was) and return false. + + If it was an int, the stream is left 1 character after the + end of the int, and that character is output in the thisChar parameter. + + The formats for integers are: 1, +1, and -1 + The + and - signs are included in the output buffer. + + The CharBuffer to append to. + Whether or not to consider + to be part + of an integer. + The last character read by this method. + true for parsed an int, false for not an int + + + + Parse the rest of the stream and put all the tokens + in the input ArrayList. This resets the line number to 1. + + The ArrayList to append to. + bool - true for success + + + + Parse all tokens from the specified TextReader, put + them into the input ArrayList. + + The TextReader to read from. + The ArrayList to append to. + bool - true for success, false for failure. + + + + Parse all tokens from the specified file, put + them into the input ArrayList. + + The file to read. + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Tokenize a file completely and return the tokens in a Token[]. + + The file to tokenize. + A Token[] with all tokens. + + + + Parse all tokens from the specified string, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Parse all tokens from the specified Stream, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + This is the TextReader that this object will read from. + Set this to set the input reader for the parse. + + + + + The settings which govern the behavior of the tokenization. + + + + + The states of the state machine. + + + + + Token class used by StreamTokenizer. + This represents a single token in the input stream. + This is subclassed to provide specific token types, + such as CharToken, FloatToken, etc. + + + + + The line number in the input stream where this token originated. + This is base-1. + + + + + A storage object for the data of this token. + + + + + Backer for UntermError. + + + + An error message associated with unterm error. + + + + Construct a Token with the specified line number. + + The line number where this + token comes from. + + + + Equals override. + + The object to compare to. + bool - true for equals, false otherwise. + + + + Equals overload. + + The string to compare to. + bool + + + + Equals overload. + + The char to compare to. + bool + + + + Operator== overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator!= overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator== overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator!= overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator== overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Operator!= overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Override. Returns the ToString().GetHashCode(). + + The hash code. + + + + Produce a string which includes the line number. + + + + + + Produce a string which includes the token type. + + + + + + Create an object of the specified type corresponding to + this token. + + The type of object to create. + The new object, or null for error. + + + + The line number where this token was found. This is base-1. + + + + + The Object stored by this token. This will be + a primitive C# type. + + + + + Whether or not there was an unterminated token problem + when creating this token. See UntermErrorMessage for + a message associated with the problem. + + + + + The error message if there was an unterminated token error + creating this token. + + + + + Return this token's value as a string. + + This token's value as a string. + + + + Represents end-of-lines (line separator characters). + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Represents end of file/stream. + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Abstract base class for string tokens. + + + + Default constructor. + + + Constructor with the specified value + and line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for words, meaning sequences of word + characters. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for Quotes such as "this is a quote". + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for comments, including line and block + comments. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for whitespace such as spaces and tabs. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for characters, meaning non-word characters. + + + + Constructor with the specified value + and line number. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for floating point numbers, stored internally as a Double. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value and line number. + + + + + Constructor with the specified value and line number. + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Token type for integer tokens. This handles both Int32 and Int64. + + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + Constructor with the specified value + and line number. + + + + Constructor for a 64 bit int + + + + + Parse a string known to be a hex string. This is faster + than Parse which doesn't assume the number is Hex. This will + throw an exception if the input number isn't hex. + + The hex number as a string. + The line where this token was found. + A new IntToken set to the value in the input string. + + + + Convert the input string to an integer, if possible + + The string to parse. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + This enumerates verbosity levels. + + + + For error messages. + + + For warn messages. + + + For info messages. + + + For debug messages. + + + + Framework replacement for string.IsNullOrWhitespace + + The string to test + A value indicating if is null, empty or only contains whitespace characters + + + + A CoordinateFilter that builds a set of Coordinates. + The set of coordinates contains no duplicate points. + + + + + Convenience method which allows running the filter over an array of s. + + an array of coordinates + an array of the unique coordinates + + + + + + + + + + Returns the gathered s. + + + + + An algorithm for computing a distance metric + which is an approximation to the Hausdorff Distance + based on a discretization of the input . + + + + The algorithm computes the Hausdorff distance restricted to discrete points + for one of the geometries. + The points can be either the vertices of the geometries (the default), + or the geometries with line segments densified by a given fraction. + Also determines two points of the Geometries which are separated by the computed distance. + + + This algorithm is an approximation to the standard Hausdorff distance. + Specifically, + + for all geometries a, b: DHD(a, b) <= HD(a, b) + + The approximation can be made as close as needed by densifying the input geometries. + In the limit, this value will approach the true Hausdorff distance: + + DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 + + The default approximation is exact or close enough for a large subset of useful cases. + + + Examples of these are: + + + computing distance between Linestrings that are roughly parallel to each other, + and roughly equal in length. This occurs in matching linear networks. + + Testing similarity of geometries. + + + + An example where the default approximation is not close is: + + A = LINESTRING (0 0, 100 0, 10 100, 10 100) + B = LINESTRING (0 100, 0 10, 80 10) + + DHD(A, B) = 22.360679774997898 + HD(A, B) ~= 47.8 + + + + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The Discrete Hausdorff Distance + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The densify fraction. A value of 0 indicates, that no densification should take place + The Discrete Hausdorff Distance + + + Value of 0.0 indicates that no densification should take place + + + + Gets/sets the fraction by which to densify each segment. + + + Each segment will be (virtually) split into a number of equal-length + subsegments, whose fraction of the total length is closest + to the given fraction. + + +
+
Index: packages/NetTopologySuite.1.14/lib/net35-client/PowerCollections.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net35-client/PowerCollections.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net35-client/PowerCollections.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net35-client/PowerCollections.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,11141 @@ + + + + PowerCollections + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Makes a deep clone of this Deque. A new Deque is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the Deque takes time O(N), where N is the number of items in the Deque. + The cloned Deque. + T is a reference type that does not implement ICloneable. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Serialize the hash table. Called from the serialization infrastructure. + + + + + Called on deserialization. We cannot deserialize now, because hash codes + might not be correct now. We do real deserialization in the OnDeserialization call. + + + + + Deserialize the hash table. Called from the serialization infrastructure when + the object graph has finished deserializing. + + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N log N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Makes a deep clone of this BigList. A new BigList is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then this method is the same as Clone. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + +
+
Index: packages/NetTopologySuite.1.14/lib/net40-client/NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net40-client/NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net40-client/NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net40-client/NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,34111 @@ + + + + NetTopologySuite + + + + + An interface for rules which determine whether node points + which are in boundaries of geometry components + are in the boundary of the parent geometry collection. + The SFS specifies a single kind of boundary node rule, + the rule. + However, other kinds of Boundary Node Rules are appropriate + in specific situations (for instance, linear network topology + usually follows the .) + Some JTS operations + (such as , and ) + allow the BoundaryNodeRule to be specified, + and respect the supplied rule when computing the results of the operation. + + An example use case for a non-SFS-standard Boundary Node Rule is + that of checking that a set of s have + valid linear network topology, when turn-arounds are represented + as closed rings. In this situation, the entry road to the + turn-around is only valid when it touches the turn-around ring + at the single (common) endpoint. This is equivalent + to requiring the set of LineStrings to be + simple under the . + The SFS-standard is not + sufficient to perform this test, since it + states that closed rings have no boundary points. + + This interface and its subclasses follow the Strategy design pattern. + + Martin Davis + + + + + + + + Tests whether a point that lies in boundaryCount + geometry component boundaries is considered to form part of the boundary + of the parent geometry. + + boundaryCount the number of component boundaries that this point occurs in + true if points in this number of boundaries lie in the parent boundary + + + + Provides access to static instances of common s. + + + + + The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). + + + + + The Endpoint Boundary Node Rule. + + + + The MultiValent Endpoint Boundary Node Rule. + + + + The Monovalent Endpoint Boundary Node Rule. + + + + + The Boundary Node Rule specified by the OGC Simple Features Specification, + which is the same as the Mod-2 rule. + + + + + + A specifies that points are in the + boundary of a lineal geometry iff + the point lies on the boundary of an odd number + of components. + Under this rule s and closed + s have an empty boundary. + + + This is the rule specified by the OGC SFS, + and is the default rule used in JTS. + + Martin Davis + + + + A which specifies that any points which are endpoints + of lineal components are in the boundary of the + parent geometry. + This corresponds to the "intuitive" topological definition + of boundary. + Under this rule s have a non-empty boundary + (the common endpoint of the underlying LineString). + + + This rule is useful when dealing with linear networks. + For example, it can be used to check + whether linear networks are correctly noded. + The usual network topology constraint is that linear segments may touch only at endpoints. + In the case of a segment touching a closed segment (ring) at one point, + the Mod2 rule cannot distinguish between the permitted case of touching at the + node point and the invalid case of touching at some other interior (non-node) point. + The EndPoint rule does distinguish between these cases, + so is more appropriate for use. + + Martin Davis + + + + A which determines that only + endpoints with valency greater than 1 are on the boundary. + This corresponds to the boundary of a + being all the "attached" endpoints, but not + the "unattached" ones. + + Martin Davis + + + + A which determines that only + endpoints with valency of exactly 1 are on the boundary. + This corresponds to the boundary of a + being all the "unattached" endpoints. + + Martin Davis + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + It is also a reasonable strategy for cases where the + endpoint of one segment lies on or almost on the interior of another one. + Taking the most central endpoint ensures that the computed intersection + point lies in the envelope of the segments. + Also, by always returning one of the input points, this should result + in reducing segment fragmentation. + Intended to be used as a last resort for + computing ill-conditioned intersection situations which + cause other methods to fail. + + + WARNING: in some cases this algorithm makes a poor choice of endpoint. + It has been replaced by a better heuristic in . + + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + + Creates an instance of this class using the provided input coordinates + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + Determines a point closest to the given point. + + + + + Gets the intersection point + + + + + Computes the centroid of a of any dimension. + If the geometry is nominally of higher dimension, + but has lower effective dimension + (i.e. contains only components + having zero length or area), + the centroid will be computed as for the equivalent lower-dimension geometry. + If the input geometry is empty, a + null Coordinate is returned. + +

Algorithm

+ + Dimension 2 - the centroid ic computed + as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + Holes and multipolygons are handled correctly. + See http://www.faqs.org/faqs/graphics/algorithms-faq/ + for further details of the basic approach. + Dimension 1 - Computes the average of the midpoints + of all line segments weighted by the segment length. + Zero-length lines are treated as points. + + Dimension 0 - Compute the average coordinate over all points. + Repeated points are all included in the average + + + If the input geometries are empty, a null Coordinate is returned. +
+ 1.7 +
+ + + Computes the centroid point of a geometry. + + The geometry to use + + The centroid point, or null if the geometry is empty + + + + + the point all triangles are based at + + + + + temporary variable to hold centroid of triangle + + + + + Partial area sum + + + + + partial centroid sum + + + + + Creates a new instance for computing the centroid of a geometry + + + + + Adds a to the centroid total. + + >The to add. + + + + Gets the computed centroid. + + The computed centroid, or null if the input is empty + + + + Computes three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3. + The area is positive if the triangle is oriented CCW, and negative if CW. + + + + + Adds the line segments defined by an array of coordinates + to the linear centroid accumulators. + + An array of s + + + + Adds a point to the point centroid accumulator. + + A + + + + Computes the centroid of an area point. + + + Algorithm: + + Based on the usual algorithm for calculating + the centroid as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + + The algorithm has been extended to handle holes and multi-polygons. + See + for further details of the basic approach. + + + The code has also be extended to handle degenerate (zero-area) polygons. + In this case, the centroid of the line segments in the polygon + will be returned. + + + + + + Adds the area defined by a Geometry to the centroid total. + If the point has no area it does not contribute to the centroid. + + The point to add. + + + + Adds the area defined by an array of + coordinates. The array must be a ring; + i.e. end with the same coordinate as it starts with. + + An array of Coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3, + positive if a,b,c are oriented ccw, and negative if cw. + + + + + Adds the linear segments defined by an array of coordinates + to the linear centroid accumulators. + This is done in case the polygon(s) have zero-area, + in which case the linear centroid is computed instead. + + an array of s + + + + + + + + + + + + + + Computes the centroid of a linear point. + Algorithm: + Compute the average of the midpoints + of all line segments weighted by the segment length. + + + + + Adds the linear components of by a Geometry to the centroid total. + If the geometry has no linear components it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by an array of coordinates. + + An array of Coordinates. + + + + + + + + + Computes the centroid of a point point. + Algorithm: + Compute the average of all points. + + + + + Adds the point(s) defined by a Geometry to the centroid total. + If the point is not of dimension 0 it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by a coordinate. + + A coordinate. + + + + + + + + Basic computational geometry algorithms + for geometry and coordinates defined in 3-dimensional Cartesian space. + + @author mdavis + + + + Computes the distance between two 3D segments. + + @param A the start point of the first segment + @param B the end point of the first segment + @param C the start point of the second segment + @param D the end point of the second segment + @return the distance between the segments + + + + Implements basic computational geometry algorithms using arithmetic. + + Martin Davis + + + + A value which is safely greater than the + relative round-off error in double-precision numbers + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + Computes the sign of the determinant of the 2x2 matrix + with the given entries. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is 0. + + + + + + A filter for computing the orientation index of three coordinates. + + If the orientation can be computed safely using standard DP + arithmetic, this routine returns the orientation index. + Otherwise, a value i > 1 is returned. + In this case the orientation index must + be computed using some other more robust method. + The filter is fast to compute, so can be used to + avoid the use of slower robust methods except when they are really needed, + thus providing better average performance. + + Uses an approach due to Jonathan Shewchuk, which is in the public domain. + + + + The orientation index if it can be computed safely + > 1 if the orientation index cannot be computed safely> + + + + + + Computes an intersection point between two lines + using DD arithmetic. + Currently does not handle case of parallel lines. + + A point of 1st segment + Another point of 1st segment + A point of 2nd segment + Another point of 2nd segment + + + + + Specifies and implements various fundamental Computational Geometric algorithms. + The algorithms supplied in this class are robust for double-precision floating point. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + Returns the index of the direction of the point q + relative to a vector specified by p1-p2. + + The origin point of the vector. + The final point of the vector. + The point to compute the direction to. + + 1 if q is counter-clockwise (left) from p1-p2, + -1 if q is clockwise (right) from p1-p2, + 0 if q is collinear with p1-p2. + + + + + Tests whether a point lies inside or on a ring. + + + The ring may be oriented in either direction. + A point lying exactly on the ring boundary is considered to be inside the ring. + This method does not first check the point against the envelope + of the ring. + + Point to check for ring inclusion. + An array of s representing the ring (which must have first point identical to last point) + true if p is inside ring. + + + + + Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. + + + The ring may be oriented in either direction. + This method does not first check the point against the envelope of the ring. + + Point to check for ring inclusion + An array of coordinates representing the ring (which must have first point identical to last point) + The of p relative to the ring + + + + Tests whether a point lies on the line segments defined by a + list of coordinates. + + + + true if the point is a vertex of the line + or lies in the interior of a line segment in the linestring + + + + + Computes whether a ring defined by an array of s is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + An array of s froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + A coordinate sequence froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + The first vertex of the line segment + The second vertex of the line segment + The point to compute the relative orientation of + + 1 if q is counter-clockwise from p1-p2, + or -1 if q is clockwise from p1-p2, + or 0 if q is collinear with p1-p2 + + + + + Computes the distance from a point p to a line segment AB. + Note: NON-ROBUST! + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The distance from p to line segment AB. + + + + Computes the perpendicular distance from a point p + to the (infinite) line containing the points AB + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The perpendicular distance from p to line AB. + + + + Computes the distance from a point to a sequence of line segments. + + A point + A sequence of contiguous line segments defined by their vertices + The minimum distance between the point and the line segments + If there are too few points to make up a line (at least one?) + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates of the ring + The signed area of the ring + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates forming the ring + The signed area of the ring + + + + Computes the length of a linestring specified by a sequence of points. + + The points specifying the linestring + The length of the linestring + + + + Computes the convex hull of a . + The convex hull is the smallest convex Geometry that contains all the + points in the input Geometry. + Uses the Graham Scan algorithm. + + + + + Create a new convex hull construction for the input Geometry. + + + + + + Create a new convex hull construction for the input array. + + + + + + + + + + + + + + Returns a Geometry that represents the convex hull of the input point. + The point will contain the minimal number of points needed to + represent the convex hull. In particular, no more than two consecutive + points will be collinear. + + + If the convex hull contains 3 or more points, a Polygon; + 2 points, a LineString; + 1 point, a Point; + 0 points, an empty GeometryCollection. + + + + + Uses a heuristic to reduce the number of points scanned to compute the hull. + The heuristic is to find a polygon guaranteed to + be in (or on) the hull, and eliminate all points inside it. + A quadrilateral defined by the extremal points + in the four orthogonal directions + can be used, but even more inclusive is + to use an octilateral defined by the points in the 8 cardinal directions. + Note that even if the method used to determine the polygon vertices + is not 100% robust, this does not affect the robustness of the convex hull. + + To satisfy the requirements of the Graham Scan algorithm, + the returned array has at least 3 entries. + + + The coordinates to reduce + The reduced array of coordinates + + + + Pre sorts the coordinates + + + + + + + + + + + + + + + + + + + + Whether the three coordinates are collinear + and c2 lies between c1 and c3 inclusive. + + + + + + + + + + + + + + + + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + A 2-vertex LineString if the vertices are collinear; + otherwise, a Polygon with unnecessary (collinear) vertices removed. + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + The coordinates with unnecessary (collinear) vertices removed. + + + + Compares s for their angle and distance + relative to an origin. + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + Computes the Euclidean distance (L2 metric) from a to a . + + + Also computes two points on the geometry which are separated by the distance found. + + + + + Contains a pair of points and the distance between them. + + + Provides methods to update with a new point pair with either maximum or minimum distance. + + + + + Initializes to null. + + + + + Initializes the points. + + 1st coordinate + 2nd coordinate + + + + Initializes the points, avoiding recomputing the distance. + + 1st coordinate + 2nd coordinate + the distance between and + + + + The distance between the paired coordinates + + + + + Returns an array containing the paired points + + + + + Represents a homogeneous coordinate in a 2-D coordinate space. + In NTS s are used as a clean way + of computing intersections between line segments. + + David Skea + + + + Computes the (approximate) intersection point between two line segments using homogeneous coordinates. + + + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + 1st Coordinate of 1st linesegment + 2nd Coordinate of 1st linesegment + 1st Coordinate of 2nd linesegment + 2nd Coordinate of 2nd linesegment + + + + Computes the (approximate) intersection point between two line segments + using homogeneous coordinates. + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a homogeneous coordinate which is the intersection of the lines s. + define by the homogenous coordinates represented by two + + A coordinate + A coordinate + + + + Direct access to x private field + + + + + Direct access to y private field + + + + + Direct access to w private field + + + + + + + + + + Computes a point in the interior of an areal geometry. + + +

Algorithm:

+ + Find a Y value which is close to the centre of + the geometry's vertical extent but is different + to any of it's Y ordinates. + Create a horizontal bisector line using the Y value + and the geometry's horizontal extent + Find the intersection between the geometry + and the horizontal bisector line. + The intersection is a collection of lines and points. + Pick the midpoint of the largest intersection geometry + +

KNOWN BUGS

+ + If a fixed precision model is used, + in some cases this method may return a point + which does not lie in the interior.
+
+ + + + + + + + + + + Creates a new interior point finder + for an areal geometry. + + An areal geometry + + + + Tests the interior vertices (if any) + defined by an areal Geometry for the best inside point. + If a component Geometry is not of dimension 2 it is not tested. + + The point to add. + + + + Finds an interior point of a Polygon. + + The geometry to analyze. + + + + If point is a collection, the widest sub-point; otherwise, + the point itself. + + + + + + + + + + + + Returns the centre point of the envelope. + + The envelope to analyze. + The centre of the envelope. + + + + Gets the computed interior point. + + + + + Finds a safe bisector Y ordinate + by projecting to the Y axis + and finding the Y-ordinate interval + which contains the centre of the Y extent. + The centre of this interval is returned as the bisector Y-ordinate. + + Martin Davis + + + + Computes a point in the interior of an linear point. + Algorithm: + Find an interior vertex which is closest to + the centroid of the linestring. + If there is no interior vertex, find the endpoint which is + closest to the centroid. + + + + + + + + + + + Tests the interior vertices (if any) + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + Tests the endpoint vertices + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + + + + + + + + + + + + Computes a point in the interior of an point point. + Algorithm: + Find a point which is closest to the centroid of the point. + + + + + + + + + + + Tests the point(s) defined by a Geometry for the best inside point. + If a Geometry is not of dimension 0 it is not tested. + + The point to add. + + + + + + + + + + + + + + + An interface for classes which determine the of points in a + + Martin Davis + + + + Determines the of a point in the . + + The point to test + the location of the point in the geometry + + + + A LineIntersector is an algorithm that can both test whether + two line segments intersect and compute the intersection point(s) + if they do. + + There are three possible outcomes when determining whether two line segments intersect: + + - the segments do not intersect + - the segments intersect in a single point + - the segments are collinear and they intersect in a line segment + + + + For segments which intersect in a single point, the point may be either an endpoint + or in the interior of each segment. + If the point lies in the interior of both segments, + this is termed a proper intersection. + The property test for this situation. + + The intersection point(s) may be computed in a precise or non-precise manner. + Computing an intersection point precisely involves rounding it + via a supplied . + + LineIntersectors do not perform an initial envelope intersection test + to determine if the segments are disjoint. + This is because this class is likely to be used in a context where + envelope overlap is already known to occur (or be likely). + + + + + These are deprecated, due to ambiguous naming + + + + Indicates that line segments do not intersect + + + + + Indicates that line segments intersect in a single point + + + + + Indicates that line segments intersect in a line segment + + + + + Computes the "edge distance" of an intersection point p along a segment. + The edge distance is a metric of the point along the edge. + The metric used is a robust and easy to compute metric function. + It is not equivalent to the usual Euclidean metric. + It relies on the fact that either the x or the y ordinates of the + points in the edge are unique, depending on whether the edge is longer in + the horizontal or vertical direction. + NOTE: This function may produce incorrect distances + for inputs where p is not precisely on p1-p2 + (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. + My hypothesis is that the function is safe to use for points which are the + result of rounding points which lie on the line, but not safe to use for truncated points. + + + + + This function is non-robust, since it may compute the square of large numbers. + Currently not sure how to improve this. + + + + + The indexes of the endpoints of the intersection lines, in order along + the corresponding line + + + + + If MakePrecise is true, computed intersection coordinates will be made precise + using Coordinate.MakePrecise. + + + + + Gets an endpoint of an input segment. + + the index of the input segment (0 or 1) + the index of the endpoint (0 or 1) + The specified endpoint + + + + Compute the intersection of a point p and the line p1-p2. + This function computes the bool value of the hasIntersection test. + The actual value of the intersection (if there is one) + is equal to the value of p. + + + + + Computes the intersection of the lines p1-p2 and p3-p4. + This function computes both the bool value of the hasIntersection test + and the (approximate) value of the intersection point itself (if there is one). + + + + + Returns the intIndex'th intersection point. + + is 0 or 1. + The intIndex'th intersection point. + + + + Test whether a point is a intersection point of two line segments. + Note that if the intersection is a line segment, this method only tests for + equality with the endpoints of the intersection segment. + It does not return true if the input point is internal to the intersection segment. + + true if the input point is one of the intersection points. + + + + Tests whether either intersection point is an interior point of one of the input segments. + + + true if either intersection point is in the interior of one of the input segment. + + + + + Tests whether either intersection point is an interior point of the specified input segment. + + + true if either intersection point is in the interior of the input segment. + + + + + Computes the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The intIndex'th intersection point in the direction of the specified input line segment. + + + + + Computes the index (order) of the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The index of the intersection point along the segment (0 or 1). + + + + + Computes the intersection line index + + The segment index + + + + Computes the "edge distance" of an intersection point along the specified input line segment. + + is 0 or 1. + is 0 or 1. + The edge distance of the intersection point. + + + + Alias the [0] for ease of reference + + + + + Alias the [1] for ease of reference + + + + + Force computed intersection to be rounded to a given precision model + + + + + Force computed intersection to be rounded to a given precision model. + No getter is provided, because the precision model is not required to be specified. + + + + + Tests whether the input geometries intersect. + + true if the input geometries intersect. + + + + Returns the number of intersection points found. This will be either 0, 1 or 2. + + The number of intersection points found (0, 1, or 2) + + + + Tests whether an intersection is proper. + The intersection between two line segments is considered proper if + they intersect in a single point in the interior of both segments + (e.g. the intersection is a single point and is not equal to any of the endpoints). + The intersection between a point and a line segment is considered proper + if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). + + true if the intersection is proper. + + + + Determines the location of s relative to + a geometry, using indexing for efficiency. + This algorithm is suitable for use in cases where + many points will be tested against a given area. + + Thread-safe and immutable. + + Martin Davis + + + + An interface for classes which determine the of + points in areal geometries. + + Martin Davis + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + Creates a new locator for a given . + + the Geometry to locate in + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + + A visitor for items in an index. + + + + + + + + + + + Static methods for classes + + + + + Convenience method to test a point for intersection with a geometry + + The geometry is wrapped in a class. + + The locator to use. + The coordinate to test. + true if the point is in the interior or boundary of the geometry. + + + Computes the location of points relative to an areal , using a simple O(n) algorithm. + This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. + + The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. + + + + Determines the of a point in an areal . Currently this will never return a value of . + + The point to test + The areal geometry to test + The Location of the point in the geometry + + + + Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. + + The point to test + A linear ring + true if the point lies inside the ring + + + + Measures the degree of similarity between two s + using the area of intersection between the geometries. + The measure is normalized to lie in the range [0, 1]. + Higher measures indicate a great degree of similarity. + + + NOTE: Currently experimental and incomplete. + + mbdavis + + + + An interface for classes which measures the degree of similarity between two {@link Geometry}s. + + + The computed measure lies in the range [0, 1]. + Higher measures indicate a great degree of similarity. + A measure of 1.0 indicates that the input geometries are identical + A measure of 0.0 indicates that the geometries have essentially no similarity. + The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. + + mbdavis + + + + Function to measure the similarity between two s. + + A geometry + A geometry + The similarity value between two s + + + + Measures the degree of similarity between two s using the Hausdorff distance metric. + + + + The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. + + + The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing + this by dividing it by the diagonal distance across the envelope of the combined geometries. + + + mbdavis + + + + + + + + + + + Provides methods to mathematically combine values. + + Martin Davis + + + + + + + + + + + + Implements IPointInRing + using a MonotoneChains and a BinTree index to increase performance. + + + + + + An interface for classes which test whether a Coordinate lies inside a ring. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The action for the internal iterator for performing + envelope select queries on a MonotoneChain. + + + + + These envelopes are used during the MonotoneChain search process. + + + + + + + + + + This method is overridden to process a segment + in the context of the parent chain. + + The parent chain + The index of the start vertex of the segment being processed + + + + This is a convenience method which can be overridden to obtain the actual + line segment which is selected. + + + + + + + + + + + + + + + + + + + Computes the Minimum Bounding Circle (MBC) for the points in a . + The MBC is the smallest circle which covers all the input points + (this is also sometimes known as the Smallest Enclosing Circle). + This is equivalent to computing the Maximum Diameter of the input point set. + + + + The computed circle can be specified in two equivalent ways, + both of which are provide as output by this class: + + As a centre point and a radius + By the set of points defining the circle. + + Depending on the number of points in the input + and their relative positions, this + will be specified by anywhere from 0 to 3 points. + + 0 or 1 points indicate an empty or trivial input point arrangment. + 2 or 3 points define a circle which contains + all the input points. + + + + + The class can also output a which approximates the + shape of the MBC (although as an approximation it is not + guaranteed to cover all the input points.) + + Martin Davis + + + The algorithm used is based on the one by Jon Rokne in + the article "An Easy Bounding Circle" in Graphic Gems II. + + + + Creates a new object for computing the minimum bounding circle for the + point set defined by the vertices of the given geometry. + + The geometry to use to obtain the point set + + + + Gets a geometry which represents the Minimum Bounding Circle. + + + + If the input is degenerate (empty or a single unique point), + this method will return an empty geometry or a single Point geometry. + Otherwise, a Polygon will be returned which approximates the + Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) + + + A Geometry representing the Minimum Bounding Circle. + + + + Gets a geometry representing a line between the two farthest points + in the input. + These points will be two of the extremal points of the Minimum Bounding Circle. + They also lie on the convex hull of the input. + + A LineString between the two farthest points of the input + An empty LineString if the input is empty + A Point if the input is a point + + + + Gets a geometry representing the diameter of the computed Minimum Bounding Circle. + + + + the diameter line of the Minimum Bounding Circle + an empty line if the input is empty + a Point if the input is a point + + + + + + Gets the extremal points which define the computed Minimum Bounding Circle. + + + There may be zero, one, two or three of these points, + depending on the number of points in the input + and the geometry of those points. + + The points defining the Minimum Bounding Circle + + + + Gets the centre point of the computed Minimum Bounding Circle. + + the centre point of the Minimum Bounding Circle, null if the input is empty + + + + Gets the radius of the computed Minimum Bounding Circle. + + The radius of the Minimum Bounding Circle + + + + Computes the minimum diameter of a . + + + + The minimum diameter is defined to be the + width of the smallest band that contains the point, + where a band is a strip of the plane defined + by two parallel lines. + This can be thought of as the smallest hole that the point can be + moved through, with a single rotation. + + + The first step in the algorithm is computing the convex hull of the Geometry. + If the input Geometry is known to be convex, a hint can be supplied to + avoid this computation. + + + This class can also be used to compute a line segment representing + the minimum diameter, the supporting line segment of the minimum diameter, + and a minimum rectangle enclosing the input geometry. + This rectangle will + have width equal to the minimum diameter, and have one side + parallel to the supporting segment. + + + + + + + Gets the minimum rectangle enclosing a geometry. + + The geometry + The minimum rectangle enclosing the geometry + + + + Gets the minimum diameter enclosing a geometry. + + The geometry + The length of the minimum diameter of the geometry + + + + Compute a minimum diameter for a given . + + a Geometry. + + + + Compute a minimum diameter for a giver Geometry, + with a hint if + the Geometry is convex + (e.g. a convex Polygon or LinearRing, + or a two-point LineString, or a Point). + + a Geometry which is convex. + true if the input point is convex. + + + + + + + + + + + + + + + Compute the width information for a ring of Coordinates. + Leaves the width information in the instance variables. + + + + + + + + + + + + + + + + + + + + + + + Gets the minimum rectangular which encloses the input geometry. + + + + The rectangle has width equal to the minimum diameter, and a longer length. + If the convex hull of the input is degenerate (a line or point) a or is returned. + + + The minimum rectangle can be used as an extremely generalized representation for the given geometry. + + + The minimum rectangle enclosing the input (or a line or point if degenerate) + + + + Gets the length of the minimum diameter of the input Geometry. + + The length of the minimum diameter. + + + + Gets the Coordinate forming one end of the minimum diameter. + + A coordinate forming one end of the minimum diameter. + + + + Gets the segment forming the base of the minimum diameter. + + The segment forming the base of the minimum diameter. + + + + Gets a LineString which is a minimum diameter. + + A LineString which is a minimum diameter. + + + + Non-robust versions of various fundamental Computational Geometric algorithms, + FOR TESTING PURPOSES ONLY!. + The non-robustness is due to rounding error in floating point computation. + + + + + + + + + + + + + Computes whether a ring defined by an array of Coordinate is + oriented counter-clockwise. + This will handle coordinate lists which contain repeated points. + + an array of coordinates forming a ring. + + true if the ring is oriented counter-clockwise. + throws ArgumentException if the ring is degenerate (does not contain 3 different points) + + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + 1 if q is counter-clockwise from p1-p2 + -1 if q is clockwise from p1-p2 + 0 if q is collinear with p1-p2 + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + the origin point of the vector + the final point of the vector + the point to compute the direction to + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + A non-robust version of LineIntersector. + + + + + + + + + + true if both numbers are positive or if both numbers are negative, + false if both numbers are zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RParameter computes the parameter for the point p + in the parameterized equation + of the line from p1 to p2. + This is equal to the 'distance' of p along p1-p2. + + + + + + + + + + + + + + + Computes the topological relationship () of a single point to a Geometry. + + + A may be specified to control the evaluation of whether the point lies on the boundary or not + The default rule is to use the the SFS Boundary Determination Rule + + Notes: + + s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. + + Instances of this class are not reentrant. + + + + + + Initializes a new instance of the class. + + + + + Convenience method to test a point for intersection with a Geometry + + The coordinate to test. + The Geometry to test. + true if the point is in the interior or boundary of the Geometry. + + + + Computes the topological relationship ({Location}) of a single point to a Geometry. + It handles both single-element and multi-element Geometries. + The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. + + The Location of the point relative to the input Geometry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the number of segments crossed by a horizontal ray extending to the right + from a given point, in an incremental fashion. + This can be used to determine whether a point lies in a geometry. + The class determines the situation where the point lies exactly on a segment. + When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. + + + This class handles polygonal geometries with any number of shells and holes. + The orientation of the shell and hole rings is unimportant. + In order to compute a correct location for a given polygonal geometry, + it is essential that all segments are counted which + + touch the ray + lie in in any ring which may contain the point + + + The only exception is when the point-on-segment situation is detected, in which + case no further processing is required. + The implication of the above rule is that segments which can be a priori determined to not touch the ray + (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. + + + Martin Davis + + + + Determines the of a point in a ring. + This method is an exemplar of how to use this class. + + The point to test + An array of Coordinates forming a ring + The location of the point in the ring + + + + Determines the of a point in a ring. + + The point to test + A coordinate sequence forming a ring + The location of the point in the ring + + + + Counts a segment + + An endpoint of the segment + Another endpoint of the segment + + + + Reports whether the point lies exactly on one of the supplied segments. + + This method may be called at any time as segments are processed. If the result of this method is true, + no further segments need be supplied, since the result will never change again. + + + + + + Gets the of the point relative to the ring, polygon + or multipolygon from which the processed segments were provided. + + This property only determines the correct location if all relevant segments have been processed + + + + Tests whether the point lies in or on the ring, polygon + + + This property only determines the correct location if all relevant segments have been processed + + + + Computes whether a rectangle intersects line segments. + + + Rectangles contain a large amount of inherent symmetry + (or to put it another way, although they contain four + coordinates they only actually contain 4 ordinates + worth of information). + The algorithm used takes advantage of the symmetry of + the geometric situation + to optimize performance by minimizing the number + of line intersection tests. + + Martin Davis + + + + Creates a new intersector for the given query rectangle, + specified as an . + + The query rectangle, specified as an Envelope + + + + Tests whether the query rectangle intersects a given line segment. + + The first endpoint of the segment + The second endpoint of the segment + true if the rectangle intersects the segment + + + + Implements an algorithm to compute the + sign of a 2x2 determinant for double precision values robustly. + It is a direct translation of code developed by Olivier Devillers. + + The original code carries the following copyright notice: + ************************************************************************ + Author : Olivier Devillers + Olivier.Devillers@sophia.inria.fr + http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html + + Olivier Devillers has allowed the code to be distributed under + the LGPL (2012-02-16) saying "It is ok for LGPL distribution." + + ************************************************************************* + ************************************************************************* + Copyright (c) 1995 by INRIA Prisme Project + BP 93 06902 Sophia Antipolis Cedex, France. + All rights reserved + ************************************************************************* + + + + + Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is null. + + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + A robust version of . + + + + + + + + + + + + + + + + + + + + + + + This method computes the actual value of the intersection point. + To obtain the maximum precision from the intersection calculation, + the coordinates are normalized by subtracting the minimum + ordinate values (in absolute value). This has the effect of + removing common significant digits from the calculation to + maintain more bits of precision. + + + + + + + + + + Computes a segment intersection using homogeneous coordinates. + Round-off error can cause the raw computation to fail, + (usually due to the segments being approximately parallel). + If this happens, a reasonable approximation is computed instead. + + + + + Normalize the supplied coordinates to + so that the midpoint of their intersection envelope + lies at the origin. + + + + + Tests whether a point lies in the envelopes of both input segments. + A correctly computed intersection point should return true + for this test. + Since this test is for debugging purposes only, no attempt is + made to optimize the envelope test. + + + true if the input point lies within both input segment envelopes. + + + + Finds the endpoint of the segments P and Q which + is closest to the other segment. + This is a reasonable surrogate for the true + intersection points in ill-conditioned cases + (e.g. where two segments are nearly coincident, + or where the endpoint of one segment lies almost on the other segment). + + + This replaces the older CentralEndpoint heuristic, + which chose the wrong endpoint in some cases + where the segments had very distinct slopes + and one endpoint lay almost on the other segment. + + an endpoint of segment P + an endpoint of segment P + an endpoint of segment Q + an endpoint of segment Q + the nearest endpoint to the other segment + + + + Tests whether a Coordinate lies inside + a ring, using a linear-time algorithm. + + + + + + + + + + + + + + + + + + + + + + + Implements PointInRing using a SIRtree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all ICRSObject implementing types + + + + + Base Interface for CRSBase Object types. + + + + + Gets the CRS type. + + + + + Gets the type of the CRSBase object. + + + + + Gets the properties. + + + + + Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. + + + + + Defines the Named CRS type. + + + + + Defines the Linked CRS type. + + + + + Defines the Linked CRS type. + + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Defines the Named CRS type. + + + + + Initializes a new instance of the class. + + + The mandatory name + member must be a string identifying a coordinate reference system. OGC CRS URNs such as + 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. + + + + + A graph containing s. + + + + + A graph comprised of s. + It supports tracking the vertices in the graph + via edges incident on them, + to allow efficient lookup of edges and vertices. + + + This class may be subclassed to use a + different subclass of HalfEdge, + by overriding . + If additional logic is required to initialize + edges then + can be overridden as well. + + + + + Creates a single HalfEdge. + Override to use a different HalfEdge subclass. + + the origin location + a new with the given origin + + + + Adds an edge between the coordinates orig and dest + to this graph. + + + Only valid edges can be added (in particular, zero-length segments cannot be added) + + the edge origin location + the edge destination location + The created edge + null if the edge was invalid and not added + + + + + Test if an the coordinates for an edge form a valid edge (with non-zero length) + + The start coordinate + The end coordinate + true of the edge formed is valid + + + + Inserts an edge not already present into the graph. + + the edge origin location + the edge destination location + an existing edge with same orig (if any) + the created edge + + + + Finds an edge in this graph with the given origin + and destination, if one exists. + + the origin location + the destination location + an edge with the given orig and dest, or null if none exists + + + + A HalfEdge which carries information + required to support . + + + + + A which supports + marking edges with a boolean flag. + Useful for algorithms which perform graph traversals. + + + + + Represents a directed component of an edge in an . + HalfEdges link vertices whose locations are defined by s. + HalfEdges start at an origin vertex, + and terminate at a destination vertex. + HalfEdges always occur in symmetric pairs, with the method + giving access to the oppositely-oriented component. + HalfEdges and the methods on them form an edge algebra, + which can be used to traverse and query the topology + of the graph formed by the edges. + + + By design HalfEdges carry minimal information + about the actual usage of the graph they represent. + They can be subclassed to carry more information if required. + + + HalfEdges form a complete and consistent data structure by themselves, + but an is useful to allow retrieving edges + by vertex and edge location, as well as ensuring + edges are created and linked appropriately. + + + + + Creates a HalfEdge pair representing an edge + between two vertices located at coordinates p0 and p1. + + a vertex coordinate + a vertex coordinate + the HalfEdge with origin at p0 + + + + Initialize a symmetric pair of HalfEdges. + Intended for use by subclasses. + The edges are initialized to have each other + as the edge, and to have pointers + which point to edge other. + This effectively creates a graph containing a single edge. + + a HalfEdge + a symmetric HalfEdge + the initialized edge e0 + + + + Creates an edge originating from a given coordinate. + + the origin coordinate + + + + Finds the edge starting at the origin of this edge + with the given dest vertex, if any. + + the dest vertex to search for + + the edge with the required dest vertex, + if it exists, or null + + + + + Tests whether this edge has the given orig and dest vertices. + + the origin vertex to test + the destination vertex to test + true if the vertices are equal to the ones of this edge + + + + Inserts an edge + into the ring of edges around the origin vertex of this edge. + The inserted edge must have the same origin as this edge. + + the edge to insert + + + + Insert an edge with the same origin after this one. + Assumes that the inserted edge is in the correct + position around the ring. + + the edge to insert (with same origin) + + + + Compares edges which originate at the same vertex + based on the angle they make at their origin vertex with the positive X-axis. + This allows sorting edges around their origin vertex in CCW order. + + + + + Implements the total order relation. + The angle of edge a is greater than the angle of edge b, + where the angle of an edge is the angle made by + the first segment of the edge with the positive x-axis. + When applied to a list of edges originating at the same point, + this produces a CCW ordering of the edges around the point. + Using the obvious algorithm of computing the angle is not robust, + since the angle calculation is susceptible to roundoff error. + + + A robust algorithm is: + 1. compare the quadrants the edge vectors lie in. + If the quadrants are different, + it is trivial to determine which edge has a greater angle. + 2. If the vectors lie in the same quadrant, the + function + can be used to determine the relative orientation of the vectors. + + + + + Computes a string representation of a HalfEdge. + + + + + Computes the degree of the origin vertex. + The degree is the number of edges + originating from the vertex. + + the degree of the origin vertex + + + + Finds the first node previous to this edge, if any. + If no such node exists (i.e the edge is part of a ring) + then null is returned. + + + an edge originating at the node prior to this edge, if any, + or null if no node exists + + + + + Gets the origin coordinate of this edge. + + + + + Gets the destination coordinate of this edge. + + + + + Gets the symmetric pair edge of this edge. + + + + + Gets the next edge CCW around the + destination vertex of this edge. + If the vertex has degree 1 then this is the sym edge. + + + + + Returns the edge previous to this one + (with dest being the same as this orig). + + + + + The X component of the distance between the orig and dest vertices. + + + + + The Y component of the distance between the orig and dest vertices. + + + + + Sets the mark for the given edge pair to a boolean value. + + an edge of the pair to update + the mark value to set + + + + Marks the edges in a pair. + + an edge of the pair to mark + + + + Creates a new marked edge. + + the coordinate of the edge origin + + + + Marks this edge. + + + + + Sets this edge to be the start segment of an input LineString. + + + + + Tests whether this edge is the starting segment + in a LineString being dissolved. + + true if this edge is a start segment + + + + Dissolves the linear components + from a collection of s. + into a set of maximal-length s + in which every unique segment appears once only. + The output linestrings run between node vertices + of the input, which are vertices which have + either degree 1, or degree 3 or greater. + + + Use cases for dissolving linear components + include generalization + (in particular, simplifying polygonal coverages), + and visualization + (in particular, avoiding symbology conflicts when + depicting shared polygon boundaries). + + + This class does NOT node the input lines. + If there are line segments crossing in the input, + they will still cross in the output. + + + + + Dissolves the linear components in a geometry. + + the geometry to dissolve + the dissolved lines + + + + Adds a to be dissolved. + Any number of geometries may be adde by calling this method multiple times. + Any type of Geometry may be added. The constituent linework will be + extracted to be dissolved. + + geometry to be line-merged + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + the geometries to be line-merged + + + + Gets the dissolved result as a . + + the dissolved lines + + + + For each edge in stack + (which must originate at a node) + extracts the line it initiates. + + + + + Updates the tracked ringStartEdge + if the given edge has a lower origin + (using the standard ordering). + + + Identifying the lowest starting node meets two goals: + * It ensures that isolated input rings are created using the original node and orientation. + * For isolated rings formed from multiple input linestrings, + it provides a canonical node and orientation for the output + (rather than essentially random, and thus hard to test). + + + + + + Builds a line starting from the given edge. + The start edge origin is a node (valence = 1 or >= 3), + unless it is part of a pure ring. + + + A pure ring has no other incident lines. + In this case the start edge may occur anywhere on the ring. + + + The line is built up to the next node encountered, + or until the start edge is re-encountered + (which happens if the edges form a ring). + + + + + + Adds edges around this node to the stack. + + + + + + Builds an edge graph from geometries containing edges. + + + + + Adds the edges of a Geometry to the graph. + May be called multiple times. + Any dimension of Geometry may be added; the constituent edges are extracted. + + geometry to be added + + + + Adds the edges in a collection of s to the graph. + May be called multiple times. + Any dimension of may be added. + + the geometries to be added + + + + Represents a feature collection. + + + + + Initializes a new instance of the class. + + The features. + + + + Initializes a new instance of the class. + + + + + Adds the specified feature. + + The feature. + + + + Removes the specified feature. + + The feature. + true if item is successfully removed; otherwise, false. This method also returns + false if item was not found in the collection. + + + + Removes the element at the specified index of the collection. + + The index. + + + + Gets the features. + + The features. + + + + Gets the (mandatory) type of the GeoJSON Object. + + + The type of the object. + + + + + Gets or sets the (optional) Coordinate Reference System Object. + + + The Coordinate Reference System Objects. + + + + + Returns the indexTh element in the collection. + + + + + + Returns the number of features contained by this . + + + + + A representation of a planar, linear vector geometry. + + + +

Binary Predicates:

+ Because it is not clear at this time what semantics for spatial + analysis methods involving GeometryCollections would be useful, + GeometryCollections are not supported as arguments to binary + predicates or the Relate method. +
+ +

Overlay Methods:

+ The spatial analysis methods will + return the most specific class possible to represent the result. If the + result is homogeneous, a Point, LineString, or + Polygon will be returned if the result contains a single + element; otherwise, a MultiPoint, MultiLineString, + or MultiPolygon will be returned. If the result is + heterogeneous a GeometryCollection will be returned. +
+ + Representation of Computed Geometries: + The SFS states that the result + of a set-theoretic method is the "point-set" result of the usual + set-theoretic definition of the operation (SFS 3.2.21.1). However, there are + sometimes many ways of representing a point set as a Geometry. + The SFS does not specify an unambiguous representation of a given point set + returned from a spatial analysis method. One goal of NTS is to make this + specification precise and unambiguous. NTS uses a canonical form for + Geometrys returned from overlay methods. The canonical + form is a Geometry which is simple and noded: + Simple means that the Geometry returned will be simple according to + the NTS definition of IsSimple. + Noded applies only to overlays involving LineStrings. It + means that all intersection points on LineStrings will be + present as endpoints of LineStrings in the result. + This definition implies that non-simple geometries which are arguments to + spatial analysis methods must be subjected to a line-dissolve process to + ensure that the results are simple. + + + Constructed Points And The Precision Model: + The results computed by the set-theoretic methods may + contain constructed points which are not present in the input Geometrys. + These new points arise from intersections between line segments in the + edges of the input Geometrys. In the general case it is not + possible to represent constructed points exactly. This is due to the fact + that the coordinates of an intersection point may contain twice as many bits + of precision as the coordinates of the input line segments. In order to + represent these constructed points explicitly, NTS must truncate them to fit + the PrecisionModel. + Unfortunately, truncating coordinates moves them slightly. Line segments + which would not be coincident in the exact result may become coincident in + the truncated representation. This in turn leads to "topology collapses" -- + situations where a computed element has a lower dimension than it would in + the exact result. + When NTS detects topology collapses during the computation of spatial + analysis methods, it will throw an exception. If possible the exception will + report the location of the collapse. + + + +

Geometry Equality

+ There are two ways of comparing geometries for equality: + structural equality and topological equality. +

Structural Equality

+ Structural Equality is provided by the + method. + This implements a comparison based on exact, structural pointwise + equality. + The is a synonym for this method, + to provide structural equality semantics for + use in collections. + It is important to note that structural pointwise equality + is easily affected by things like + ring order and component order. In many situations + it will be desirable to normalize geometries before + comparing them (using the + or methods). + is provided + as a convenience method to compute equality over + normalized geometries, but it is expensive to use. + Finally, + allows using a tolerance value for point comparison. + +

Topological Equality

+ Topological Equality is provided by the + method. + It implements the SFS definition of point-set equality + defined in terms of the DE-9IM matrix. + To support the SFS naming convention, the method + is also provided as a synonym. + However, due to the potential for confusion with + its use is discouraged. + + Since and are overridden, + Geometries can be used effectively in .Net collections. + +
+
+ + + + + + + An object reference which can be used to carry ancillary data defined + by the client. + + + + The bounding box of this Geometry. + + + + + Creates a new Geometry via the specified GeometryFactory. + + The factory + + + + Returns true if the array contains any non-empty Geometrys. + + an array of Geometrys; no elements may be null + + true if any of the Geometrys + IsEmpty methods return false. + + + + + Returns true if the array contains any null elements. + + an array to validate. + true if any of arrays elements are null. + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + Returns an element Geometry from a GeometryCollection, + or this, if the geometry is not a collection. + + The index of the geometry element. + The n'th geometry contained in this geometry. + + + + Returns the minimum distance between this Geometry + and another Geometry g. + + The Geometry from which to compute the distance. + The distance between the geometries + 0 if either input geometry is empty + if g is null + + + + Tests whether the distance from this Geometry + to another is less than or equal to a specified value. + + the Geometry to check the distance to. + the distance value to compare. + true if the geometries are less than distance apart. + + + + Notifies this geometry that its coordinates have been changed by an external + party (for example, via a ). + + + When this method is called the geometry will flush + and/or update any derived information it has cached (such as its ). + The operation is applied to all component Geometries. + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When GeometryChanged is called, this method will be called for + this Geometry and its component Geometries. + + + + + Tests whether this geometry is disjoint from the argument geometry. + + + The Disjoint predicate has the following equivalent definitions: + + The DE-9IM intersection matrix for the two geometries matches FF*FF****. + !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
+
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys are disjoint. + +
+ + + Tests whether this geometry touches the argument geometry + + + The Touches predicate has the following equivalent definitions: + + The geometries have at least one point in common, + but their interiors do not intersect + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns + + FT*******, + F**T***** or + F***T****. + + + If both geometries have dimension 0, the predicate returns false, + since points have only interiors. + This predicate is symmetric. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys touch; + Returns false if both Geometrys are points. + + + + + Tests whether this geometry intersects the argument geometry. + + + The Intersects predicate has the following equivalent definitions: + + The two geometries have at least one point in common + The DE-9IM Intersection Matrix for the two geometries matches
+ [T********] or
+ [*T*******] or
+ [***T*****] or
+ [****T****]
+ !g.disjoint(this)
+ (Intersects is the inverse of Disjoint)
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys intersect. + +
+ + + Tests whether this geometry crosses the specified geometry. + + + The Crosses predicate has the following equivalent definitions: + + The geometries have some but not all interior points in common. + The DE-9IM Intersection Matrix for the two geometries matches + one of the following patterns: + + CodeDescription + [T*T******]for P/L, P/A, and L/A situations + [T*****T**]for L/P, A/P, and A/L situations) + [0********]for L/L situations + + + + For any other combination of dimensions this predicate returns false. + + The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. + In order to make the relation symmetric, + NTS extends the definition to apply to L/P, A/P and A/L situations as well. + + + The Geometry with which to compare this Geometry + true if the two Geometrys cross. + + + + Tests whether this geometry is within the specified geometry. + + + The within predicate has the following equivalent definitions: + + + Every point of this geometry is a point of the other geometry, + and the interiors of the two geometries have at least one point in common. + + The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] + g.contains(this) == true
(Within is the converse of )
+
+ + An implication of the definition is that "The boundary of a geometry is not within the Polygon". + In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false + (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) + For a predicate with similar behaviour but avoiding + this subtle limitation, see . + +
+ The Geometry with which to compare this Geometry. + true if this Geometry is within other. + + +
+ + + + Tests whether this geometry overlaps the specified geometry. + + + The Overlaps predicate has the following equivalent definitions: + + The geometries have at least one point each not shared by the other (or equivalently neither covers the other), + they have the same dimension, + and the intersection of the interiors of the two geometries has + the same dimension as the geometries themselves. + The DE-9IM Intersection Matrix for the two geometries matches + [T*T***T**] (for two points or two surfaces) + or [1*T***T**] (for two curves) + + If the geometries are of different dimension this predicate returns false. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys overlap. + For this function to return true, the Geometry + s must be two points, two curves or two surfaces. + + + + + Tests whether this geometry covers the argument geometry + + + The covers predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry. + The DE-9IM Intersection Matrix for the two geometries matches at least + one of the following patterns: + + [T*****FF*] or
+ [*T****FF*] or
+ [***T**FF*] or
+ [****T*FF*] +
+
+ g.CoveredBy(this) == true
+ (covers is the converse of )
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + In particular, unlike Contains it does not distinguish between + points in the boundary and in the interior of geometries. + For most situations, Covers should be used in preference to Contains. + As an added benefit, Covers is more amenable to optimization, + and hence should be more performant. + +
+ The Geometry with which to compare this Geometry + true if this Geometry covers + + +
+ + Tests whether this geometry is covered by the specified geometry. + + The CoveredBy predicate has the following equivalent definitions: + + Every point of this geometry is a point of the other geometry. + + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns: + + [T*F**F***] + [*TF**F***] + [**FT*F***] + [**F*TF***] + g.Covers(this) == true
+ (CoveredBy is the converse of ) +
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + +
+ the Geometry with which to compare this Geometry + true if this Geometry is covered by g + + +
+ + + Tests whether the elements in the DE-9IM + for the two Geometrys match the elements in intersectionPattern. + + + The pattern is a 9-character string, with symbols drawn from the following set: + + 0 (dimension 0) + 1 (dimension 1) + 2 (dimension 2) + T ( matches 0, 1 or 2) + F ( matches FALSE) + * ( matches any value) + For more information on the DE-9IM, see the OpenGIS Simple Features + Specification. + + the Geometry with which to compare this Geometry + the pattern against which to check the + intersection matrix for the two Geometrys + true if the DE-9IM intersection + matrix for the two Geometrys match intersectionPattern + + + + + Returns the DE-9IM intersection matrix for the two Geometrys. + + The Geometry with which to compare this Geometry + + A matrix describing the intersections of the interiors, + boundaries and exteriors of the two Geometrys. + + + + + Tests whether this geometry is + topologically equal to the argument geometry. + + This method is included for backward compatibility reasons. + It has been superseded by the method, + which has been named to clearly denote its functionality. + + This method should NOT be confused with the method + , which implements + an exact equality comparison. + + The Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal. + + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS Equals predicate. + + + The SFS equals predicate has the following equivalent definitions: + + The two geometries have at least one point in common, + and no point of either geometry lies in the exterior of the other geometry. + The DE-9IM Intersection Matrix for the two geometries matches + the pattern T*F**FFF* +
+            T*F
+            **F
+            FF*
+            
+
+ Note that this method computes topologically equality. + For structural equality, see {@link #equalsExact(Geometry)}. +
+ the Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal +
+ + + Tests whether this geometry is structurally and numerically equal + to a given Object. + + + If the argument Object is not a Geometry, + the result is false. + Otherwise, the result is computed using + . + + This method is provided to fulfill the Java contract + for value-based object equality. + In conjunction with + it provides semantics which are most useful + for using + Geometrys as keys and values in Java collections. + + Note that to produce the expected result the input geometries + should be in normal form. It is the caller's + responsibility to perform this where required + (using + or as appropriate). + + The object to compare + true if this geometry is exactly equal to the argument + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets a hash code for the Geometry. + + + An integer value suitable for use as a hashcode + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + + + + + + + Returns the Well-known Binary representation of this Geometry. + For a definition of the Well-known Binary format, see the OpenGIS Simple + Features Specification. + + The Well-known Binary representation of this Geometry. + + + + + + + + + + Returns the feature representation as GML 2.1.1 XML document. + This XML document is based on Geometry.xsd schema. + NO features or XLink are implemented here! + + + + + Computes a buffer area around this geometry having the given width. The + buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The buffer geometry is constructed using 8 segments per quadrant to approximate + the circular arcs. + The end cap style is BufferStyle.CapRound. + + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified accuracy of approximation for circular arcs. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + + + + Returns the smallest convex Polygon that contains all the + points in the Geometry. This obviously applies only to Geometry + s which contain 3 or more points. + + the minimum-area convex polygon containing this Geometry's points. + + + + Computes a new geometry which has all component coordinate sequences + in reverse order (opposite orientation) to this one. + + A reversed geometry + + + + Computes a Geometry representing the point-set which is + common to both this Geometry and the other Geometry. + + The intersection of two geometries of different dimension produces a result + geometry of dimension less than or equal to the minimum dimension of the input + geometries. + The result geometry may be a heterogenous . + If the result is empty, it is an atomic geometry + with the dimension of the lowest input dimension. + + Intersection of s is supported + only for homogeneous collection types. + + Non-empty heterogeneous arguments are not supported. + + The Geometry with which to compute the intersection. + A geometry representing the point-set common to the two Geometrys. + if a robustness error occurs. + if the argument is a non-empty heterogenous GeometryCollection + + + + Computes a Geometry representing the point-set + which is contained in both this + Geometry and the other Geometry. + + + The method may be used on arguments of different dimension, but it does not + support arguments. + + The union of two geometries of different dimension produces a result + geometry of dimension equal to the maximum dimension of the input + geometries. + The result geometry may be a heterogenous + . + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Unioning s has the effect of + noding and dissolving the input linework. In this context + "noding" means that there will be a node or endpoint in the result for + every endpoint or line segment crossing in the input. "Dissolving" means + that any duplicate (i.e. coincident) line segments or portions of line + segments will be reduced to a single line segment in the result. + If merged linework is required, the + class can be used. + + Non-empty arguments are not supported. + the Geometry with which to compute the union + A point-set combining the points of this Geometry and the + points of other + Thrown if a robustness error occurs + Thrown if either input is a non-empty GeometryCollection + + + + + Computes a Geometry representing the closure of the point-set + of the points contained in this Geometry that are not contained in + the other Geometry. + + If the result is empty, it is an atomic geometry + with the dimension of the left-hand input. + + Non-empty arguments are not supported. + + The Geometry with which to compute the difference. + A Geometry representing the point-set difference of this Geometry with other. + + + + Computes a Geometry representing the closure of the point-set + which is the union of the points in this Geometry which are not + contained in the other Geometry, + with the points in the other Geometry not contained in this + Geometry. + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Non-empty arguments are not supported. + + The Geometry with which to compute the symmetric difference. + a Geometry representing the point-set symmetric difference of this Geometry with other. + + + + Computes the union of all the elements of this geometry. + + + This method supports s (which the other overlay operations currently do not). + + The result obeys the following contract: + + Unioning a set of s has the effect of fully noding and dissolving the linework. + Unioning a set of s always returns a geometry + (unlike ), which may return geometries of lower dimension if a topology + collapse occurred). + + + Thrown if a robustness error occurs + + + + Returns true if the two Geometrys are exactly equal, + up to a specified tolerance. + Two Geometries are exactly within a tolerance equal if: + + they have the same class, + they have the same values of Coordinates, + within the given tolerance distance, in their internal + Coordinate lists, in exactly the same order. + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry + have identical structure and point values, up to the distance tolerance. + Distance at or below which two Coordinates will be considered equal. + + true if this and the other Geometry + are of the same class and have equal internal data. + + + + + + + + Returns true if the two Geometrys are exactly equal. + Two Geometries are exactly equal if: + + they have the same class, + they have the same values of Coordinates in their internal + Coordinate lists, in exactly the same order. + + This provides a stricter test of equality than + , which is more useful + in certain situations + (such as using geometries as keys in collections). + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry. + + true if this and the other Geometry have identical structure and point values. + + + + + Tests whether two geometries are exactly equal + in their normalized forms. + + This is a convenience method which creates normalized + versions of both geometries before computing + . + This method is relatively expensive to compute. + For maximum performance, the client + should instead perform normalization on the individual geometries + at an appropriate point during processing. + + + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + Performs an operation with or on this Geometry's coordinates. + + + If this method modifies any coordinate values, + must be called to update the geometry state. + Note that you cannot use this method to + modify this Geometry if its underlying CoordinateSequence's #get method + returns a copy of the Coordinate, rather than the actual Coordinate stored + (if it even stores Coordinate objects at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + + + If the filter reports that a coordinate value has been changed, + will be called automatically. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + + + + + + + Converts this Geometry to normal form (or canonical form ). + + + + Normal form is a unique representation for Geometrys. + It can be used to test whether two Geometrys are equal + in a way that is independent of the ordering of the coordinates within + them. Normal form equality is a stronger condition than topological + equality, but weaker than pointwise equality. + + The definitions for normal + form use the standard lexicographical ordering for coordinates. "Sorted in + order of coordinates" means the obvious extension of this ordering to + sequences of coordinates. + + + NOTE that this method mutates the value of this geometry in-place. + If this is not safe and/or wanted, the geometry should be + cloned prior to normalization. + + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry, using the given . + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + A IComparer<ICoordinateSequence> + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether the two Geometrys are equal, from the point + of view of the EqualsExact method. Called by EqualsExact + . In general, two Geometry classes are considered to be + "equivalent" only if they are the same class. An exception is LineString + , which is considered to be equivalent to its subclasses. + + The Geometry with which to compare this Geometry for equality. + + true if the classes of the two Geometry + s are considered to be equal by the equalsExact method. + + + + + Throws an exception if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + if g is a GeometryCollection, but not one of its subclasses. + + + + + Returns true if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + If g is a GeometryCollection, but not one of its subclasses. + + + + + Returns the minimum and maximum x and y values in this Geometry, + or a null Envelope if this Geometry is empty. + Unlike EnvelopeInternal, this method calculates the Envelope + each time it is called; EnvelopeInternal caches the result + of this method. + + + This Geometrys bounding box; if the Geometry + is empty, Envelope.IsNull will return true. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry having the same class. + + A Geometry having the same class as this Geometry. + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry of the same class. + using the given . + + A Geometry having the same class as this Geometry + The comparer + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the JTS Technical + Specifications + + + + + Returns the first non-zero result of CompareTo encountered as + the two Collections are iterated over. If, by the time one of + the iterations is complete, no non-zero result has been encountered, + returns 0 if the other iteration is also complete. If b + completes before a, a positive number is returned; if a + before b, a negative number. + + A Collection of IComparables. + A Collection of IComparables. + The first non-zero compareTo result, if any; otherwise, zero. + + + + + + + + + + + + + + + + + + + + + A predefined with == . + + + + + + + Gets the factory which contains the context in which this point was created. + + The factory for this point. + + + + Gets/Sets the user data object for this point, if any. + + + A simple scheme for applications to add their own custom data to a Geometry. + An example use might be to add an object representing a Coordinate Reference System. + Note that user data objects are not present in geometries created by + construction methods. + + + + + Sets the ID of the Spatial Reference System used by the Geometry. + + + + NOTE: This method should only be used for exceptional circumstances or + for backwards compatibility. Normally the SRID should be set on the + used to create the geometry. + SRIDs set using this method will not be propagated to + geometries returned by constructive methods. + + + + + + Returns the name of this Geometry's actual class. + + The name of this Geometrys actual class. + + + + Gets the OGC geometry type + + + + + Returns the PrecisionModel used by the Geometry. + + + the specification of the grid of allowable points, for this + Geometry and all other Geometrys. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the number of Geometryes in a GeometryCollection, + or 1, if the geometry is not a collection. + + + + + Tests whether this is simple. + + The SFS definition of simplicity + follows the general rule that a Geometry is simple if it has no points of + self-tangency, self-intersection or other anomalous points. + + Simplicity is defined for each subclass as follows: + + Valid polygonal geometries are simple, since their rings + must not self-intersect. IsSimple + tests for this condition and reports false if it is not met. + (This is a looser test than checking for validity). + Linear rings have the same semantics. + Linear geometries are simple iff they do not self-intersect at points + other than boundary points. + Zero-dimensional geometries (points) are simple iff they have no + repeated points. + Empty Geometrys are always simple. + + + true if this Geometry is simple + + + + + Tests whether this Geometry is topologically + valid, according to the OGC SFS specification. + For validity rules see the documentation for the specific geometry subclass. + + true if this Geometry is valid. + + + + Tests whether the set of points covered in this Geometry is empty. + + true if this Geometry does not cover any points. + + + + Returns the area of this Geometry. + Areal Geometries have a non-zero area. + They override this function to compute the area. + Others return 0.0 + + The area of the Geometry. + + + + Returns the length of this Geometry. + Linear geometries return their length. + Areal geometries return their perimeter. + They override this function to compute the length. + Others return 0.0 + + The length of the Geometry. + + + + Computes the centroid of this Geometry. + The centroid + is equal to the centroid of the set of component Geometries of highest + dimension (since the lower-dimension geometries contribute zero + "weight" to the centroid). + + The centroid of an empty geometry is POINT EMPTY. + + A Point which is the centroid of this Geometry. + + + + Computes an interior point of this Geometry. + + + An interior point is guaranteed to lie in the interior of the Geometry, + if it possible to calculate such a point exactly. Otherwise, + the point may lie on the boundary of the point. + + The interior point of an empty geometry is POINT EMPTY. + + A Point which is in the interior of this Geometry. + + + + + + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the boundary, or an empty geometry of appropriate dimension + if this Geometry is empty. + For a discussion of this function, see the OpenGIS Simple + Features Specification. As stated in SFS Section 2.1.13.1, "the boundary + of a Geometry is a set of Geometries of the next lower dimension." + + The closure of the combinatorial boundary of this Geometry. + NOTE: make abstract, remove setter and change geoapi + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + Gets a geometry representing the envelope (bounding box) of this Geometry. + + If this Geometry is + + empty, returns an empty Point + a point, returns a Point + a line parallel to an axis, a two-vertex LineString, + otherwise, returns a + Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, + maxy), (minx, maxy), (minx, miny). + + + + A Geometry representing the envelope of this Geometry + + + + + + Gets an containing + the minimum and maximum x and y values in this Geometry. + If the geometry is empty, an empty Envelope + is returned. + + + The returned object is a copy of the one maintained internally, + to avoid aliasing issues. + For best performance, clients which access this + envelope frequently should cache the return value. + the envelope of this Geometry. + An empty Envelope if this Geometry is empty + + + + + + + + + + + + + + + Extension Methods for geometries + + + + + Function to encode to an array of s. If assigned, is used. + + The geometry to encode + The writer to use + An array of s, that represent + + + + Delegate function declaration to handle filter operation + + The geometry to filter + + + + An implementation that applies filtering with the provided + + + + + Creates an instance of this class + + The filter method to be used + + + + OGC compliant geometry factory + + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + Note that the factory constructor methods do not change the input coordinates in any way. + In particular, they are not rounded to the supplied PrecisionModel. + It is assumed that input Coordinates meet the given precision. + + + + + A predefined with + == . + + + + + A predefined with + == . + + A shortcut for . + + + + A predefined with + == . + + + + + A predefined with + == . + + + + + + + + + + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. + + + + + Constructs a GeometryFactory that generates Geometries having the given + CoordinateSequence implementation, a double-precision floating PrecisionModel and a + spatial-reference ID of 0. + + + + + Constructs a GeometryFactory that generates Geometries having the given + {PrecisionModel} and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel and spatial-reference ID, and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + The SRID to use. + + + + Constructs a GeometryFactory that generates Geometries having a floating + PrecisionModel and a spatial-reference ID of 0. + + + + + Converts the ICollection to an array. + + The ICollection of Points to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Geometry's to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LinearRings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Polygons to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPoints to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiLineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPolygons to convert. + The ICollection in array format. + + + + Creates a with the same extent as the given envelope. + + + + The Geometry returned is guaranteed to be valid. + To provide this behaviour, the following cases occur: + + + If the Envelope is: +
    +
  • null returns an empty
  • +
  • a point returns a non-empty
  • +
  • a line returns a two-point
  • +
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
  • +
+
+
+ The Envelope + + An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases) + +
+ + + Creates a Point using the given Coordinate. + A null coordinate creates an empty Geometry. + + a Coordinate, or null + A object + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + a CoordinateSequence (possibly empty), or null + A object + + + + Creates a LineString using the given Coordinates. + A null or empty array creates an empty LineString. + + An array without null elements, or an empty array, or null. + A object + + + + Creates a LineString using the given CoordinateSequence. + A null or empty CoordinateSequence creates an empty LineString. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a LinearRing using the given Coordinates; a null or empty array + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A object + If the ring is not closed, or has too few points + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence (possibly empty), or null. + A object + If the ring is not closed, or has too few points + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + A object + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + the created Polygon + If the boundary ring is invalid + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + A object + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + A object + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + an array of Geometries, each of which may be empty but not null, or null + A object + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned.
+ If geomList contains several Polygons, a + MultiPolygon is returned.
+ If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned.
+ If geomList is empty, an empty GeometryCollection + is returned. + Note that this method does not "flatten" Geometries in the input, and hence if + any MultiGeometries are contained in the input a GeometryCollection containing + them will be returned. +
+ The Geometry to combine. + + A of the "smallest", "most type-specific" + class that can contain the elements of geomList. + +
+ + + Creates a deep copy of the input . + The defined for this factory + is used to copy the s + of the input geometry. + + This is a convenient way to change the CoordinateSequence + used to represent a geometry, or to change the + factory used for a geometry. + + can also be used to make a deep copy, + but it does not allow changing the CoordinateSequence type. + + The geometry + A deep copy of the input geometry, using the CoordinateSequence type of this factory + + + + + Returns the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + + + + + + The SRID value defined for this factory. + + + + + Creates an instance of this class using the default + values for , + and + . + + + + + Creates an instance of this class using the default + values for , + , + but the specified . + + + + Creates an instance of this class using the default + values for , + but the + specified . + + + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. +
The are guaranteed to be orientated clockwise. +
+
+ + + Methods to map various collections + of s + via defined mapping functions. + + Martin Davis + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation delegate + A result collection or geometry of most specific type + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation + A result collection or geometry of most specific type + + + + An interface for geometry functions used for mapping. + + Martin Davis + + + + Computes a new geometry value. + + The input geometry + A result geometry + + + + Represents an (1-dimensional) closed interval on the Real number line. + + + + + Creates a new interval instance, setting ==0d; + + + + + Creates a new interval instance, setting = and =; + + The minimum value + The maximum value + + + + Creates a new interval instance, setting = and =. + + + + + + Method to initialize the interval with the given and values.
+ If < , their values are exchanged. +
+ The minimum value + The maximum value +
+ + + Method to expand this interval to contain . + + The interval to contain. + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval R[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval R[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval R[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval R[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Gets or sets a value indicating the minimum value of the closed interval. + + + + + Gets or sets a value indicating the maximum value of the closed interval. + + + + + Gets the width of the interval ( - ) + + + + + Gets the centre of the interval ( + * 0.5d) + + + + + A visitor for s in a index. + + 1.7 + + + + Visits a node. + + The node to visit + + + + A contiguous portion of 1D-space. Used internally by SIRtree. + + + + + + + + + + + + + + + + + + + + + this + + + + + + + this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writes a formatted string containing the KML representation + of a JTS . + The output is KML fragments which can be substituted + wherever the KML abstract + element can be used. + + + Output elements are indented to provide a + nicely-formatted representation. + An output line prefix and maximum + number of coordinates per line can be specified. + + + The Z ordinate value output can be forced to be a specific value. + The and modes can be set. + If set, the corresponding sub-elements will be output. + + + + + The KML standard value clampToGround for use in . + + + + + The KML standard value relativeToGround for use in . + + + + + The KML standard value absolute for use in . + + + + + Writes a Geometry as KML to a string, using + a specified Z value. + + the geometry to write + the Z value to use + a string containing the KML geometry representation + + + + Writes a Geometry as KML to a string, using + a specified Z value, precision, extrude flag, + and altitude mode code. + + the geometry to write + the Z value to use + the maximum number of decimal places to write + the extrude flag to write + the altitude model code to write + a string containing the KML geometry representation + + + + Writes a in KML format as a string. + + the geometry to write + a string containing the KML geometry representation + + + + Writes the KML representation of a to a . + + the geometry to write + the writer to write to + + + + Appends the KML representation of a to a . + + the geometry to write + the buffer to write into + + + + Takes a list of coordinates and converts it to KML. + + + 2D and 3D aware. Terminates the coordinate output with a newline. + + + + + A tag string which is prefixed to every emitted text line. + This can be used to indent the geometry text in a containing document. + + + + + The maximum number of coordinates to output per line. + + + + + The Z value to be output for all coordinates. + This overrides any Z value present in the Geometry coordinates. + + + + + The flag to be output in the extrude element. + + + + + The flag to be output in the tesselate element. + + + + + The value output in the altitudeMode element. + + + + + The maximum number of decimal places to output in ordinate values. + Useful for limiting output size. + + + negative values set the precision to , + like standard behavior. + + + + + Reads a sequence of {@link Geometry}s in WKBHex format + from a text file. + Each WKBHex geometry must be on a single line + The geometries in the file may be separated by any amount + of whitespace and newlines. + + Martin Davis + + + + Creates a new given the + to use to parse the geometries. + + The geometry reader to use + + + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no filename was specified + Thrown if the filename specified does not exist + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no stream was passed + Thrown if passed stream is not readable or seekable + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The stream reader to use. + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Tests if reader has reached limit + + A collection of already read geometries + true if number of geometries has been read. + + + + Tests if reader is at EOF. + + + + + Gets or sets a value indicating the maximum number of geometries to read + + + + + Gets or sets the number of geometries to skip before storing. + + + + + Enumeration for the 3 coordinate planes + + + + + Models a plane in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the oriented distance from a point to the plane.
+ The distance is: + + positive if the point lies above the plane (relative to the plane normal) + zero if the point is on the plane + negative if the point lies below the plane (relative to the plane normal) + +
+ The point to compute the distance for + The oriented distance to the plane +
+ + + Computes the axis plane that this plane lies closest to. + + Geometries lying in this plane undergo least distortion + (and have maximum area) + when projected to the closest axis plane. + This provides optimal conditioning for + computing a Point-in-Polygon test. + + The index of the closest axis plane + + + + Represents a vector in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the dot product of the 3D vectors AB and CD. + + A coordinate + A coordinate + A coordinate + A coordinate + The dot product + + + + Creates a new vector with given , and components. + + The x component + The y component + The z component + A new vector + + + + Creates a new vector from a . + + The coordinate to copy + A new vector + + + + Computes the 3D dot-product of two s + + The 1st vector + The 2nd vector + The dot product of the (coordinate) vectors + + + + Creates a vector, that is the difference of and + + The origin coordinate + The destination coordinate + + + + Creates a vector with the ordinates , and + + The x-ordinate + The y-ordinate + The z-ordinate + + + + Computes the dot-product of this and + + The 2nd vector + The dot product of the vectors + + + + Function to compute the length of this vector + + The length of this vector + + + + Function to compute the length of vector . + + A coordinate, treated as vector + The length of + + + + Function to compute a normalized form of this vector + + A normalized form of this vector + + + + Function to devide all dimensions of this vector by . + + The divisor + A new (divided) vector + + + + Function to compute a normalized form of vector . + + A coordinate vector + A normalized form of + + + + Gets a value indicating the x-ordinate + + + + + Gets a value indicating the y-ordinate + + + + + Gets a value indicating the z-ordinate + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + + + + Processes possible intersections detected by a . + + + + The is passed to a . + + The + method is called whenever the + detects that two s might intersect. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + This class is an example of the Strategy pattern. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + + + This method is called by clients + of the interface to process + intersections for two segments of the s being intersected. + + + + + + + + + Reports whether the client of this class needs to continue testing + all intersections in an arrangement. + + if there is no need to continue testing segments + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Intersects two sets of s using + brute-force comparison. + + + + + An intersector for the red-blue intersection problem. + In this class of line arrangement problem, + two disjoint sets of linestrings are intersected. + + Implementing classes must provide a way + of supplying the base set of segment strings to + test against (e.g. in the constructor, + for straightforward thread-safety). + + In order to allow optimizing processing, + the following condition is assumed to hold for each set: + + the only intersection between any two linestrings occurs at their endpoints. + + Implementations can take advantage of this fact to optimize processing + (i.e by avoiding testing for intersections between linestrings + belonging to the same set). + + + + + Computes the intersections with a given set of s, + using the supplied . + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of base segments. + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Processes all of the segment pairs in the given segment strings + using the given SegmentIntersector. + + A segment string + A segment string + The segment intersector to use + + + + A geometry service provider class + + + + + Creates an instance of this class, using the as default and a precision model. No is specified + + + + + Creates an instance of this class, using the provided , and spatial reference Id (. + + The coordinate sequence factory to use. + The precision model. + The default spatial reference ID + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Gets or sets the current instance + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Gets a value representing the number of geometry factories that have been stored in the cache + + + + + A pair of s, whose leaf items + support a distance metric between them. + Used to compute the distance between the members, + and to expand a member relative to the other + in order to produce new branches of the + Branch-and-Bound evaluation tree. + Provides an ordering based on the distance between the members, + which allows building a priority queue by minimum distance. + + Martin Davis + + + + Creates an instance of this class with the given s and the function. + + The first boundable + The second boundable + The item distance function + + + + Gets one of the member s in the pair + (indexed by [0, 1]). + + The index of the member to return (0 or 1) + The chosen member + + + + Computes the distance between the s in this pair. + The boundables are either composites or leaves. + If either is composite, the distance is computed as the minimum distance + between the bounds. + If both are leaves, the distance is computed by . + + The distance between the s in this pair. + + + + Compares two pairs based on their minimum distances + + + + + For a pair which is not a leaf + (i.e. has at least one composite boundable) + computes a list of new pairs + from the expansion of the larger boundable. + + + + + Gets the minimum possible distance between the Boundables in + this pair. + If the members are both items, this will be the + exact distance between them. + Otherwise, this distance will be a lower bound on + the distances between the items in the members. + + The exact or lower bound distance for this pair + + + + Tests if both elements of the pair are leaf nodes + + + + + An function for + items which are using the method. + + Martin Davis + + + + A function method which computes the distance + between two s in an . + Used for Nearest Neighbour searches. + + Martin Davis + + + + Computes the distance between two items. + + The first item. + The second item. + If the metric is not applicable to the arguments + The distance between and . + + + + Computes the distance between two items, + using the method. + + An item which is a geometry. + An item which is a geometry. + if either item is not a Geometry + The distance between the two items. + + + + Implements extended-precision floating-point numbers + which maintain 106 bits (approximately 30 decimal digits) of precision. + + A DoubleDouble uses a representation containing two double-precision values. + A number x is represented as a pair of doubles, x.hi and x.lo, + such that the number represented by x is x.hi + x.lo, where +
+                |x.lo| <= 0.5*ulp(x.hi)
+            
+ and ulp(y) means "unit in the last place of y". + The basic arithmetic operations are implemented using + convenient properties of IEEE-754 floating-point arithmetic. + + The range of values which can be represented is the same as in IEEE-754. + The precision of the representable numbers + is twice as great as IEEE-754 double precision. + + The correctness of the arithmetic algorithms relies on operations + being performed with standard IEEE-754 double precision and rounding. + This is the Java standard arithmetic model, but for performance reasons + Java implementations are not + constrained to using this standard by default. + Some processors (notably the Intel Pentium architecure) perform + floating point operations in (non-IEEE-754-standard) extended-precision. + A JVM implementation may choose to use the non-standard extended-precision + as its default arithmetic mode. + To prevent this from happening, this code uses the + Java strictfp modifier, + which forces all operations to take place in the standard IEEE-754 rounding model. + + The API provides both a set of value-oriented operations + and a set of mutating operations. + Value-oriented operations treat DoubleDouble values as + immutable; operations on them return new objects carrying the result + of the operation. This provides a simple and safe semantics for + writing DoubleDouble expressions. However, there is a performance + penalty for the object allocations required. + The mutable interface updates object values in-place. + It provides optimum memory performance, but requires + care to ensure that aliasing errors are not created + and constant values are not changed. + + This implementation uses algorithms originally designed variously by + Knuth, Kahan, Dekker, and Linnainmaa. + Douglas Priest developed the first C implementation of these techniques. + Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al. +

References

+ + Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, + in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, + IEEE Computer Society Press, Los Alamitos, Calif., 1991. + Yozo Hida, Xiaoye S. Li and David H. Bailey, + Quad-Double Arithmetic: Algorithms, Implementation, and Application, + manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. + David Bailey, High Precision Software Directory; + http://crd.lbl.gov/~dhbailey/mpdist/index.html + +
+ Martin Davis +
+ + + The value to split a double-precision value on during multiplication + + + + The value nearest to the constant Pi. + + + The value nearest to the constant 2 * Pi. + + + The value nearest to the constant Pi / 2. + + + + The value nearest to the constant e (the natural logarithm base). + + + + + A value representing the result of an operation which does not return a valid number. + + + + + The smallest representable relative difference between two values + + + + + Converts the string argument to a DoubleDouble number. + + A string containing a representation of a numeric value + The extended precision version of the value + Thrown if is not a valid representation of a number + + + Converts the double argument to a DoubleDouble number. + + @param x a numeric value + @return the extended precision version of the value + + + The high-order component of the double-double precision value. + + + The low-order component of the double-double precision value. + + + + Creates a new with value x. + + The initial value + + + + Creates a new with value (hi, lo). + + The high order component + The low order component + + + + Creates a with a value equal to the argument + + The initial value + + + Creates a new DoubleDouble with value equal to the argument. + + @param str the value to initialize by + @throws NumberFormatException if str is not a valid representation of a number + + + + Creates a new with the value of the argument. + + The value to copy + A copy of + + + + Creates and returns a copy of this value. + + Acopy of this value + + + + Returns a whose value is (this + ) + + The addende"/> + (this + ) + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns a whose value is (this + y). + + The addend + (this + y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Returns a whose value is -this. + + -this + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + ** + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + ** + + + Returns a DoubleDouble whose value is 1 / this. + + @return the reciprocal of this value + + + + Computes the minimum of this and another DD number. + + A DD number + The minimum of the two numbers + + + + Computes the maximum of this and another DD number. + + A DD number + The maximum of the two numbers + + + + + + Returns an integer indicating the sign of this value. + + + if this value is > 0, returns 1 + if this value is < 0, returns -1 + if this value is = 0, returns 0 + if this value is NaN, returns 0 + + + + An integer indicating the sign of this value + + + + Rounds this value to the nearest integer. + The value is rounded to an integer by adding 1/2 and taking the floor of the result. + Special cases: + + If this value is NaN, returns NaN. + + + This value rounded to the nearest integer + + + + Returns the integer which is largest in absolute value and not further + from zero than this value. + + Special cases: + + If this value is NaN, returns NaN. + + + + The integer which is largest in absolute value and not further from zero than this value + + + + + Returns the absolute value of this value. + + Special cases: + + if this value is NaN, it is returned. + + + The absolute value of this value + + + + Computes the square of this value. + + The square of this value + + + + Computes the square of this value. + + The square of this value. + + + Computes the positive square root of this value. + If the number is NaN or negative, NaN is returned. + + @return the positive square root of this number. + If the argument is NaN or less than zero, the result is NaN. + + + + Computes the value of this number raised to an integral power. + Follows semantics of .Net Math.Pow as closely as possible. + + The integer exponent + x raised to the integral power exp + + + Converts this value to the nearest double-precision number. + + @return the nearest double-precision number to this value + + + Converts this value to the nearest integer. + + @return the nearest integer to this value + + + + Gets a value indicating whether this object is positive or not + + + + + Gets a value indicating whether this object is positive or not + + + + Tests whether this value is equal to another DoubleDouble value. + + @param y a DoubleDouble value + @return true if this value = y + + + Tests whether this value is greater than another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value > y + + + Tests whether this value is greater than or equals to another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value >= y + + + + Tests whether this value is less than another DoubleDouble value. + + A DoubleDouble value + true if this value is < + + + + Compares two DoubleDouble objects numerically. + + @return -1,0 or 1 depending on whether this value is less than, equal to + or greater than the value of o + + + + Dumps the components of this number to a string. + + A string showing the components of the number + + + + Returns a string representation of this number, in either standard or scientific notation. + If the magnitude of the number is in the range [ 10-3, 108 ] + standard notation will be used. Otherwise, scientific notation will be used. + + A string representation of this number + + + + Returns the string representation of this value in standard notation. + + The string representation in standard notation + + + + Returns the string representation of this value in scientific notation. + + The string representation in scientific notation + + + Extracts the significant digits in the decimal representation of the argument. + A decimal point may be optionally inserted in the string of digits + (as long as its position lies within the extracted digits + - if not, the caller must prepend or append the appropriate zeroes and decimal point). + + @param y the number to extract ( >= 0) + @param decimalPointPos the position in which to insert a decimal point + @return the string containing the significant digits and possibly a decimal point + + + + Returns the string for this value if it has a known representation (e.g. NaN or 0.0). + + The string for this special number
+ or null if the number is not a special number
+
+ + + Determines the decimal magnitude of a number. + The magnitude is the exponent of the greatest power of 10 which is less than + or equal to the number. + + The number to find the magnitude of + The decimal magnitude of + + + + Converts a string representation of a real number into a DoubleDouble value. + The format accepted is similar to the standard Java real number syntax. + It is defined by the following regular expression: +
+            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
+            
+
+ The string to parse + The value of the parsed number + Thrown if str is not a valid representation of a number +
+ + + Gets a value indicating whether this object is zero (0) or not + + + + + Gets a value indicating whether this object is negative or not + + + + + Various utility functions for mathematical and numerical operations. + + + + + Clamps a double value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Clamps a int value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Computes the base-10 logarithm of a double value. + + + If the argument is NaN or less than zero, then the result is NaN. + If the argument is positive infinity, then the result is positive infinity. + If the argument is positive zero or negative zero, then the result is negative infinity. + + + + A positive number + The value log a, the base-10 logarithm of the input value + + + + + Computes the average of two numbers. + + A number + A number + The average of the inputs + + + + Computes the maximum fo three values + + A number + A number + A number + The maximum value of , and + + + + Computes the maximum of four values + + A number + A number + A number + A number + The maximum value of , , and + + + + Computes the minimum of four values + + A number + A number + A number + The minimum value of , and + + + + Computes the minimum of four values + + A number + A number + A number + A number + The minimum value of , , and + + + + Implements some 2D matrix operations + (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination. + In order to avoid overhead the algorithm runs in-place + on - if should not be modified the client must supply a copy. + + An nxn matrix in row/column order )modified by this method) + A vector of length n + A vector containing the solution (if any)
or null if the system has no or no unique solution +
+ If the matrix has the wrong size +
+ + + A 2-dimensional mathematical vector represented by double-precision X and Y components. + + mbdavis + + + + Creates a new vector with given X and Y components. + + The x component + The y component + A new vector + + + + Creates a new vector from an existing one. + + The vector to copy + A new vector + + + + Creates a vector from a . + + The coordinate to copy + A new vector + + + Creates a vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + A new vector + + + The X component of this vector. + + + The Y component of this vector. + + + + Creates an new vector instance + + + + + Creates a new vector instance using the provided and ordinates + + The x-ordinate value + The y-ordinate value + + + + Creates a new vector instance based on . + + The vector + + + Creates a new vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + + + + Creates a vector from a . + + The coordinate + A new vector + + + + Adds to this vector instance. + + The vector to add + The result vector + + + + Subtracts from this vector instance + + The vector to subtract + The result vector + + + + Multiplies the vector by a scalar value. + + The value to multiply by + A new vector with the value v * d + + + + Divides the vector by a scalar value. + + The value to divide by + A new vector with the value v / d + + + + Negates this vector + + A new vector with [-_x, -_y] + + + + + + + + + + + + + + + + Normalizes the vector + + A new normalized vector + + + + + + + + + + + Computes the weighted sum of this vector + with another vector, + with this vector contributing a fraction + of frac to the total. + + In other words, +
+            sum = frac * this + (1 - frac) * v
+            
+
+ The vector to sum + The fraction of the total contributed by this vector + The weighted sum of the two vectors +
+ + + Computes the distance between this vector and another one. + + A vector + The distance between the vectors + + + + Computes the dot-product of two vectors + + A vector + The dot product of the vectors + + + + Computes the angle this vector describes to the horizontal axis + + The angle + + + + + + + + + + + + + + + + + + Rotates this vector by + + The angle + The rotated vector + + + + Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 + degrees or Pi/2 radians). A positive number rotates counter-clockwise, a + negative number rotates clockwise. Under this operation the magnitude of + the vector and the absolute values of the ordinates do not change, only + their sign and ordinate index. + + The number of quarter-circles to rotate by + The rotated vector. + + + + + + + + + + + Gets a made of this vector translated by . + + The translation coordinate + A coordinate + + + + Gets a from this vector + + A coordinate + + + + Creates a copy of this vector + + A copy of this vector + + + + Gets a string representation of this vector + + A string representing this vector + + + + Tests if a vector has the same values for the x and y components. + + A with which to do the comparison. + true if is a with the same values for the X and Y components. + + + + Gets a hashcode for this vector. + + A hashcode for this vector + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + + Functions for performing vector mathematics. + + + + + Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each + triangle coordinate must have a Z value. If this is not the case, the returned Coordinate + will have NaN values. The returned vector has unit length. + + A point + A point + A point + The normal vector to the triangle -- + + + + Normalizes the vector + + The normalized + + + + Computes the cross product of and + + A vector + A vector + The cross product of and + + + + Computes the dot product of and + + A vector + A vector + The dot product of and + + + + Computes the determinant of a 2x2 matrix + + The m[0,0] value + The m[0,1] value + The m[1,0] value + The m[1,1] value + The determinant + + + + Helper class for transforming objects. + + + + + Transforms a object. + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Densifies a geometry by inserting extra vertices along the line segments + contained in the geometry. + All segments in the created densified geometry will be no longer than + than the given distance tolerance. + + + Densified polygonal geometries are guaranteed to be topologically correct. + The coordinates created during densification respect the input geometry's . + Note: At some future point this class will offer a variety of densification strategies. + + Martin Davis + + + + Densifies a geometry using a given distance tolerance, and respecting the input geometry's . + + The geometry densify + The distance tolerance () + The densified geometry + + + + Densifies a coordinate sequence. + + The coordinate sequence to densify + The distance tolerance () + The precision model to apply on the new coordinates + The densified coordinate sequence + + + Creates a new densifier instance + The geometry to densify + + + + Gets the densified geometry. + + The densified geometry + + + + Gets or sets the distance tolerance for the densification. All line segments + in the densified geometry will be no longer than the distance tolereance. + Simplified geometry will be within this distance of the original geometry. + The distance tolerance must be positive. + + + + + A framework for processes which transform an input Geometry into + an output , possibly changing its structure and type(s). + + + + This class is a framework for implementing subclasses + which perform transformations on + various different Geometry subclasses. + + + It provides an easy way of applying specific transformations + to given point types, while allowing unhandled types to be simply copied. + Also, the framework handles ensuring that if subcomponents change type + the parent geometries types change appropriately to maintain valid structure. + Subclasses will override whichever TransformX methods + they need to to handle particular Geometry types. + + + A typically usage would be a transformation that may transform Polygons into + Polygons, LineStrings or Points, depending on the geometry of the input + (For instance, a simplification operation). + This class would likely need to override the + method to ensure that if input Polygons change type the result is a GeometryCollection, + not a MultiPolygon. + + The default behaviour of this class is simply to recursively transform + each Geometry component into an identical object by deep copying down + to the level of, but not including, coordinates. + + + Note that all TransformXXX methods may return null, + to avoid creating empty point objects. This will be handled correctly + by the transformer. TransformXXX methods should always return valid + geometry - if they cannot do this they should return null + (for instance, it may not be possible for a transformLineString implementation + to return at least two points - in this case, it should return null). + The method itself will always + return a non-null Geometry object (but this may be empty). + > + + + + + + + + + true if empty geometries should not be included in the result. + + + + + true if a homogenous collection result + from a GeometryCollection should still + be a general GeometryCollection. + + + + + true if the type of the input should be preserved. + + + + + + + + + + + + Convenience method which provides standard way of + creating a CoordinateSequence. + + The coordinate array to copy. + A coordinate sequence for the array. + + + + Convenience method which provides statndard way of copying {CoordinateSequence}s + + The sequence to copy. + A deep copy of the sequence. + + + + Transforms a . + This method should always return a valid coordinate list for + the desired result type. (E.g. a coordinate list for a LineString + must have 0 or at least 2 points). + If this is not possible, return an empty sequence - + this will be pruned out. + + The coordinates to transform + The parent geometry + The transformed coordinates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Makes the input geometry available + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections + A valid area geometry + + + + Stores all attributes associated with a single Geometry feature. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the names + + + + + + + + + + + + + + + + + + + + + + + + Returns a string array containing + all names of present attributes. + + + + + + Returns a object array containing + all values of present attributes. + + + + + + Verifies if attribute specified already exists. + + + + + + + Build a field with the given value and add it to attributes table. + + Name of the new attribute. + Value for attribute (can be null). + If attribute already exists. + + + + Delete the specified attribute from the table. + + + + + + Return the System.Type of the specified attribute, + useful for casting values retrieved with GetValue methods. + + + + + + + Get the value of the specified attribute. + + + + + + + Set the value of the specified attribute. + + + + + + + + + + + + Get / Set the value of the specified attribute. + + + + + + + Feature class + + + + + + + + + + + + + + + + + Geometry representation of the feature. + + + + + Attributes table of the feature. + + + + + Angle orientation + + + + Constant representing no orientation + + + Constant representing straight orientation + + + Constant representing counterclockwise orientation + + + Constant representing left orientation + + + Constant representing clockwise orientation + + + Constant representing right orientation + + + + Utility functions for working with angles. + Unless otherwise noted, methods in this class express angles in radians. + + + + + Converts from radians to degrees. + + An angle in radians + The angle in degrees + + + + Converts from degrees to radians. + + An angle in degrees + The angle in radians + + + + Returns the angle of the vector from p0 to p1, relative to the positive X-axis. + + The angle is normalized to be in the range [ -Pi, Pi ]. + The start-point + The end-point + The normalized angle (in radians) that p0-p1 makes with the positive X-axis + + + + Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. + + + The angle is normalized to be in the range ( -Pi, Pi ]. + + The point + The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. + + + + Tests whether the angle between p0-p1-p2 is acute. + + + An angle is acute if it is less than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Tests whether the angle between p0-p1-p2 is obtuse + + + An angle is obtuse if it is greater than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Returns the unoriented smallest angle between two vectors. + + + The computed angle will be in the range [0, Pi). + + The tip of one vector + The tail of each vector + The tip of the other vector + + + + Returns the oriented smallest angle between two vectors. + The computed angle will be in the range (-Pi, Pi]. + A positive result corresponds to a rotation (CCW) from v1 to v2; + a negative result corresponds to a (CW) rotation; + a zero result corresponds to no rotation. + + The tip of v1 + The tail of each vector + The tip of v2 + The angle between v1 and v2, relative to v1 + + + + Computes the interior angle between two segments of a ring. + The ring is assumed to be oriented in a clockwise direction. + + The computed angle will be in the range [0, 2Pi] + A point of the ring + The next point of the ring + The next point of the ring + The interior angle based at p1 + + + + Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. + + An angle (in radians) + An angle (in radians) + Whether a1 must turn , or to overlap a2. + + + + Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. + + The angle to normalize + An equivalent angle in the range (-Pi, Pi] + + + + Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). + + E.g. + + + NormalizePositive(0.0) = 0.0 + NormalizePositive(-PI) = + NormalizePositive(-2PI) = 0.0 + NormalizePositive(-3PI) = + NormalizePositive(-4PI) = 0 + NormalizePositive(PI) = + NormalizePositive(2PI) = 0.0 + NormalizePositive(3PI) = + NormalizePositive(4PI) = 0.0 + + + + + The angle to normalize, in radians. + An equivalent positive angle + + + + Computes the unoriented smallest difference between two angles. + + + + The angles are assumed to be normalized to the range [-Pi, Pi]. + The result will be in the range [0, Pi]. + + + The angle of one vector (in [-Pi, Pi] ) + The angle of the other vector (in range [-Pi, Pi] ) + The angle (in radians) between the two vectors (in range [0, Pi] ) + + + + Useful utility functions for handling Coordinate arrays. + + + + + Tests whether an array of s forms a ring, by checking length and closure. + Self-intersection is not checked. + + An array of Coordinates + true if the coordinate form a ring. + + + + Finds a in a list of s + which is not contained in another list of s. + + The s to test. + An array of s to test the input points against. + + A from + which is not in , or null. + + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + + + + Determines which orientation of the array is (overall) increasing. + In other words, determines which end of the array is "smaller" + (using the standard ordering on ). + Returns an integer indicating the increasing direction. + If the sequence is a palindrome, it is defined to be + oriented in a positive direction. + + The array of Coordinates to test. + + 1 if the array is smaller at the start or is a palindrome, + -1 if smaller at the end. + + + + + Determines whether two arrays of equal length + are equal in opposite directions. + + + + + + + + Creates a deep copy of the argument Coordinate array. + + Array of Coordinates. + Deep copy of the input. + + + + Creates a deep copy of a given section of a source array into a destination Coordinate array. + The destination array must be an appropriate size to receive the copied coordinates. + + An array of Coordinates + The index to start copying from + The array to receive the deep-copied coordinates + The destination index to start copying to + The number of items to copy + + + + Converts the given of + s into a array. + + of coordinates. + + + If contains not only s. + + + + + Converts the given of + s into a array. + + of coordinates. + + + + + Returns whether Equals returns true for any two consecutive + coordinates in the given array. + + Array of Coordinates. + true if coord has repeated points; false otherwise. + + + + Returns either the given coordinate array if its length is greater than + the given amount, or an empty coordinate array. + + Length amount. + Array of Coordinates. + New Coordinate array. + + + + If the coordinate array argument has repeated points, + constructs a new array containing no repeated points. + Otherwise, returns the argument. + + + + + + + Collapses a coordinate array to remove all null elements. + + The coordinate array to collapse + An Array containing only non-null elements + + + + Reverses the coordinates in an array in-place. + + Array of Coordinates. + + + + Returns true if the two arrays are identical, both null, or pointwise + equal (as compared using Coordinate.Equals). + + First array of Coordinates. + Second array of Coordinates. + true if two Coordinates array are equals; false otherwise + + + + Returns true if the two arrays are identical, both null, or pointwise + equal, using a user-defined + for s. + + An array of s. + Another array of s. + + A for s. + + + + + + Returns the minimum coordinate, using the usual lexicographic comparison. + + Array to search. + The minimum coordinate in the array, found using CompareTo. + + + + Shifts the positions of the coordinates until firstCoordinate is first. + + Array to rearrange. + Coordinate to make first. + + + + Returns the index of in . + The first position is 0; the second is 1; etc. + + A to search for. + A array to search. + The position of coordinate, or -1 if it is not found. + + + + Extracts a subsequence of the input array + from indices to (inclusive). + The input indices are clamped to the array size; + If the end index is less than the start index, + the extracted array will be empty. + + The input array. + The index of the start of the subsequence to extract. + The index of the end of the subsequence to extract. + A subsequence of the input array. + + + + Computes the of the coordinates. + + the array to scan. + the of the . + + + Extracts the coordinates which intersect an {@link Envelope}. + + @param coordinates the coordinates to scan + @param env the envelope to intersect with + @return an array of the coordinates which intersect the envelope + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + Compares the specified s arrays. + + + + + + + + A comparator for arrays modulo their directionality. + E.g. if two coordinate arrays are identical but reversed + they will compare as equal under this ordering. + If the arrays are not equal, the ordering returned + is the ordering in the forward direction. + + + + + A backed by an array of s. + This is the implementation that s use by default. + + Coordinates returned by , and are live -- + modifications to them are actually changing the + CoordinateSequence's underlying data. + A dimension may be specified for the coordinates in the sequence, + which may be 2 or 3. + The actual coordinates will always have 3 ordinates, + but the dimension is useful as metadata in some situations. + + + + The actual dimension of the coordinates in the sequence. + Allowable values are 2 or 3. + + + + Constructs a sequence based on the given array of s. + The coordinate dimension is 3 + + + The array is not copied. + + The coordinate array that will be referenced. + + + + Constructs a sequence based on the given array + of s. + + The Array is not copied + The coordinate array that will be referenced. + The dimension of the coordinates + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Constructs a sequence of a given , populated + with new s of the given . + + The size of the sequence to create. + the dimension of the coordinates + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Get the Coordinate with index i. + + The index of the coordinate. + The requested Coordinate instance. + + + + Get a copy of the Coordinate with index i. + + The index of the coordinate. + A copy of the requested Coordinate. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Creates a deep copy of the object. + + The deep copy. + + + + + + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + This method exposes the internal Array of Coordinate Objects. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the string representation of the coordinate array. + + + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the length of the coordinate sequence. + + + + + Creates CoordinateSequences represented as an array of Coordinates. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Returns the singleton instance of CoordinateArraySequenceFactory. + + + + + A list of Coordinates, which may + be set to prevent repeated coordinates from occuring in the list. + + + + + Constructs a new list without any coordinates + + + + + Constructs a new list from an array of Coordinates, allowing repeated points. + (I.e. this constructor produces a with exactly the same set of points + as the input array.) + + Initial coordinates + + + + Constructs a new list from a collection of Coordinates, + allows repeated points. + + Collection of coordinates to load into the list. + + + + Constructs a new list from a collection of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Collection of coordinates to load into the list. + If false, repeated points are removed. + + + + Constructs a new list from an array of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Array of coordinates to load into the list. + If false, repeated points are removed. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Adds a section of an array of coordinates to the list. + + The coordinates + If set to false, repeated coordinates are collapsed + The index to start from + The index to add up to but not including + true (as by general collection contract) + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + If false, the array is added in reverse order. + Return true. + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the list. + + Coordinate to be inserted, as object. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the end of this list. + + Coordinate to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if all ok. + + + + Inserts the specified coordinate at the specified position in this list. + + The position at which to insert + the coordinate to insert + if set to false, repeated coordinates are collapsed + + + + Add an array of coordinates. + + Coordinates collection to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if at least one element has added (IList not empty). + + + + Ensure this coordList is a ring, by adding the start point if necessary. + + + + + Returns the Coordinates in this collection. + + Coordinater as Coordinate[] array. + + + + Returns a deep copy of this collection. + + The copied object. + + + + Compares two s. + + + For sequences of the same dimension, the ordering is lexicographic. + Otherwise, lower dimensions are sorted before higher. + The dimensions compared can be limited; if this is done + ordinate dimensions above the limit will not be compared. + + + If different behaviour is required for comparing size, dimension, + or coordinate values, any or all methods can be overridden. + + + + + Compare two doubles, allowing for NaN values. + NaN is treated as being less than any valid number. + + A double + A double + -1, 0, or 1 depending on whether a is less than, equal to or greater than b + + + The number of dimensions to test + + + Creates a comparator which will test all dimensions. + + + + + @param dimensionLimit + Creates a comparator which will test only the specified number of dimensions. + The number of dimensions to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 + + + + Compares the same coordinate of two s + + A coordinate sequence + A coordinate sequence + The index of the coordinate to test + the number of dimensiosn to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 + + + + Utility functions for manipulating s. + + + + + Reverses the coordinates in a sequence in-place. + + + + + + Swaps two coordinates in a sequence. + + seq the sequence to modify + the index of a coordinate to swap + the index of a coordinate to swap + + + + Copies a section of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinates from + The starting index of the coordinates to copy + The sequence to which the coordinates should be copied to + The starting index of the coordinates in + The number of coordinates to copy + + + + Copies a coordinate of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinate from + The index of the coordinate to copy + The sequence to which the coordinate should be copied to + The index of the coordinate in + + + + Tests whether a forms a valid , + by checking the sequence length and closure + (whether the first and last points are identical in 2D). + Self-intersection is not checked. + + The sequence to test + True if the sequence is a ring + + + + + Ensures that a CoordinateSequence forms a valid ring, + returning a new closed sequence of the correct length if required. + If the input sequence is already a valid ring, it is returned + without modification. + If the input sequence is too short or is not closed, + it is extended with one or more copies of the start point. + + The CoordinateSequenceFactory to use to create the new sequence + The sequence to test + The original sequence, if it was a valid ring, or a new sequence which is valid. + + + + Tests whether two s are equal. + To be equal, the sequences must be the same length. + They do not need to be of the same dimension, + but the ordinate values for the smallest dimension of the two + must be equal. + Two NaN ordinates values are considered to be equal. + + a CoordinateSequence + a CoordinateSequence + true if the sequences are equal in the common dimensions + + + + Creates a string representation of a . + The format is: + + ( ord0,ord1.. ord0,ord1,... ... ) + + + the sequence to output + the string representation of the sequence + + + + The CoordinateSequence implementation that Geometries use by default. In + this implementation, Coordinates returned by ToArray and GetCoordinates are live -- + parties that change them are actually changing the + DefaultCoordinateSequence's underlying data. + + + + + Constructs a DefaultCoordinateSequence based on the given array (the + array is not copied). + + Coordinate array that will be assimilated. + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns a copy of the coordinate at specified index. + + Coordinate index. + The copy of the coordinate specified. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns a deep copy of the object passed. + + The copied object. + + + + This method exposes the internal Array of Coordinate Objects. + + Coordinate[] array. + + + + Returns the string Representation of the coordinate array + + A string. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns the elements number of the coordinate sequence. + + + + + + Returns the elements number of the coordinate sequence. + + The length. + + + + Creates CoordinateSequences internally represented + as an array of x's and an array of y's. + + + + + + + + + + Returns a DefaultCoordinateSequence based on the given array + (the array is not copied). + + Coordinates array, which may not be null + nor contain null elements + Singleton instance of DefaultCoordinateSequenceFactory. + + + + Returns the singleton instance of DefaultCoordinateSequenceFactory. + + Singleton instance of DefaultCoordinateSequenceFactory. + + + + A coordinate sequence that follows the dotspatial shape range + + + + + Creates an instance of this class + + The + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The number of dimensions. + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The kind of ordinates. + + + + Creates a sequence based on the given coordinate sequence. + + The coordinate sequence. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Releases the weak reference to the weak referenced coordinate array + + This is necessary if you modify the values of the , , arrays externally. + + + + Gets the vector with x- and y-ordinate values; + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with z-ordinate values + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with measure values + + If you modify the values of this vector externally, you need to call ! + + + + A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, + and can be set. + + A coordinate sequence. + + + + Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. + + + + + + Gets the Ordinate flags that sequences created by this factory can cope with. + + + + + Basic implementation of GeometryCollection. + + + + + Represents an empty GeometryCollection. + + + + + Internal representation of this GeometryCollection. + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + For create this is used a standard + with == . + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a GeometryCollectionEnumerator: + this IEnumerator returns the parent geometry as first element. + In most cases is more useful the code + geometryCollectionInstance.Geometries.GetEnumerator(): + this returns an IEnumerator over geometries composing GeometryCollection. + + + + + + Creates a with + every component reversed. + The order of the components in the collection are not reversed. + + A in the reverse order + + + + + + + + + Collects all coordinates of all subgeometries into an Array. + Note that while changes to the coordinate objects themselves + may modify the Geometries in place, the returned Array as such + is only a temporary container which is not synchronized back. + + The collected coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "GeometryCollection" + + + + Gets the OGC geometry type + + + + + + + + + + Returns the area of this GeometryCollection. + + + + + Returns the length of this GeometryCollection. + + + + + Return true if all features in collection are of the same type. + + + + + Returns the iTh element in the collection. + + + + + + + Returns the number of geometries contained by this . + + + + + Iterates over all Geometry's in a GeometryCollection. + Implements a pre-order depth-first traversal of the GeometryCollection + (which may be nested). The original GeometryCollection is + returned as well (as the first object), as are all sub-collections. It is + simple to ignore the GeometryCollection objects if they are not + needed. + + + + + The GeometryCollection being iterated over. + + + + + Indicates whether or not the first element (the GeometryCollection) + has been returned. + + + + + The number of Geometrys in the the GeometryCollection. + + + + + The index of the Geometry that will be returned when next + is called. + + + + + The iterator over a nested GeometryCollection, or null + if this GeometryCollectionIterator is not currently iterating + over a nested GeometryCollection. + + + + + Constructs an iterator over the given GeometryCollection. + + + The collection over which to iterate; also, the first + element returned by the iterator. + + + + + + + + + + + + + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + + + The parent GeometryCollection is the first object returned! + + + + Models an OGC SFS LinearRing. + + + A LinearRing is a which is both closed and simple. + In other words, + the first and last coordinate in the ring must be equal, + and the interior of the ring must not self-intersect. + Either orientation of the ring is allowed. + + A ring must have either 0 or 4 or more points. + The first and last points must be equal (in 2D). + If these conditions are not met, the constructors throw + an + + + + + Models an OGC-style LineString + + + A LineString consists of a sequence of two or more vertices, + along with all points along the linearly-interpolated curves + (line segments) between each + pair of consecutive vertices. + Consecutive vertices may be equal. + The line segments in the line may intersect each other (in other words, + the linestring may "curl back" in itself and self-intersect. + Linestrings with exactly two identical points are invalid. + A linestring must have either 0 or 2 or more points. + If these conditions are not met, the constructors throw an . + + + + + + Represents an empty LineString. + + + + + The points of this LineString. + + + + + + + + + + + + + + + + + + + Creates a whose coordinates are in the reverse order of this objects. + + A with coordinates in the reverse order. + + + + Returns true if the given point is a vertex of this LineString. + + The Coordinate to check. + true if pt is one of this LineString's vertices. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalizes a LineString. A normalized linestring + has the first point which is not equal to it's reflected point + less than the reflected point. + + + + + + + + + + + + Initializes a new instance of the class. + + + For create this is used a standard + with == . + + The coordinates used for create this . + If too few points are provided + + + + Initializes a new instance of the class. + + + The points of the linestring, or null + to create the empty point. Consecutive points may not be equal. + + + If too few points are provided + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "LineString" + + + + Returns the length of this LineString + + The length of the polygon. + + + + + + + + + + + + + + + + + Returns the value of the angle between the + and the . + + + + + The minimum number of vertices allowed in a valid non-empty ring (= 4). + Empty rings with 0 vertices are also valid. + + + + + Constructs a LinearRing with the given points. + + + Points forming a closed and simple linestring, or + null or an empty array to create the empty point. + This array must not contain null elements. + + + If the ring is not closed, or has too few points + + + + + + + + + Initializes a new instance of the class. + + The points used for create this instance. + + For create this is used a standard + with == . + + If the ring is not closed, or has too few points + + + + Returns Dimensions.False, since by definition LinearRings do not have a boundary. + + + + + Returns the name of this object's interface. + + "LinearRing" + + + + Represents a line segment defined by two Coordinates. + Provides methods to compute various geometric properties + and relationships of line segments. + This class is designed to be easily mutable (to the extent of + having its contained points public). + This supports a common pattern of reusing a single LineSegment + object as a way of computing segment properties on the + segments defined by arrays or lists of Coordinates. + + + + + Creates an instance of this class using two coordinates + + The start-point + The end-point + + + + Creates an instance of this class using another instance + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the orientation of a LineSegment relative to this segment. + The concept of orientation is specified as follows: + Given two line segments A and L, + A is to the left of a segment L if A lies wholly in the + closed half-plane lying to the left of L + A is to the right of a segment L if A lies wholly in the + closed half-plane lying to the right of L + otherwise, A has indeterminate orientation relative to L. This + happens if A is collinear with L or if A crosses the line determined by L. + + The LineSegment to compare. + + 1 if seg is to the left of this segment, + -1 if seg is to the right of this segment, + 0 if seg is collinear to or crosses this segment. + + + + + Determines the orientation index of a relative to this segment. + The orientation index is as defined in . + + + + + 1 if p is to the left of this segment + -1 if p is to the right of this segment + 0 if p is collinear with this segment + " + + + + + + Reverses the direction of the line segment. + + + + + Puts the line segment into a normalized form. + This is useful for using line segments in maps and indexes when + topological equality rather than exact equality is desired. + + + + + Computes the distance between this line segment and another one. + + + + + + + Computes the distance between this line segment and a point. + + + + + Computes the perpendicular distance between the (infinite) line defined + by this line segment and a point. + + + + + + + Computes the that lies a given + fraction along the line defined by this segment. + + + A fraction of 0.0 returns the start point of the segment; + A fraction of 1.0 returns the end point of the segment. + If the fraction is < 0.0 or > 1.0 the point returned + will lie before the start or beyond the end of the segment. + + the fraction of the segment length along the line + the point at that distance + + + + Computes the that lies a given + + + A fraction along the line defined by this segment and offset from + the segment by a given distance. + A fraction of 0.0 offsets from the start point of the segment; + A fraction of 1.0 offsets from the end point of the segment. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + + the fraction of the segment length along the line + the distance the point is offset from the segment + (positive is to the left, negative is to the right) + the point at that distance and offset + if the segment has zero length + + + Computes the Projection Factor for the projection of the point p + onto this LineSegment. The Projection Factor is the constant r + by which the vector for this segment must be multiplied to + equal the vector for the projection of p on the line + defined by this segment. + + The projection factor will lie in the range (-inf, +inf), + or be NaN if the line segment has zero length. + + The point to compute the factor for + The projection factor for the point + + + + Computes the fraction of distance (in [0.0, 1.0]) + that the projection of a point occurs along this line segment. + If the point is beyond either ends of the line segment, + the closest fractional value (0.0 or 1.0) is returned. + + + Essentially, this is the clamped to + the range [0.0, 1.0]. + + the point + the fraction along the line segment the projection of the point occurs + + + + Compute the projection of a point onto the line determined + by this line segment. + Note that the projected point may lie outside the line segment. + If this is the case, the projection factor will lie outside the range [0.0, 1.0]. + + + + + + + Project a line segment onto this line segment and return the resulting + line segment. The returned line segment will be a subset of + the target line line segment. This subset may be null, if + the segments are oriented in such a way that there is no projection. + Note that the returned line may have zero length (i.e. the same endpoints). + This can happen for instance if the lines are perpendicular to one another. + + The line segment to project. + The projected line segment, or null if there is no overlap. + + + + Computes the closest point on this line segment to another point. + + The point to find the closest point to. + + A Coordinate which is the closest point on the line segment to the point p. + + + + + Computes the closest points on a line segment. + + + + A pair of Coordinates which are the closest points on the line segments. + + + + + Computes an intersection point between two segments, if there is one. + There may be 0, 1 or many intersection points between two segments. + If there are 0, null is returned. If there is 1 or more, a single one + is returned (chosen at the discretion of the algorithm). If + more information is required about the details of the intersection, + the {RobustLineIntersector} class should be used. + + A line segment + An intersection point, or null if there is none. + + + + + Computes the intersection point of the lines defined by two segments, if there is one. + + + There may be 0, 1 or an infinite number of intersection points between two lines. + If there is a unique intersection point, it is returned. + Otherwise, null is returned. + If more information is required about the details of the intersection, + the class should be used. + + A line segment defining a straight line + An intersection point, or null if there is none or an infinite number + + + + + Creates a LineString with the same coordinates as this segment + + the geometery factory to use + A LineString with the same geometry as this segment + + + + Returns true if o has the same values for its points. + + A LineSegment with which to do the comparison. + + true if o is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + + + + + + + + + + Compares this object with the specified object for order. + Uses the standard lexicographic ordering for the points in the LineSegment. + + + The LineSegment with which this LineSegment + is being compared. + + + A negative integer, zero, or a positive integer as this LineSegment + is less than, equal to, or greater than the specified LineSegment. + + + + + Returns true if other is + topologically equal to this LineSegment (e.g. irrespective + of orientation). + + + A LineSegment with which to do the comparison. + + + true if other is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + Return HashCode. + + + + + The end-point + + + + + The start-point + + + + + Gets the minimum X ordinate + + + + + Gets the maximum X ordinate + + + + + Gets the minimum Y ordinate + + + + + Gets the maximum Y ordinate + + + + + Computes the length of the line segment. + + The length of the line segment. + + + + Tests whether the segment is horizontal. + + true if the segment is horizontal. + + + + Tests whether the segment is vertical. + + true if the segment is vertical. + + + + The angle this segment makes with the x-axis (in radians). + + + + The midpoint of the segment + + + + Basic implementation of MultiLineString. + + + + + Represents an empty MultiLineString. + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + For create this is used a standard + with == . + + + + + Creates a in the reverse order to this object. + Both the order of the component LineStrings + and the order of their coordinate sequences are reversed. + + a in the reverse order. + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiLineString" + + + + Gets the OGC geometry type + + + + + Gets a value indicating whether this instance is closed. + + true if this instance is closed; otherwise, false. + + + + Models a collection of Points. + + + + + Represents an empty MultiPoint. + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + For create this is used a standard + with == . + + + + + + + + + + + + + Returns the Coordinate at the given position. + + The index of the Coordinate to retrieve, beginning at 0. + + The nth Coordinate. + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPoint" + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + Basic implementation of MultiPolygon. + + + + + Represents an empty MultiPolygon. + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + For create this is used a standard + with == . + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + + + + + + + + + + + Creates a {@link MultiPolygon} with every component reversed. + + The order of the components in the collection are not reversed. + An in the reverse order + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPolygon" + + + + + + + + + A bounding container for a which is in the shape of a general octagon. + + + The OctagonalEnvelope of a geometric object + is a geometry which is tight bound along the (up to) four extremal rectilineal parallels + and along the (up to) four extremal diagonal parallels. + Depending on the shape of the contained + geometry, the octagon may be degenerate to any extreme + (e.g. it may be a rectangle, a line, or a point). + + + + + Gets the octagonal envelope of a geometry + + The geometry + The octagonal envelope of the geometry + + + + Creates a new null bounding octagon + + + + + Creates a new null bounding octagon bounding a + + The coordinate to bound + + + + Creates a new null bounding octagon bounding a pair of s + + A coordinate to bound + A coordinate to bound + + + + Creates a new null bounding octagon bounding an + + + + + Creates a new null bounding octagon bounding an + (the copy constructor). + + + + + Creates a new null bounding octagon bounding a + + + + + Sets the value of this object to the null value + + + + + Tests if the extremal values for this octagon are valid. + + @return true if this object has valid values + + + + + A CoordinateSequence implementation based on a packed arrays. + A CoordinateSequence implementation based on a packed arrays. + + + + + A soft reference to the Coordinate[] representation of this sequence. + Makes repeated coordinate array accesses more efficient. + + + + + The dimensions of the coordinates hold in the packed array + + + + + The ordinates + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + + A copy of the i'th coordinate in the sequence + + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. + Note that if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + + + + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the first ordinate of a coordinate in this sequence. + + + + + + + Sets the second ordinate of a coordinate in this sequence. + + + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on doubles. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on floats. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked: + if it is over dimensions you may not get an exception but a meaningless value. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Builds packed array coordinate sequences. The array data type can be either + double or float, and defaults to double. + + + + + Initializes a new instance of the class, + using double values. + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + + + + + + Returns a CoordinateSequence based on the given array; whether or not the + array is copied is implementation-dependent. + + Coordinates array, which may not be null nor contain null elements + + + + + Returns a CoordinateSequence based on the given coordinate sequence; whether or not the + array is copied is implementation-dependent. + + + + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates + + The ordinates each coordinate has. is fix, and can be set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a single point. + + A Point is topologically valid if and only if: + + The coordinate which defines it if any) is a valid coordinate + (i.e. does not have an NaN X- or Y-ordinate + + + + + + + Represents an empty Point. + + + + + The Coordinate wrapped by this Point. + + + + + Initializes a new instance of the class. + + The coordinate used for create this . + + For create this is used a standard + with == . + + + + + Constructs a Point with the given coordinate. + + + Contains the single coordinate on which to base this Point, + or null to create the empty point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + The z coordinate. + /// + For create this is used a standard + with set to . + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + /// + For create this is used a standard + with set to . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Point" + + + + Gets the OGC geometry type + + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + + + + + + Represents a polygon with linear edges, which may include holes. + The outer boundary (shell) + and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. + The boundary rings of the polygon may have any orientation. + Polygons are closed, simple geometries by definition. + + The polygon model conforms to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + A Polygon is topologically valid if and only if: + + the coordinates which define it are valid coordinates + the linear rings for the shell and holes are valid + (i.e. are closed and do not self-intersect) + holes touch the shell or another hole at at most one point + (which implies that the rings of the shell and holes must not cross) + the interior of the polygon is connected, + or equivalently no sequence of touching holes + makes the interior of the polygon disconnected + (i.e. effectively split the polygon into two pieces). + + + + + + Represents an empty Polygon. + + + + + The exterior boundary, or null if this Polygon + is the empty point. + + + + + The interior boundaries, if any. + + + + + Initializes a new instance of the class. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + For create this is used a standard + with == . + + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Polygon" + + + + Returns the area of this Polygon + + + + + + Returns the perimeter of this Polygon. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the precision model of the Coordinates in a Geometry. + In other words, specifies the grid of allowable + points for all Geometrys. + + + The MakePrecise method allows rounding a coordinate to + a "precise" value; that is, one whose + precision is known exactly. + Coordinates are assumed to be precise in geometries. + That is, the coordinates are assumed to be rounded to the + precision model given for the point. + NTS input routines automatically round coordinates to the precision model + before creating Geometries. + All internal operations + assume that coordinates are rounded to the precision model. + Constructive methods (such as bool operations) always round computed + coordinates to the appropriate precision model. + Currently three types of precision model are supported: + + Floating: represents full double precision floating point. + This is the default precision model used in NTS + FloatingSingle: represents single precision floating point. + Fixed: represents a model with a fixed number of decimal places. + + A Fixed Precision Model is specified by a scale factor. + The scale factor specifies the size of the grid which numbers are rounded to. + Input coordinates are mapped to fixed coordinates according to the following + equations: + + jtsPt.x = round( (inputPt.x * scale ) / scale + jtsPt.y = round( (inputPt.y * scale ) / scale + + + For example, to specify 3 decimal places of precision, use a scale factor + of 1000. To specify -3 decimal places of precision (i.e. rounding to + the nearest 1000), use a scale factor of 0.001. + + Coordinates are represented internally as Java double-precision values. + Since .NET uses the IEEE-394 floating point standard, this + provides 53 bits of precision. (Thus the maximum precisely representable + integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). + + NTS binary methods currently do not handle inputs which have different precision models. + The precision model of any constructed geometric value is undefined. + + + + + The maximum precise value representable in a double. Since IEE754 + double-precision numbers allow 53 bits of mantissa, the value is equal to + 2^53 - 1. This provides almost 16 decimal digits of precision. + + + + + Determines which of two s is the most precise + + A precision model + A precision model + The PrecisionModel which is most precise + + + + The type of PrecisionModel this represents. + + + + + The scale factor which determines the number of decimal places in fixed precision. + + + + + Creates a PrecisionModel with a default precision + of Floating. + + + + + Creates a PrecisionModel that specifies + an explicit precision model type. + If the model type is Fixed the scale factor will default to 1. + + + The type of the precision model. + + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate + + Not used. + Not used. + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate. + + + + + Copy constructor to create a new PrecisionModel + from an existing one. + + + + + + Return HashCode. + + + + + Sets internal to the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the + precise representation of external. + + + + + Returns the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the precise + representation of external + + + + + Returns the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Sets external to the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Rounds a numeric value to the PrecisionModel grid. + Symmetric Arithmetic Rounding is used, to provide + uniform rounding behaviour no matter where the number is + on the number line. + + + This method has no effect on NaN values + + + + + + Rounds a Coordinate to the PrecisionModel grid. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compares this PrecisionModel object with the specified object for order. + A PrecisionModel is greater than another if it provides greater precision. + The comparison is based on the value returned by the + {getMaximumSignificantDigits) method. + This comparison is not strictly accurate when comparing floating precision models + to fixed models; however, it is correct when both models are either floating or fixed. + + + The PrecisionModel with which this PrecisionModel + is being compared. + + + A negative integer, zero, or a positive integer as this PrecisionModel + is less than, equal to, or greater than the specified PrecisionModel. + + + + + + + + + + + + Tests whether the precision model supports floating point. + + true if the precision model supports floating point. + + + + Returns the maximum number of significant digits provided by this + precision model. + Intended for use by routines which need to print out precise values. + + + The maximum number of decimal places provided by this precision model. + + + + + Returns the scale factor used to specify a fixed precision model. + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + The scale factor for the fixed precision model + + + + + Gets the type of this PrecisionModel. + + + + + + Returns the x-offset used to obtain a precise coordinate. + + + The amount by which to subtract the x-coordinate before + multiplying by the scale. + + + + + Returns the y-offset used to obtain a precise coordinate. + + + The amount by which to subtract the y-coordinate before + multiplying by the scale + + + + + A base class containing the logic for computes the contains + and covers spatial relationship predicates + for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + Contains and covers are very similar, and differ only in how certain + cases along the boundary are handled. These cases require + full topological evaluation to handle, so all the code in + this class is common to both predicates. + + + It is not possible to short-circuit in all cases, in particular + in the case where line segments of the test geometry touches the polygon linework. + In this case full topology must be computed. + (However, if the test geometry consists of only points, this + can be evaluated in an optimized fashion. + + + Martin Davis + + + + A base class for predicate operations on s. + + mbdavis + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether all components of the test Geometry are contained in the target geometry. + + Handles both linear and point components. + A geometry to test + + true if all componenta of the argument are contained in the target geometry + + + + + Tests whether all components of the test Geometry are contained in the interior of the target geometry. + + Handles both linear and point components. + A geometry to test + true if all componenta of the argument are contained in the target geometry interior + + + + Tests whether any component of the test Geometry intersects the area of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry + + + + Tests whether any component of the test Geometry intersects the interior of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry interior + + + + Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) + + The test geometry + The representative points of the target geometry + true if any component intersects the areal test geometry + + + This flag controls a difference between contains and covers. + + For contains the value is true. + For covers the value is false. + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Evaluate the contains or covers relationship + for the given geometry. + + the test geometry + true if the test geometry is contained + + + + Tests whether a geometry consists of a single polygon with no holes. + + True if the geometry is a single polygon with no holes + + + + Computes the full topological predicate. + Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon has the relationship with the test geometry + + + + A base class for subclasses. + + + Contains default implementations for methods, which simply delegate to the equivalent methods. + This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. + + Martin Davis + + + + Tests whether any representative of the target geometry intersects the test geometry. + This is useful in A/A, A/L, A/P, L/P, and P/P cases. + + The test geometry + true if any component intersects the areal test geometry + + + + Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. + + A geometry + true if the envelopes intersect + + + + Determines whether the envelope of this geometry covers the Geometry g. + + A geometry + true if g is contained in this envelope + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + Default implementation. + + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + Default implementation. + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + Default implementation. + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + Default implementation. + + + + Tests whether the base is disjoint from given geometry. + + The geometry to test + true if this geometry is disjoint from the given geometry + + Default implementation. + + + + Tests whether the base intersects a given geometry. + + The geometry to test + true if this geometry intersects the given geometry + + Default implementation. + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + Default implementation. + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + Default implementation. + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + Default implementation. + + + + Gets the list of representative points for this geometry. + One vertex is included for every component of the geometry + (i.e. including one for every ring of polygonal geometries). + + Do not modify the returned list! + + + + + A factory for creating s. It chooses an appropriate implementation of PreparedGeometry + based on the geoemtric type of the input geometry. + + + In the future, the factory may accept hints that indicate + special optimizations which can be performed. + + Martin Davis + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + mbdavis + + + + Computes the intersects spatial relationship predicate + for a target relative to other classes. + + + Uses short-circuit tests and indexing to improve performance. + + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared linestring + A test geometry + true if the linestring intersects the geometry + + + + Creates an instance of this operation. + + The target PreparedLineString + + + + Tests whether this geometry intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Tests whether any representative point of the test Geometry intersects + the target geometry. + + + Only handles test geometries which are Puntal (dimension 0) + + A Puntal geometry to test + true if any point of the argument intersects the prepared geometry + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + Martin Davis + + + + Tests whether this point intersects a . + + + The optimization here is that computing topology for the test geometry + is avoided. This can be significant for large geometries. + + + + + A prepared version for geometries. + This class supports both s and s. + This class does not support MultiPolygons which are non-valid + (e.g. with overlapping elements). + + + Instances of this class are thread-safe and immutable. + + mbdavis + + + + Computes the contains spatial relationship predicate for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + It is not possible to short-circuit in all cases, in particular + in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + + Martin Davis + + + + Computes the contains spatial relationship predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon contains the geometry + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon contains a given geometry. + + The test geometry + true if the test geometry is contained + + + + Computes the full topological contains predicate.
+ Used when short-circuit tests are not conclusive. +
+ The test geometry + true if this prepared polygon contains the test geometry +
+ + + Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
+ Uses short-circuit tests and indexing to improve performance. +
+ + + A Geometry A containsProperly another Geometry B iff + all points of B are contained in the Interior of A. + Equivalently, B is contained in A AND B does not intersect + the Boundary of A. + + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + In a situation with many geometries intersecting the boundary + of the target geometry, this can make a performance difference. + + + Martin Davis +
+ + Computes the containsProperly predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon properly contains the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon containsProperly a given geometry. + + The test geometry + true if the polygon properly contains the geometry + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + + Uses short-circuit tests and indexing to improve performance. + + It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + Martin Davis + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + The prepared polygon + A test geometry + true if the polygon covers the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon covers a given geometry. + + The test geometry + true if the test geometry is covered + + + + Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon covers the test geometry + + + + Computes the intersects spatial relationship predicate + for s relative to all other classes. + + Uses short-circuit tests and indexing to improve performance. + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared polygon + A test geometry + true if the polygon intersects the geometry + + + + Creates an instance of this operation. + + The prepared polygon + + + + Tests whether this PreparedPolygon intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Indicates an invalid or inconsistent topological situation encountered during processing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a planar triangle, and provides methods for calculating various + properties of triangles. + + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + + Tests whether a triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 degrees. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + True if the triangle is acute. + + + + Computes the line which is the perpendicular bisector of the + + A point + Another point + The perpendicular bisector, as an HCoordinate line segment a-b. + + + Computes the circumcentre of a triangle. + + The circumcentre is the centre of the circumcircle, + the smallest circle which encloses the triangle. + It is also the common intersection point of the + perpendicular bisectors of the sides of the triangle, + and is the only point which has equal distance to all three + vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. For example, + the circumcentre of an obtuse isoceles triangle lies outside the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The circumcentre of the triangle + + + + Computes the determinant of a 2x2 matrix. Uses standard double-precision + arithmetic, so is susceptible to round-off error. + + the [0,0] entry of the matrix + the [0,1] entry of the matrix + the [1,0] entry of the matrix + the [1,1] entry of the matrix + The determinant + + + + Computes the incentre of a triangle. + + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + It is also the point at which the bisectors of the triangle's angles meet. + It is the centre of the triangle's InCircle, which is the unique circle + that is tangent to each of the triangle's three sides. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point which is the incentre of the triangle + + + Computes the centroid (centre of mass) of a triangle. + + This is also the point at which the triangle's three + medians intersect (a triangle median is the segment from a vertex of the triangle to the + midpoint of the opposite side). + The centroid divides each median in a ratio of 2:1. + The centroid always lies within the triangle. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The centroid of the triangle + + + Computes the length of the longest side of a triangle + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The length of the longest side of the triangle + + + Computes the point at which the bisector of the angle ABC cuts the segment AC. + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The angle bisector cut point + + + + Computes the 2D area of a triangle. + The area value is always non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + Computes the signed 2D area of a triangle. + + + + The area value is positive if the triangle is oriented CW, + and negative if it is oriented CCW. + + + The signed area value can be used to determine point orientation, but + the implementation in this method is susceptible to round-off errors. + Use for robust orientation + calculation. + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + + Computes the 3D area of a triangle. + The value computed is alway non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The 3D area of the triangle + + + + Computes the Z-value (elevation) of an XY point + on a three-dimensional plane defined by a triangle + whose vertices have Z-values. + The defining triangle must not be degenerate + (in other words, the triangle must enclose a + non-zero area), + and must not be parallel to the Z-axis. + + This method can be used to interpolate + the Z-value of a point inside a triangle + (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + The computed Z-value (elevation) of the point + + + + Creates a new triangle with the given vertices. + + A vertex + A vertex + A vertex + + + + Computes the InCentre of this triangle + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + This is also the point at which the bisectors of the angles meet. + It is the centre of the triangle's InCircle, + which is the unique circle that is tangent to each of the triangle's three sides. + + + The point which is the InCentre of the triangle. + + + + + Tests whether this triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 + degrees. + + true if this triangle is acute + + + + Computes the circumcentre of this triangle. The circumcentre is the centre + of the circumcircle, the smallest circle which encloses the triangle. It is + also the common intersection point of the perpendicular bisectors of the + sides of the triangle, and is the only point which has equal distance to + all three vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + The circumcentre of this triangle + + + + Computes the centroid (centre of mass) of this triangle. This is also the + point at which the triangle's three medians intersect (a triangle median is + the segment from a vertex of the triangle to the midpoint of the opposite + side). The centroid divides each median in a ratio of 2:1. + + The centroid always lies within the triangle. + + The centroid of this triangle + + + + Computes the length of the longest side of this triangle + + The length of the longest side of this triangle + + + + Computes the 2D area of this triangle. The area value is always + non-negative. + + The area of this triangle + + + + + Computes the signed 2D area of this triangle. The area value is positive if + the triangle is oriented CW, and negative if it is oriented CCW. + + The signed area value can be used to determine point orientation, but the + implementation in this method is susceptible to round-off errors. Use + + for robust orientation calculation. + + The signed 2D area of this triangle + + + + + Computes the 3D area of this triangle. The value computed is alway + non-negative. + + The 3D area of this triangle + + + + Computes the Z-value (elevation) of an XY point on a three-dimensional + plane defined by this triangle (whose vertices must have Z-values). This + triangle must not be degenerate (in other words, the triangle must enclose + a non-zero area), and must not be parallel to the Z-axis. + + This method can be used to interpolate the Z-value of a point inside this + triangle (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + The computed Z-value (elevation) of the point + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + Represents an affine transformation on the 2D Cartesian plane. + + + + It can be used to transform a or . + An affine transformation is a mapping of the 2D plane into itself + via a series of transformations of the following basic types: +
    +
  • reflection (through a line)
  • +
  • rotation (around the origin)
  • +
  • scaling (relative to the origin)
  • +
  • shearing (in both the X and Y directions)
  • +
  • translation
  • +
+
+ + In general, affine transformations preserve straightness and parallel lines, + but do not preserve distance or shape. + + + An affine transformation can be represented by a 3x3 + matrix in the following form: +
+            T = | m00 m01 m02 |
+                | m10 m11 m12 |
+                |  0   0   1  |
+            
+ A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') + by representing it as a 3x1 matrix and using matrix multiplication to compute: +
+            | x' |  = T x | x |
+            | y' |        | y |
+            | 1  |        | 1 |
+            
+
+

Transformation Composition

+ + Affine transformations can be composed using the method. + Composition is computed via multiplication of the + transformation matrices, and is defined as: +
+            A.compose(B) = TB x TA
+            
+
+ + This produces a transformation whose effect is that of A followed by B. + The methods , , + , , and + have the effect of composing a transformation of that type with + the transformation they are invoked on. + The composition of transformations is in general not commutative. + +

Transformation Inversion

+ + Affine transformations may be invertible or non-invertible. + If a transformation is invertible, then there exists + an inverse transformation which when composed produces + the identity transformation. + The method + computes the inverse of a transformation, if one exists. + + + @author Martin Davis + +
+
+ + + Creates a transformation for a reflection about the + line (x0,y0) - (x1,y1). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + the x-ordinate of a another point on the reflection line + the y-ordinate of a another point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a reflection about the + line (0,0) - (x,y). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a rotation + about the origin + by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + a transformation for the rotation + + + + Creates a transformation for a rotation + by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a scaling relative to the origin. + + the value to scale by in the x direction + the value to scale by in the y direction + a transformation for the scaling + + + + Creates a transformation for a scaling relative to the point (x,y). + + The value to scale by in the x direction + The value to scale by in the y direction + The x-ordinate of the point to scale around + The y-ordinate of the point to scale around + A transformation for the scaling + + + + Creates a transformation for a shear. + + the value to shear by in the x direction + the value to shear by in the y direction + a tranformation for the shear + + + + Creates a transformation for a translation. + + the value to translate by in the x direction + the value to translate by in the y direction + a tranformation for the translation + + + + Constructs a new identity transformation + + + + + Constructs a new transformation whose + matrix has the specified values. + + an array containing the 6 values { m00, m01, m02, m10, m11, m12 } + if matrix is null + if matrix is too small + + + + Constructs a new transformation whose + matrix has the specified values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + + + + Constructs a transformation which is + a copy of the given one. + + the transformation to copy + + + + Constructs a transformation + which maps the given source + points into the given destination points. + + source point 0 + source point 1 + source point 2 + the mapped point for source point 0 + the mapped point for source point 1 + the mapped point for source point 2 + + + + Sets this transformation to be the identity transformation. + + + The identity transformation has the matrix: +
+            | 1 0 0 |
+            | 0 1 0 |
+            | 0 0 1 |
+            
+
+ this transformation, with an updated matrix +
+ + + Sets this transformation's matrix to have the given values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + this transformation, with an updated matrix + + + + Sets this transformation to be a copy of the given one + + a transformation to copy + this transformation, with an updated matrix + + + + Computes the inverse of this transformation, if one + exists. + + + + * The inverse is the transformation which when + * composed with this one produces the identity + * transformation. + * A transformation has an inverse if and only if it + * is not singular (i.e. its + * determinant is non-zero). + * Geometrically, an transformation is non-invertible + * if it maps the plane to a line or a point. + * If no inverse exists this method + * will throw a . + + + * The matrix of the inverse is equal to the + * inverse of the matrix for the transformation. + * It is computed as follows: + *
+            *                 1
+            * inverse(A)  =  ---   x  adjoint(A)
+            *                det
+            *
+            *
+            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
+            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
+            *                det      |  0     0     m00*m11-m10*m01  |
+            *
+            *
+            *
+            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
+            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
+            *               |   0           0          1               |
+            *
+            * 
+
+
+ A new inverse transformation + + +
+ + + Explicitly computes the math for a reflection. May not work. + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection + about the line defined by vector (x,y). + + + The transformation for a reflection + is computed by: +
+            d = sqrt(x2 + y2)
+            sin = x / d;
+            cos = x / d;
+            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
+            
+
+ the x-component of the reflection line vector + the y-component of the reflection line vector + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the orign. + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle theta + has the value: +
+            |  cos(theta)  -sin(theta)   0 |
+            |  sin(theta)   cos(theta)   0 |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the origin + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   0 |
+            |  sinTheta   cosTheta   0 |
+            |         0          0   1 |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y). + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y) + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |         0          0         1       |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a scaling. + + + The transformation matrix for a scale + has the value: +
+            |  xScale      0  dx |
+            |  1      yScale  dy |
+            |  0           0   1 |
+            
+
+ the amount to scale x-ordinates by + the amount to scale y-ordinates by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a shear. + + + The transformation matrix for a shear + has the value: +
+            |  1      xShear  0 |
+            |  yShear      1  0 |
+            |  0           0  1 |
+            
+ Note that a shear of (1, 1) is not + equal to shear(1, 0) composed with shear(0, 1). + Instead, shear(1, 1) corresponds to a mapping onto the + line x = y. +
+ the x component to shear by + the y component to shear by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a translation. + + + For a translation by the vector (x, y) + the transformation matrix has the value: +
+            |  1  0  dx |
+            |  1  0  dy |
+            |  0  0   1 |
+            
+
+ the x component to translate by + the y component to translate by + this transformation, with an updated matrix +
+ + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of the line to reflect around + the y-ordinate of the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation transformation composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by in radians + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around the origin composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a scale transformation composed + with the current value. + + the value to scale by in the x direction + the value to scale by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a shear transformation composed + with the current value. + + the value to shear by in the x direction + the value to shear by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a translation transformation composed + with the current value. + + the value to translate by in the x direction + the value to translate by in the y direction + this transformation, with an updated matrix + + + + Updates this transformation to be + the composition of this transformation with the given . + + + This produces a transformation whose effect + is equal to applying this transformation + followed by the argument transformation. + Mathematically, +
+            A.compose(B) = TB x TA
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Updates this transformation to be the composition + of a given with this transformation. + + + This produces a transformation whose effect + is equal to applying the argument transformation + followed by this transformation. + Mathematically, +
+            A.composeBefore(B) = TA x TB
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Applies this transformation to the coordinate + and places the results in the coordinate + (which may be the same as the source). + + the coordinate to transform + the coordinate to accept the results + the dest coordinate + + + + + Cretaes a new which is the result of this transformation applied to the input Geometry. + + A Geometry + The transformed Geometry + + + + Applies this transformation to the i'th coordinate + in the given CoordinateSequence. + + a CoordinateSequence + the index of the coordinate to transform + + + + Transforms the i'th coordinate in the input sequence + + A CoordinateSequence + The index of the coordinate to transform + + + + Tests if an object is an AffineTransformation and has the same matrix as this transformation. + + An object to test + true if the given object is equal to this object + + + + Gets a text representation of this transformation. + The string is of the form: + + AffineTransformation[[m00, m01, m02], [m10, m11, m12]] + + + A string representing this transformation + + + + Clones this transformation + + A copy of this transformation + + + + Gets an array containing the entries + of the transformation matrix. + + + Only the 6 non-trivial entries are returned, + in the sequence: +
+            m00, m01, m02, m10, m11, m12
+            
+
+ an array of length 6 +
+ + + Computes the determinant of the transformation matrix. + + + + The determinant is computed as: +
+             | m00 m01 m02 |
+             | m10 m11 m12 | = m00 * m11 - m01 * m10
+             |  0   0   1  |
+             
+
+ + If the determinant is zero, + the transform is singular (not invertible), + and operations which attempt to compute + an inverse will throw a . + +
+ the determinant of the transformation + + + The determinant of the transformation + +
+ + + Reports that this filter should continue to be executed until + all coordinates have been transformed. + + false + + + Tests if this transformation is the identity transformation. + + + + Builds an defined by a set of control vectors. + + + + A control vector consists of a source point and a destination point, + which is the image of the source point under the desired transformation. + + + A transformation is well-defined + by a set of three control vectors + if and only if the source points are not collinear. + (In particular, the degenerate situation + where two or more source points are identical will not produce a well-defined transformation). + A well-defined transformation exists and is unique. + If the control vectors are not well-defined, the system of equations + defining the transformation matrix entries is not solvable, + and no transformation can be determined. + + No such restriction applies to the destination points. + However, if the destination points are collinear or non-unique, + a non-invertible transformations will be generated. + + + This technique of recovering a transformation + from its effect on known points is used in the Bilinear Interpolated Triangulation + algorithm for warping planar surfaces. + + + Martin Davis + + + + Constructs a new builder for the transformation defined by the given set of control point mappings. + + A control point + A control point + A control point + The image of under the required transformation + The image of under the required transformation + The image of under the required transformation + + + + Computes the + determined by the control point mappings, + or null if the control vectors do not determine a well-defined transformation. + + + + An affine transformation + null if the control vectors do not determine a well-defined transformation. + + + + + + Computes the transformation matrix by + solving the two systems of linear equations + defined by the control point mappings, + if this is possible. + + True if the transformation matrix is solvable + + + + Solves the transformation matrix system of linear equations + for the given right-hand side vector. + + The vector for the right-hand side of the system + The solution vector, if it can be determinated, otherwise null + + + + Supports creating s defined by various kinds of inputs and transformation mapping rules. + + Martin Davis + + + + Creates a tranformation from a set of three control vectors. A control + vector consists of a source point and a destination point, which is the + image of the source point under the desired transformation. Three control + vectors allows defining a fully general affine transformation. + + + + + + + + The computed transformation + + + + Creates an AffineTransformation defined by a pair of control vectors. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. The + computed transformation is a combination of one or more of a uniform scale, + a rotation, and a translation (i.e. there is no shear component and no + reflection) + + + + + + The computed transformation + null if the control vectors do not determine a well-defined transformation + + + + Creates an AffineTransformation defined by a single control vector. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. This + produces a translation. + + The start point of the control vector + The end point of the control vector + The computed transformation + + + + Creates an AffineTransformation defined by a set of control vectors. + Between one and three vectors must be supplied. + + The source points of the vectors + The destination points of the vectors + The computed transformation + if the control vector arrays are too short, long or of different lengths + + + + Creates an AffineTransformation defined by a maping between two baselines. + The computed transformation consists of: + + a translation from the start point of the source baseline to the start point of the destination baseline, + a rotation through the angle between the baselines about the destination start point, + and a scaling equal to the ratio of the baseline lengths. + + If the source baseline has zero length, an identity transformation is returned. + + The start point of the source baseline + The end point of the source baseline + The start point of the destination baseline + The end point of the destination baseline + + + + + Extracts a single representative from each connected component of a . + + 1.9 + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The Geometry from which to extract + A list of Coordinates + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + Maps the members of a + into another GeometryCollection via a defined + mapping function. + + Martin Davis + + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + Combines s to produce a of the most appropriate type. + + + Input geometries which are already collections will have their elements extracted first. + No validation of the result geometry is performed. + (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). + + mbdavis + + + + Combines a collection of geometries. + The geometries to combine + The combined geometry + + + + Combines two geometries. + + A geometry to combine + A geometry to combine + The combined geometry + + + + Combines three geometries. + + A geometry to combine + A geometry to combine + A geometry to combine + The combined geometry + + + + Creates a list from two items + + + + A list from two geometries + + + + Creates a list from three items + + + + + A list from three geometries + + + + Creates a new combiner for a collection of geometries + + The geometries to combine + + + + Extracts the GeometryFactory used by the geometries in a collection + + + a GeometryFactory + + + + Computes the combination of the input geometries to produce the most appropriate or + + A Geometry which is the combination of the inputs + + + + + Value indicating whether empty geometries should be skipped + + + + + A class which supports creating new s + which are modifications of existing ones, + maintaining the same type structure. + + + Geometry objects are intended to be treated as immutable. + This class allows you to "modifies" a Geometrys + by traversing them, applying a user-defined + , or + and creating a new Geometrys with the same structure but + (possibly) modified components. + + Examples of the kinds of modifications which can be made are: + + + The values of the coordinates may be changed. + The editor does not check whether changing coordinate values makes the result Geometry invalid + + + The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). + The modifed coordinate lists must be consistent with their original parent component + (e.g. a LinearRing must always have at least 4 coordinates, and the first and last + coordinate must be equal). + + + Components of the original point may be deleted + (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). + Deletions will be propagated up the component tree appropriately. + + + + All changes must be consistent with the original Geometry's structure + (e.g. a Polygon cannot be collapsed into a LineString). + If changing the structure is required, use a . + + + This class supports creating an edited Geometry + using a different via the + constructor. + Examples of situations where this is required is if the geometry is + transformed to a new SRID and/or a new PrecisionModel. + + Usage notes + + The resulting Geometry is not checked for validity. + If validity needs to be enforced, the new Geometry's + method should be called. + By default the UserData of the input geometry is not copied to the result. + + + + + + + + + The factory used to create the modified Geometry. + + + If null the GeometryFactory of the input is used. + + + + + Creates a new GeometryEditor object which will create + edited with the same as the input Geometry. + + + + + Creates a new GeometryEditor object which will create + edited s with the given . + + The GeometryFactory to create the edited Geometry with. + + + + Edit the input Geometry with the given edit operation. + Clients can create subclasses of GeometryEditorOperation or + CoordinateOperation to perform required modifications. + + The Geometry to edit. + The edit operation to carry out. + A new Geometry which is the result of the editing (which may be empty). + + + + Gets or sets a value indicating if the User Data is copied to the edit result. + If so, only the object reference is copied. + + + + + A interface which specifies an edit operation for Geometries. + + + + + Edits a Geometry by returning a new Geometry with a modification. + The returned Geometry may be the input geometry itself. + It may be null if the geometry is to be deleted. + + The Geometry to modify. + + The factory with which to construct the modified Geometry + (may be different to the factory of the input point). + + A new Geometry which is a modification of the input Geometry. + null if the Geometry is to be deleted completely + + + + A GeometryEditorOperation which does not modify + the input geometry. + This can be used for simple changes of + (including PrecisionModel and SRID). + + mbdavis + + + + A GeometryEditorOperation which edits the coordinate list of a Geometry. + Operates on Geometry subclasses which contains a single coordinate list. + + + + + + + + + + + + + Edits the array of Coordinates from a Geometry. + + The coordinate array to operate on. + The point containing the coordinate list. + An edited coordinate array (which may be the same as the input). + + + + A which edits the + of a . + + Operates on Geometry subclasses which contains a single coordinate list. + + + + An edited coordinate sequence (which may be the same as the input) + + + + Extracts the components of a given type from a . + + + + + Extracts the T components from an and adds them to the provided . + + the geometry from which to extract + the list to add the extracted elements to + The geometry type to extract + + + + Extracts the T elements from a single and returns them in a . + + the geometry from which to extract + + + + Extracts the components of type T from a . + + + + + Constructs a filter with a list in which to store the elements found. + + The list to extract into + + + + Extracts all the 1-dimensional () components from a . + For polygonal geometries, this will extract all the component s. + If desired, s can be forced to be returned as s. + + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single point. + If more than one point is to be processed, it is more + efficient to create a single LineExtracterFilter instance + and pass it to multiple geometries. + + The point from which to extract linear components. + The list of linear components. + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The geometry from which to extract linear components + true if s should be converted to s + The list of linear components + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + true if s should be converted to s + A linear geometry + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single + and adds them to the. + + The geometry from which to extract + The list to add the extracted elements to + The list argument + + + + Extracts the elements from a single + and returns them in a . + + The geometry from which to extract + A list containing the linear elements + + + + Extracts the elements from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Constructs a filter with a list in which to store the elements found. + + + + + Implements some 2D matrix operations (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination.
+ In order to avoid overhead the algorithm runs in-place + on A - if A should not be modified the client must supply a copy. +
+ A an nxn matrix in row/column order )modified by this method) + A vector of length n + if the matrix is the wrong size + + + A vector containing the solution (if any) + null if the system has no or no unique solution + + +
+ + + Indicates that an is non-invertible. + + Martin Davis + + + + Extracts all the 0-dimensional (Point) components from a Geometry. + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + the geometry from which to extract + + + + Constructs a PointExtracterFilter with a list in which to store Points found. + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + The geometry from which to extract + + + + Constructs a PolygonExtracterFilter with a list in which to store Polygons found. + + + + + + + + + + + + A visitor to elements which componets, which + allows short-circuiting when a defined condition holds. + + + + + + + + + + + + + + + + + + + + + + + A Depth object records the topological depth of the sides + of an Edge for up to two Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Depth object is null (has never been initialized) if all depths are null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalize the depths for each point, if they are non-null. + A normalized depth + has depth values in the set { 0, 1 }. + Normalizing the depths + involves reducing the depths by the same amount so that at least + one of them is 0. If the remaining value is > 0, it is set to 1. + + + + + + + + + + + Calls GetDepth and SetDepth. + + + + + + + + + + + + + Models the end of an edge incident on a node. + + + + EdgeEnds have a direction determined by the direction of the ray from the initial + point to the next point. + + + EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". + This ordering is used to sort EdgeEnds around a node. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the total order relation: + a has a greater angle with the positive x-axis than b. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is obviously susceptible to roundoff. + A robust algorithm is: + - first compare the quadrant. If the quadrants + are different, it it trivial to determine which vector is "greater". + - if the vectors lie in the same quadrant, the computeOrientation function + can be used to decide the relative orientation of the vectors. + + + + + + Subclasses should override this if they are using labels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes the factor for the change in depth when moving from one location to another. + E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. + + + + + + + + + + The depth of each side (position) of this edge. + The 0 element of the array is never used. + + + + + + + + + + + + + + + + + + + + + + + + + + Compute the label in the appropriate orientation for this DirEdge. + + + + + Set both edge depths. + One depth for a given side is provided. + The other is computed depending on the Location + transition and the depthDelta of the edge. + + + + + + + Set both edge depths. One depth for a given side is provided. The other is + computed depending on the Location transition and the depthDelta of the edge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VisitedEdge get property returns true if bot Visited + and Sym.Visited are true. + VisitedEdge set property marks both DirectedEdges attached to a given Edge. + This is used for edges corresponding to lines, which will only + appear oriented in a single direction in the result. + + + + + + + + + + + + + + + + + + + + + + + + + This edge is a line edge if + at least one of the labels is a line label + any labels which are not line labels have all Location = Exterior. + + + + + This is an interior Area edge if + its label is an Area label for both Geometries + and for each Geometry both sides are in the interior. + + true if this is an interior Area edge. + + + + A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. + It supports labelling the edges as well as linking the edges to form both + MaximalEdgeRings and MinimalEdgeRings. + + + + + A EdgeEndStar is an ordered list of EdgeEnds around a node. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + A map which maintains the edges in sorted order around the node. + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + The location of the point for this star in Geometry i Areas. + + + + + Insert a EdgeEnd into this EdgeEndStar. + + + + + + Insert an EdgeEnd into the map, and clear the edgeList cache, + since the list of edges has now changed. + + + + + + + Iterator access to the ordered list of edges is optimized by + copying the map collection to a list. (This assumes that + once an iterator is requested, it is likely that insertion into + the map is complete). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate for the node this star is based at. + + + + + + + + + + + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + Insert a directed edge in the list. + + + + + + + + + + + + + + + + + + + + + + + + + Compute the labelling for all dirEdges in this star, as well + as the overall labelling. + + + + + + For each dirEdge in the star, merge the label . + + + + + Update incomplete dirEdge labels from the labelling for the node. + + + + + + + + + + + + Traverse the star of DirectedEdges, linking the included edges together. + To link two dirEdges, the next pointer for an incoming dirEdge + is set to the next outgoing edge. + DirEdges are only linked if: + they belong to an area (i.e. they have sides) + they are marked as being in the result + Edges are linked in CCW order (the order they are stored). + This means that rings have their face on the Right + (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). + PRECONDITION: No pair of dirEdges are both marked as being in the result. + + + + + + + + + + + + + + + + Traverse the star of edges, maintaing the current location in the result + area at this node (if any). + If any L edges are found in the interior of the result, mark them as covered. + + + + + + + + + + + Compute the DirectedEdge depths for a subsequence of the edge array. + + The last depth assigned (from the R side of the last edge visited). + + + + + + + + + + + + + + + + + + + + A GraphComponent is the parent class for the objects' + that form a graph. Each GraphComponent can carry a + Label. + + + + + + + + + + + + + + + + + + + + + Compute the contribution to an IM for this component. + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + + + + + + + + + + + IsInResult indicates if this component has already been included in the result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A coordinate in this component (or null, if there are none). + + + + + An isolated component is one that does not intersect or touch any other + component. This is the case if the label has valid locations for + only a single Geometry. + + true if this component is isolated. + + + + Updates an IM from the label for an edge. + Handles edges from both L and A geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an EdgeIntersection for intersection intIndex. + An intersection that falls exactly on a vertex of the edge is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if the coordinate sequences of the Edges are identical. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The depthDelta is the change in depth as an edge is crossed from R to L. + + The change in depth as the edge is crossed from R to L. + + + + + + + + + + + + + + + + + + + + + + + + An Edge is collapsed if it is an Area edge and it consists of + two segments which are equal and opposite (eg a zero-width V). + + + + + + + + + + + + + + + + + + + + An EdgeIntersection represents a point on an + edge which intersects with another edge. + The intersection may either be a single point, or a line segment + (in which case this point is the start of the line segment) + The label attached to this intersection point applies to + the edge from this point forwards, until the next + intersection or the end of the edge. + The intersection point must be precise. + + + + + + + + + + + + + + + + + + + + + + + + + -1 this EdgeIntersection is located before the argument location, + 0 this EdgeIntersection is at the argument location, + 1 this EdgeIntersection is located after the argument location. + + + + + + + + + + + + + + + + + + The point of intersection. + + + + + The index of the containing line segment in the parent edge. + + + + + The edge distance of this point along the containing line segment. + + + + + A list of edge intersections along an Edge. + + + + + + + + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + + The EdgeIntersection found or added. + + + + Returns an iterator of EdgeIntersections. + + + + + + + + + + + + Adds entries for the first and last points of the edge to the list. + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the input list (this is so a single list + can be used to accumulate all split edges for a Geometry). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + + + + + + + + + + + + A EdgeList is a list of Edges. It supports locating edges + that are pointwise equals to a target edge. + + + + + + Remove the selected Edge element from the list if present. + + Edge element to remove from list + + + + Insert an edge unless it is already in the list. + + + + + + + + + + + + If there is an edge equal to e already in the list, return it. + Otherwise return null. + + + + equal edge, if there is one already in the list, + null otherwise. + + + + + + + + + + + + + + + + + + If the edge e is already in the list, return its index. + + + + Index, if e is already in the list, + -1 otherwise. + + + + + + + + + + + + + + + + + + + + + + + Validates that a collection of is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Checks whether the supplied s are correctly noded. + + an enumeration of Edges. + If the SegmentStrings are not correctly noded + + + + Creates a new validator for the given collection of s. + + + + + Checks whether the supplied edges are correctly noded. + + If the SegmentStrings are not correctly noded + + + + + + + + + The directed edge which starts the list of edges for this EdgeRing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compute a LinearRing from the point list previously collected. + Test if the ring is a hole (i.e. if it is CCW) and set the hole flag + accordingly. + + + + + + + + + + + + + + + + + + + Collect all the points from the DirectedEdges of this ring into a contiguous list. + + + + + + + + + + + + + + + + + + + + + + Merge the RHS label from a DirectedEdge into the label for this EdgeRing. + The DirectedEdge label may be null. This is acceptable - it results + from a node which is NOT an intersection node between the Geometries + (e.g. the end node of a LinearRing). In this case the DirectedEdge label + does not contribute any information to the overall labelling, and is simply skipped. + + + + + + + + + + + + + + + This method will cause the ring to be computed. + It will also check any holes, if they have been assigned. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the list of DirectedEdges that make up this EdgeRing. + + + + + + + + + + A GeometryGraph is a graph that models a given Geometry. + + + + + The computation of the IntersectionMatrix relies on the use of a structure + called a "topology graph". The topology graph contains nodes and edges + corresponding to the nodes and line segments of a Geometry. Each + node and edge in the graph is labeled with its topological location relative to + the source point. + Note that there is no requirement that points of self-intersection be a vertex. + Thus to obtain a correct topology graph, Geometrys must be + self-noded before constructing their graphs. + Two fundamental operations are supported by topology graphs: + Computing the intersections between all the edges and nodes of a single graph + Computing the intersections between the edges and nodes of two different graphs + + + + + For nodes in the Collection, link the DirectedEdges at the node that are in the result. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The node if found; null otherwise + + + + + + Add a set of edges to the graph. For each edge two DirectedEdges + will be created. DirectedEdges are NOT linked by this method. + + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Returns the EdgeEnd which has edge e as its base edge + (MD 18 Feb 2002 - this should return a pair of edges). + + + The edge, if found null if the edge was not found. + + + + Returns the edge whose first two coordinates are p0 and p1. + + + + The edge, if found null if the edge was not found. + + + + Returns the edge which starts at p0 and whose first segment is + parallel to p1. + + + + The edge, if found null if the edge was not found. + + + + The coordinate pairs match if they define line segments lying in the same direction. + E.g. the segments are parallel and in the same quadrant + (as opposed to parallel and opposite!). + + + + + + + + + + + + + + + + + + + + + + + + + This method implements the Boundary Determination Rule + for determining whether + a component (node or edge) that appears multiple times in elements + of a MultiGeometry is in the boundary or the interior of the Geometry. + The SFS uses the "Mod-2 Rule", which this function implements. + An alternative (and possibly more intuitive) rule would be + the "At Most One Rule": + isInBoundary = (componentCount == 1) + + + + + The lineEdgeMap is a map of the linestring components of the + parentGeometry to the edges which are derived from them. + This is used to efficiently perform findEdge queries + + + + + If this flag is true, the Boundary Determination Rule will used when deciding + whether nodes are in the boundary or not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + Adds a polygon ring to the graph. Empty rings are ignored. + The left and right topological location arguments assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged. + + + + + + + + + + + + + + + + + + + + Add an Edge computed externally. The label on the Edge is assumed + to be correct. + + + + + + Add a point computed externally. The point is assumed to be a + Point Geometry part, which has a location of INTERIOR. + + + + + + Compute self-nodes, taking advantage of the Geometry type to + minimize the number of intersection tests. (E.g. rings are + not tested for self-intersection, since they are assumed to be valid). + + The LineIntersector to use. + If false, intersection checks are optimized to not test rings for self-intersection. + The SegmentIntersector used, containing information about the intersections found. + + + + + + + + + + + + + + + + + + + + + Adds candidate boundary points using the current . + This is used to add the boundary + points of dim-1 geometries (Curves/MultiCurves). + + + + + + + + + + + + + Add a node for a self-intersection. + If the node is a potential boundary node (e.g. came from an edge which + is a boundary) then insert it as a potential boundary node. + Otherwise, just add it as a regular node. + + + + + + + + Determines the of the given in this geometry. + + The point to test + + The location of the point in the geometry + + + + + + + + + + + + + + + + + + + + Gets the used with this geometry graph. + + + + + + + + + + An EdgeSetIntersector computes all the intersections between the + edges in the set. It adds the computed intersections to each edge + they are found on. It may be used in two scenarios: + determining the internal intersections between a single set of edges + determining the mutual intersections between two different sets of edges + It uses a SegmentIntersector to compute the intersections between + segments and to record statistics about what kinds of intersections were found. + + + + + Computes all self-intersections between edges in a set of edges, + allowing client to choose whether self-intersections are computed. + + A list of edges to test for intersections. + The SegmentIntersector to use. + true if self-intersections are to be tested as well. + + + + Computes all mutual intersections between two sets of edges. + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + They have the following properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + + Specifically, a sequence of contiguous line segments + is a monotone chain iff all the vectors defined by the oriented segments + lies in the same quadrant. + + Monotone Chains have the following useful properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + Note that due to the efficient intersection test, there is no need to limit the size + of chains to obtain fast performance. + + + + + + + + + + + + + + + + + + + + The index of the last point in the monotone chain. + + + + + + Computes the intersection of line segments, + and adds the intersection to the edges containing the segments. + + + + + + + + + + + + + Testing only. + + + + + + + + + + + + + + + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning + and end segments. + + + + + + + + + This method is called by clients of the EdgeIntersector class to test for and add + intersections for two segments of the edges being intersected. + Note that clients (such as MonotoneChainEdges) may choose not to intersect + certain pairs of segments for efficiency reasons. + + + + + + + + + + + + + + + + + + + + + + + + + The proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire Geometry, since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the Geometry. + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this SegmentIntersector. + + + + + Finds all intersections in one or two sets of edges, + using the straightforward method of + comparing all segments. + This algorithm is too slow for production use, but is useful for testing purposes. + + + + + + + + + + + + + + + + + + + + + Performs a brute-force comparison of every segment in each Edge. + This has n^2 performance, and is about 100 times slower than using + monotone chains. + + + + + + + + Finds all intersections in one or two sets of edges, + using an x-axis sweepline algorithm in conjunction with Monotone Chains. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + The use of MonotoneChains as the items in the index + seems to offer an improvement in performance over a sweep-line alone. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + Finds all intersections in one or two sets of edges, + using a simple x-axis sweepline algorithm. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because DELETE events have a link to their corresponding INSERT event, + it is possible to compute exactly the range of events which must be + compared to a given INSERT event object. + + + + + + + + + + + + + + + + + + + + + + + + + Creates an INSERT event. + + The edge set label for this object. + The event location + the object being inserted + + + + Creates a DELETE event. + + The event location + The corresponding INSERT event + + + + Events are ordered first by their x-value, and then by their eventType. + Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Label indicates the topological relationship of a component + of a topology graph to a given Geometry. + This class supports labels for relationships to two Geometrys, + which is sufficient for algorithms for binary operations. + Topology graphs support the concept of labeling nodes and edges in the graph. + The label of a node or edge specifies its topological relationship to one or + more geometries. (In fact, since NTS operations have only two arguments labels + are required for only two geometries). A label for a node or edge has one or + two elements, depending on whether the node or edge occurs in one or both of the + input Geometrys. Elements contain attributes which categorize the + topological location of the node or edge relative to the parent + Geometry; that is, whether the node or edge is in the interior, + boundary or exterior of the Geometry. Attributes have a value + from the set {Interior, Boundary, Exterior}. In a node each + element has a single attribute On. For an edge each element has a + triplet of attributes Left, On, Right. + It is up to the client code to associate the 0 and 1 TopologyLocations + with specific geometries. + + + + + Converts a Label to a Line label (that is, one with no side Location). + + Label to convert. + Label as Line label. + + + + Construct a Label with a single location for both Geometries. + Initialize the locations to Null. + + + + + + Construct a Label with a single location for both Geometries. + Initialize the location for the Geometry index. + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for both Geometries to the given values. + + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for the given Geometry index. + + + + + + + + + Construct a Label with the same values as the argument Label. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge this label with another one. + Merging updates any null attributes of this label with the attributes from lbl. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts one GeometryLocation to a Line location. + + + + + + + + + + + + + + + + + + + + + + Only non-null if this node is precise. + + + + + + + + + + + + + + + + + Basic nodes do not compute IMs. + + + + + + Add the edge to the list of edges at this node. + + + + + + + + + + + + To merge labels for two nodes, + the merged location for each LabelElement is computed. + The location for the corresponding node LabelElement is set to the result, + as long as the location is non-null. + + + + + + + + + + + + + Updates the label of a node to BOUNDARY, + obeying the mod-2 boundaryDetermination rule. + + + + + + The location for a given eltIndex for a node will be one + of { Null, Interior, Boundary }. + A node may be on both the boundary and the interior of a point; + in this case, the rule is that the node is considered to be in the boundary. + The merged location is the maximum of the two input values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The basic node constructor does not allow for incident edges. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + + + + + + + This method expects that a node has a coordinate value. + + + + + + + + + + + + + Adds a node for the start point of this EdgeEnd + (if one does not already exist in this map). + Adds the EdgeEnd to the (possibly new) node. + + + + + + The node if found; null otherwise. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An indicator that a Location is on a GraphComponent (0) + + + + + An indicator that a Location is to the left of a GraphComponent (1) + + + + + An indicator that a Location is to the right of a GraphComponent (2) + + + + + An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) + /// + + + + A Position indicates the position of a Location relative to a graph component + (Node, Edge, or Area). + + + + + Returns Positions.Left if the position is Positions.Right, + Positions.Right if the position is Left, or the position + otherwise. + + + + + + Utility functions for working with quadrants, which are numbered as follows: + + 1 | 0 + --+-- + 2 | 3 + + + + + + North-East + + + + + North-West + + + + + South-West + + + + + South-East + + + + + Only static methods! + + + + + Returns the quadrant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + If the displacements are both 0 + + + + Returns the quadrant of a directed line segment from p0 to p1. + + + + if the points are equal + + + + Returns true if the quadrants are 1 and 3, or 2 and 4. + + + + + + + Returns the right-hand quadrant of the halfplane defined by the two quadrants, + or -1 if the quadrants are opposite, or the quadrant if they are identical. + + + + + + + Returns whether the given quadrant lies within the given halfplane (specified + by its right-hand quadrant). + + + + + + + Returns true if the given quadrant is 0 or 1. + + + + + + A TopologyLocation is the labelling of a + GraphComponent's topological relationship to a single Geometry. + + + If the parent component is an area edge, each side and the edge itself + have a topological location. These locations are named: + + Onon the edge + Leftleft-hand side of the edge + Rightright-hand side + + + If the parent component is a line edge or node, there is a single + topological relationship attribute, On. + + The possible values of a topological location are + { , , , } + + The labelling is stored in an array _location[j] where + where j has the values On, Left, Right. + + + + + + + + + + + + Constructs a TopologyLocation specifying how points on, to the left of, and to the + right of some GraphComponent relate to some Geometry. Possible values for the + parameters are Location.Null, Location.Exterior, Location.Boundary, + and Location.Interior. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge updates only the Null attributes of this object + with the attributes of another. + + + + + + + + + + + Get calls Get(Positions posIndex), + Set calls SetLocation(Positions locIndex, Location locValue) + + + + + + + true if all locations are Null. + + + + + true if any locations are Null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An BinTree (or "Binary Interval Tree") + is a 1-dimensional version of a quadtree. + It indexes 1-dimensional intervals (which may + be the projection of 2-D objects on an axis). + It supports range searching + (where the range may be a single point). + + + + This structure is dynamic - + new items can be added at any time, + and it will support deletion of items + (although this is not currently implemented). + + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + This index is different to the Interval Tree of Edelsbrunner + or the Segment Tree of Bentley. + + + + + Ensure that the Interval for the inserted item has non-zero extents. + Use the current minExtent to pad it, if necessary. + + + + + + + + + + + + + + + + + Removes a single item from the tree. + + itemEnv the Envelope of the item to be removed + the item to remove + true if the item was found (and thus removed) + + + + + + + + + + + + + + + + + Queries the tree to find all candidate items which + may overlap the query interval. + If the query interval is null, all items in the tree are found. + min and max may be the same value. + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + + + + + + + + + + + + + + + + + Compute the total number of nodes in the tree. + + The number of nodes in the tree. + + + + A Key is a unique identifier for a node in a tree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node of a Bintree. + + + + + The base class for nodes in a Bintree. + + + + + Returns the index of the subnode that wholely contains the given interval. + If none does, returns -1. + + + + + + + + + + + + Subnodes are numbered as follows: + 0 | 1 + . + + + + + + + + + + + + + + + + + + + + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + Removes a single item from this subtree. + + The envelope containing the item + The item to remove + true if the item was found and removed + + + + + + + + + Gets whether this node is prunable + + + + + Gets whether this node has any children + + + + + + + + + + Gets whether this node has any subnodes + + + + + + + + + + + + + + + Creates a node + + The interval of the node item + A new node + + + + Creates a larger node, that contains both and + If is null, a node for is created. + + The original node + The additional interval + A new node + + + + Creates a new node instance + + The node's interval + The node's level + + + + + + + + + + + Returns the subnode containing the envelope. + Creates the node if + it does not already exist. + + + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subnode for the index. + If it doesn't exist, create it. + + + + + + + + + + + + Gets the node's + + + + + The root node of a single Bintree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the tree this is the root of. + + + + + + + Insert an item which is known to be contained in the tree rooted at + the given Node. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + The root node matches all searches. + + + + + + MonotoneChains are a way of partitioning the segments of a linestring to + allow for fast searching of intersections. + + + + They have the following properties: + + the segments within a monotone chain never intersect each other + the envelope of any contiguous subset of the segments in a monotone chain + is equal to the envelope of the endpoints of the subset. + + + + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows an efficient + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + One of the goals of this implementation of MonotoneChains is to be + as space and time efficient as possible. One design choice that aids this + is that a MonotoneChain is based on a subarray of a list of points. + This means that new arrays of points (potentially very large) do not + have to be allocated. + + MonotoneChains support the following kinds of queries: + + Envelope selectdetermine all the segments in the chain which + intersect a given envelope. + Overlapdetermine all the pairs of segments in two chains whose + envelopes overlap. + + + + This implementation of MonotoneChains uses the concept of internal iterators + ( and ) + to return the resultsets for the above queries. + This has time and space advantages, since it + is not necessary to build lists of instantiated objects to represent the segments + returned by the query. + Queries made in this manner are thread-safe. + + + + + + + + + + + + + + + Gets the line segment starting at + + The index of the segment + The line segment to extract to + + + + Determine all the line segments in the chain whose envelopes overlap + the searchEnvelope, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the select action on chain segments + which it can determine are not in the search envelope. + However, it *may* call the select action on segments + which do not intersect the search envelope. + This saves on the overhead of checking envelope intersection + each time, since clients may be able to do this more efficiently. + + The search envelope + The select action to execute on selected segments + + + + + + + + + + + + + Determine all the line segments in two chains which may overlap, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the overlap action on chain segments + which it can determine do not overlap. + However, it *may* call the overlap action on segments + which do not actually interact. + This saves on the overhead of checking intersection + each time, since clients may be able to do this more efficiently. + + The monotone chain + The overlap action to execute on selected segments + + + + + + + + + + + + + + + Gets or sets the Id + + + + + Gets the chain's context + + + + + Gets the chain's envelope + + + + + Gets the start index + + + + + Gets the end index of the underlying linestring + + + + + Return the subsequence of coordinates forming this chain. + Allocates a new array to hold the Coordinates. + + + + + Constructs s + for sequences of s. + + + + + Only static methods! + + + + + + + + + + + + + + + + + + + Return a list of the MonotoneChains + for the given list of coordinates. + + + + + + + Return an array containing lists of start/end indexes of the monotone chains + for the given list of coordinates. + The last entry in the array points to the end point of the point array, + for use as a sentinel. + + + + + + Finds the index of the last point in a monotone chain + starting at a given point. + Any repeated points (0-length segments) will be included + in the monotone chain returned. + + The coordinates + The start index + + The index of the last point in the monotone chain starting at start. + + + + + The action for the internal iterator for performing + overlap queries on a MonotoneChain. + + + + + This envelope is used during the MonotoneChain search process. + + + + + This envelope is used during the MonotoneChain search process. + + + + + + + + + + + + + + + This function can be overridden if the original chains are needed. + + + The index of the start of the overlapping segment from mc1. + + The index of the start of the overlapping segment from mc2. + + + + This is a convenience function which can be overridden to obtain the actual + line segments which overlap. + + + + + + + A visitor for nodes and items in an index. + + + + + + + + + + + A static index on a set of 1-dimensional intervals, + using an R-Tree packed based on the order of the interval midpoints. + + + It supports range searching, + where the range is an interval of the real line (which may be a single point). + A common use is to index 1-dimensional intervals which + are the projection of 2-D objects onto an axis of the coordinate system. + + This index structure is static + - items cannot be added or removed once the first query has been made. + The advantage of this characteristic is that the index performance + can be optimized based on a fixed set of items. + + Martin Davis + + + + + Adds an item to the index which is associated with the given interval + + The lower bound of the item interval + The upper bound of the item interval + The item to insert + if the index has already been queried + + + + Search for intervals in the index which intersect the given closed interval + and apply the visitor to them. + + The lower bound of the query interval + The upper bound of the query interval + The visitor to pass any matched items to + + + + The basic insertion and query operations supported by classes + implementing spatial index algorithms. + A spatial index typically provides a primary filter for range rectangle queries. A + secondary filter is required to test for exact intersection. Of course, this + secondary filter may consist of other tests besides intersection, such as + testing other kinds of spatial relationships. + + + + + Adds a spatial item with an extent specified by the given Envelope to the index. + + + + + Queries the index for all items whose extents intersect the given search Envelope + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A list of the items found by the query. + + + + Queries the index for all items whose extents intersect the given search , + and applies an to them. + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A visitor object to apply to the items found. + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + A node of a , which represents one or more points in the same location. + + The type of the object + dskea + + + + Creates a new KdNode. + + coordinate of point + coordinate of point + A data objects to associate with this node + + + + Creates a new KdNode. + + The point location of new node + A data objects to associate with this node + + + + Gets x-ordinate of this node + + + + + Gets y-ordinate of this node + + + + + Gets the location of this node + + + + + Gets the user data object associated with this node. + + + + + Gets or sets the left node of the tree + + + + + Gets or sets the right node of the tree + + + + + Gets the number of inserted points that are coincident at this location. + + + + + Gets whether more than one point with this value have been inserted (up to the tolerance) + + + + + + An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. + + + This implementation supports detecting and snapping points which are closer + than a given distance tolerance. + If the same point (up to tolerance) is inserted + more than once , it is snapped to the existing node. + In other words, if a point is inserted which lies within the tolerance of a node already in the index, + it is snapped to that node. + When a point is snapped to a node then a new node is not created but the count of the existing node + is incremented. + If more than one node in the tree is within tolerance of an inserted point, + the closest and then lowest node is snapped to. + + The type of the user data object + David Skea + Martin Davis + + + + Converts a collection of s to an array of s. + + A collection of nodes + An array of the coordinates represented by the nodes + + + + Converts a collection of {@link KdNode}s + to an array of s, + specifying whether repeated nodes should be represented + by multiple coordinates. + + a collection of nodes + true if repeated nodes should + be included multiple times + An array of the coordinates represented by the nodes + + + + Creates a new instance of a KdTree with a snapping tolerance of 0.0. + (I.e. distinct points will not be snapped) + + + + + Creates a new instance of a KdTree with a snapping distance + tolerance. Points which lie closer than the tolerance to a point already + in the tree will be treated as identical to the existing point. + + The tolerance distance for considering two points equal + + + + Inserts a new point in the kd-tree, with no data. + + The point to insert + The kdnode containing the point + + + + Inserts a new point into the kd-tree. + + The point to insert + A data item for the point + + A new KdNode if a new point is inserted, else an existing + node is returned with its counter incremented. This can be checked + by testing returnedNode.getCount() > 1. + + + + + Finds the node in the tree which is the best match for a point + being inserted. + The match is made deterministic by returning the lowest of any nodes which + lie the same distance from the point. + There may be no match if the point is not within the distance tolerance of any + existing node. + + The point being inserted + + + the best matching node + null if no match was found + + + + + + Inserts a point known to be beyond the distance tolerance of any existing node. + The point is inserted at the bottom of the exact splitting path, + so that tree shape is deterministic. + + The point to insert + + + The data for the point + The created node + + + + + + Performs a range search of the points in the index. + + The range rectangle to query + + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection of the KdNodes found + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection to accumulate the result nodes into + + + + Performs a nearest neighbor search of the points in the index. + + The point to search the nearset neighbor for + + + + Tests whether the index contains any items. + + + + + DoubleBits manipulates Double numbers + by using bit manipulation and bit-field extraction. + For some operations (such as determining the exponent) + this is more accurate than using mathematical operations + (which suffer from round-off error). + The algorithms and constants in this class + apply only to IEEE-754 double-precision floating point format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This computes the number of common most-significant bits in the mantissa. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + The number of common most-significant mantissa bits. + + + + A representation of the Double bits formatted for easy readability. + + + + + + + + + + Determines the exponent for the number. + + + + + Determines the exponent for the number. + + + + + Provides a test for whether an interval is + so small it should be considered as zero for the purposes of + inserting it into a binary tree. + The reason this check is necessary is that round-off error can + cause the algorithm used to subdivide an interval to fail, by + computing a midpoint value which does not lie strictly between the + endpoints. + + + + + This value is chosen to be a few powers of 2 less than the + number of bits available in the double representation (i.e. 53). + This should allow enough extra precision for simple computations to be correct, + at least for comparison purposes. + + + + + Only static methods! + + + + + Computes whether the interval [min, max] is effectively zero width. + I.e. the width of the interval is so much less than the + location of the interval that the midpoint of the interval cannot be + represented precisely. + + + + + A Key is a unique identifier for a node in a quadtree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a node of a Quadtree. Nodes contain + items which have a spatial extent corresponding to the node's position + in the quadtree. + + + + + The base class for nodes in a Quadtree. + + + + + Gets the index of the subquad that wholly contains the given envelope. + If none does, returns -1. + + The index of the subquad that wholly contains the given envelope
+ or -1 if no subquad wholly contains the envelope
+
+ + + + + + + + subquads are numbered as follows: + 2 | 3 + --+-- + 0 | 1 + + + + + + + + + + + Removes a single item from this subtree. + + The envelope containing the item. + The item to remove. + true if the item was found and removed. + + + + Insert items in this into the parameter! + + IList for adding items. + Parameter IList with this items. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the subquad containing the envelope . + Creates the subquad if + it does not already exist. + + The envelope to search for + The subquad containing the search envelope. + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subquad for the index. + If it doesn't exist, create it. + + + + + + + + + + + + + + + + + + A Quadtree is a spatial index structure for efficient range querying + of items bounded by 2D rectangles.
+ s can be indexed by using their s.
+ Any type of object can also be indexed, as long as it has an extent that can be + represented by an . + + This Quadtree index provides a primary filter + for range rectangle queries. The various query methods return a list of + all items which may intersect the query rectangle. Note that + it may thus return items which do not in fact intersect the query rectangle. + A secondary filter is required to test for actual intersection + between the query rectangle and the envelope of each candidate item. + The secondary filter may be performed explicitly, + or it may be provided implicitly by subsequent operations executed on the items + (for instance, if the index query is followed by computing a spatial predicate + between the query geometry and tree items, + the envelope intersection check is performed automatically. + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + + This data structure is also known as an MX-CIF quadtree + following the terminology usage of Samet and others. +
+
+ + + Ensure that the envelope for the inserted item has non-zero extents. + Use the current minExtent to pad the envelope, if necessary. + + + + + + + minExtent is the minimum envelope extent of all items + inserted into the tree so far. It is used as a heuristic value + to construct non-zero envelopes for features with zero X and/or Y extent. + Start with a non-zero extent, in case the first feature inserted has + a zero extent in both directions. This value may be non-optimal, but + only one feature will be inserted with this value. + + + + + Constructs a Quadtree with zero items. + + + + + + + + + + + + Removes a single item from the tree. + + The Envelope of the item to be removed. + The item to remove. + true if the item was found (and thus removed). + + + + Queries the tree and returns items which may lie in the given search envelope. + + + Precisely, the items that are returned are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be returned as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not returned - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A List of items which may intersect the search envelope + + + + Queries the tree and visits items which may lie in the given search envelope. + + + Precisely, the items that are visited are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be visited as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not visited - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A visitor object which is passed the visited items + + + + Return a list of all items in the Quadtree. + + + + + + + + + + + Returns the number of levels in the tree. + + + + + Tests whether the index contains any items. + + + + + Returns the number of items in the tree. + + + + + QuadRoot is the root of a single Quadtree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the quadtree this is the root of. + + + + + Insert an item which is known to be contained in the tree rooted at + the given QuadNode root. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + + + + + A node of an . A node is one of: + + empty + an interior node containing child s + a leaf node containing data items (s). + + A node stores the bounds of its children, and its level within the index tree. + + + + + Constructs an AbstractNode at the given level in the tree + + + 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Returns a representation of space that encloses this Boundable, + preferably not much bigger than this Boundable's boundary yet fast to + test for intersection with the bounds of other Boundables. The class of + object returned depends on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other + object (for other subclasses of AbstractSTRtree). + + + + + Adds either an AbstractNode, or if this is a leaf node, a data object + (wrapped in an ItemBoundable). + + + + + + Returns either child s, or if this is a leaf node, real data (wrapped + in s). + + + + + Gets the bounds of this node + + + + + Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Gets the count of the s at this node. + + + + + Tests whether there are any s at this node. + + + + + Base class for STRtree and SIRtree. STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + This implementation is based on s rather than just s, + because the STR algorithm operates on both nodes and + data, both of which are treated as s. + + + + + Set to null when index is built, to avoid retaining memory. + + + + Constructs an AbstractSTRtree with the specified maximum number of child + nodes that a node may have. + + + + + + Creates parent nodes, grandparent nodes, and so forth up to the root + node, for the data that has been inserted into the tree. Can only be + called once, and thus can be called only after all of the data has been + inserted into the tree. + + + + + + + + + + + + Sorts the childBoundables then divides them into groups of size M, where + M is the node capacity. + + + + + + + Creates the levels higher than the given level. + + The level to build on. + the level of the Boundables, or -1 if the boundables are item + boundables (that is, below level 0). + The root, which may be a ParentNode or a LeafNode. + + + + Also builds the tree, if necessary. + + + + + + Gets a tree structure (as a nested list) + corresponding to the structure of the items and nodes in this tree. + The returned Lists contain either Object items, + or Lists which correspond to subtrees of the tree + Subtrees which do not contain any items are not included. + Builds the tree if necessary. + + a List of items and/or Lists + + + + Removes an item from the tree. + (Builds the tree, if necessary.) + + + + + Returns the maximum number of child nodes that a node may have. + + + + + Tests whether the index contains any items. + This method does not build the index, + so items can still be inserted after it has been called. + + + + + Gets the number of elements in the tree + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + For STRtrees, the bounds will be Envelopes; + for SIRtrees, Intervals; + for other subclasses of AbstractSTRtree, some other class. + + The bounds of one spatial object. + The bounds of another spatial object. + Whether the two bounds intersect. + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Boundable wrapper for a non-Boundable spatial object. Used internally by + AbstractSTRtree. + + + + + + + + + + + + The bounds + + + + + The item + + + + + One-dimensional version of an STR-packed R-tree. SIR stands for + "Sort-Interval-Recursive". STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an SIRtree with the default (10) node capacity. + + + + + Constructs an SIRtree with the given maximum number of child nodes that + a node may have. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + + Returns items whose bounds intersect the given value. + + + + + + Returns items whose bounds intersect the given bounds. + + Possibly equal to x2. + Possibly equal to x1. + + + + + + + + + + + + + + + + + + + + + + + + + + + A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. + For two-dimensional spatial data. + The STR packed R-tree is simple to implement and maximizes space + utilization; that is, as many leaves as possible are filled to capacity. + Overlap between nodes is far less than in a basic R-tree. However, once the + tree has been built (explicitly or on the first call to #query), items may + not be added or removed. + Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an STRtree with the default (10) node capacity. + + + + + Constructs an STRtree with the given maximum number of child nodes that + a node may have. + + The minimum recommended capacity setting is 4. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates the parent level for the given child level. First, orders the items + by the x-values of the midpoints, and groups them into vertical slices. + For each slice, orders the items by the y-values of the midpoints, and + group them into runs of size M (the node capacity). For each run, creates + a new (parent) node. + + + + + + + + + + + + + + + + + + + + + + + + + Must be sorted by the x-value of the envelope midpoints. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + + + + + + + Finds the two nearest items in the tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + A distance metric applicable to the items in this tree + The pair of the nearest items + + + + Finds the item in this tree which is nearest to the given , + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + The query does not have to be + contained in the tree, but it does + have to be compatible with the + distance metric. + + The envelope of the query item + The item to find the nearest neighbour of + A distance metric applicable to the items in this tree and the query item + The nearest item in this tree + + + + Finds the two nearest items from this tree + and another tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + The result value is a pair of items, + the first from this tree and the second + from the argument tree. + + Another tree + A distance metric applicable to the items in the trees + The pair of the nearest items, one from each tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ProjectionEvents are ordered first by their x-value, and then by their eventType. + It is important that Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sweepline implements a sorted index on a set of intervals. + It is used to compute all overlaps between the interval in the index. + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a sequence of s in WKT format from a text file. + + The geometries in the file may be separated by any amount of whitespace and newlines. + + Martin Davis + + + + + Creates a new given the to read from and a to use to parse the geometries. + + the to read from + the geometry reader to use + + + + Creates a new , given the name of the file to read from. + + The name of the file to read from + The geometry reader to use + + + + Creates a new , given a to read with. + + The stream reader of the file to read from + The geometry reader to use + + + + Reads a sequence of geometries. + + + + If an offset is specified, geometries read up to the offset count are skipped. + If a limit is specified, no more than geometries are read. + + The list of geometries read + + + + Tests if reader is at EOF. + + + + + Gets/Sets the maximum number of geometries to read. + + + + + Gets/Sets the number of geometries to skip before reading. + + + + + Finds if two sets of s intersect. + + + Uses indexing for fast performance and to optimize repeated tests + against a target set of lines. + Short-circuited to return as soon an intersection is found. + + Immutable and thread-safe. + + + + + Creates an intersection finder against a given set of segment strings. + + The segment strings to search for intersections + + + + Tests for intersections with a given set of target {@link SegmentString}s. + + The SegmentStrings to test + true if an intersection was found + + + + Tests for intersections with a given set of target s. + using a given SegmentIntersectionDetector. + + The SegmentStrings to test + The intersection detector to use + true if the detector reports intersections + + + Gets the segment set intersector used by this class. + This allows other uses of the same underlying indexed structure. + + + + Intersects two sets of s using a index based + on s and a . + + Thread-safe and immutable. + + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of indexed segments. + + + + + + + Gets the index constructed over the base segment strings + + NOTE: To retain thread-safety, treat returned value as immutable + + + + Segment overlap action class + + + + + Creates an instance of this class using the provided + + The segment intersector to use + + + + Detects and records an intersection between two s, + if one exists. Only a single intersection is recorded. + + + This strategy can be configured to search for proper intersections. + In this case, the presence of any intersection will still be recorded, + but searching will continue until either a proper intersection has been found + or no intersections are detected. + + + + + Creates an intersection finder using a + + + + + Creates an intersection finder using a given + + The LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected. + + + Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). + + + + + Gets or sets whether processing must continue until a proper intersection is found + + + + + Gets or sets whether processing can terminate once any intersection is found. + + + + + Tests whether an intersection was found. + + + + + Tests whether a proper intersection was found. + + + + + Tests whether a non-proper intersection was found. + + + + + Gets the computed location of the intersection. Due to round-off, the location may not be exact. + + + + Gets the endpoints of the intersecting segments. + + An array of the segment endpoints (p00, p01, p10, p11) + + + + Tests whether processing can terminate, + because all required information has been obtained + (e.g. an intersection of the desired type has been detected). + + + + + Utility methods for processing s + + Martin Davis + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Converts a collection of s into a . + The geometry will be either a + or a (possibly empty). + + A collection of . + A geometry factory + A or a . + + + + Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. + These kinds of geometries are useful as a more complex geometry for testing algorithms. + + + Martin Davis + + + + + Computes various kinds of common geometric shapes. + Allows various ways of specifying the location and extent of the shapes, + as well as number of line segments used to form them. + + + + + Create a shape factory which will create shapes using the default GeometryFactory. + + + + + Create a shape factory which will create shapes using the given GeometryFactory. + + The factory to use. + + + + Creates a rectangular Polygon. + + A rectangular polygon. + + + + Creates a circular Polygon. + + A circular polygon. + + + + Creates an elliptical Polygon. + If the supplied envelope is square the + result will be a circle. + + An an ellipse or circle. + + + + Creates a squircular . + + a squircle + + + + Creates a supercircular + of a given positive power. + + a supercircle + + + + Creates a elliptical arc, as a LineString. + + The arc is always created in a counter-clockwise direction. + + Start angle in radians + Size of angle in radians + + + + + Creates an elliptical arc polygon. + + + The polygon is formed from the specified arc of an ellipse + and the two radii connecting the endpoints to the centre of the ellipse. + + Start angle in radians + Size of angle in radians + An elliptical arc polygon + + + + Gets/Sets the location of the shape by specifying the base coordinate + (which in most cases is the + lower left point of the envelope containing the shape). + + + + + Gets/Sets the location of the shape by specifying the centre of + the shape's bounding box. + + + + + Gets or sets the envelope of the shape + + + + + Gets/Sets the total number of points in the created Geometry. + + + + + Gets/Sets the size of the extent of the shape in both x and y directions. + + + + + Gets/Sets the width of the shape. + + + + + Gets/Sets the height of the shape. + + + + + Gets/Sets the rotation angle, in radians, to use for the shape. + The rotation is applied relative to the centre of the shape. + + + + + Creates a factory which will create sine stars using the default + + + + + Creates a factory which will create sine stars using the given + + The factory to use + + + + Generates the geometry for the sine star + + The geometry representing the sine star + + + Gets/Sets the number of arms in the star + + + + Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. + + Value should be between 0.0 and 1.0 + + + + Extends the class to allow reading values in the BigEndian format. + + + While extends + adding methods for reading integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for reading values in the BigEndian format. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + encoding is null. + The stream does not support reading, the stream is null, or the stream is already closed. + + + + Reads a 2-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by two bytes. + + + A 2-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 2-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by two bytes. + + + A 2-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by four bytes. + + + A 4-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by eight bytes. + + + An 8-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a string from the current stream. + The string is prefixed with the length, encoded as an integer seven bits at a time. + + The string being read. + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a decimal value from the current stream + and advances the current position of the stream by sixteen bytes. + + + A decimal value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Extends the class to allow writing values in the BigEndian format. + + + While extends + adding methods for writing integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for writing values in the BigEndian format. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The supplied stream. + output is null. + + The stream does not support writing, or the stream is already closed. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + output or encoding is null. + + The stream does not support writing, or the stream is already closed. + + + + Writes a two-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a two-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes a length-prefixed string to this stream in the current encoding + of the , + and advances the current position of the stream in accordance + with the encoding used and the specific characters being written to the stream. + + The value to write. + The stream is closed. + An I/O error occurs. + value is null. + + + + Writes a decimal value to the current stream and advances the stream position by sixteen bytes. + + The decimal value to write. + The stream is closed. + An I/O error occurs. + + + + Reads a GML document and creates a representation of the features based on NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + + + + Initialize reader with a standard . + + + + + Initialize reader with the given . + + + + + Read a GML document and returns relative . + + + + + + + Reads the coordinate. + + The reader. + + + + + Extract a from a x,y string value. + + + + + + + Extract a from a pos entity string value. + + + + + + + Extract a from a x,y string value. + + + + + builder. + + + + + Writes the GML representation of the features of NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + Thanks to rstuven for improvements :) + + + + + + Returns an XmlReader with feature informations. + Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. + + + + + + + Writes a GML feature into a generic Stream, such a FileStream or other streams. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formatter for double values of coordinates + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Converts a Well-Known Binary byte data to a Geometry. + + + The reader repairs structurally-invalid input + (specifically, LineStrings and LinearRings which contain + too few points have vertices added, + and non-closed rings are closed). + s + + + + Converts a hexadecimal string to a byte array. + The hexadecimal digit symbols are case-insensitive. + + A string containing hex digits + An array of bytes with the value of the hex string + + + true if structurally invalid input should be reported rather than repaired. + At some point this could be made client-controllable. + + + + Initialize reader with a standard . + + + + + Initialize reader with the given GeometryFactory. + + + + + + Reads a in binary WKB format from an array of s. + + The byte array to read from + The geometry read + if the WKB data is ill-formed. + + + + Reads a in binary WKB format from an . + + The stream to read from + The geometry read + if the WKB data is ill-formed. + + + + + + + + + + + + + + + + + Function to read a coordinate sequence. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to form a ring. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to serve a line string. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to convert from to + + The coordinate system + The corresponding + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Function to determine whether an ordinate should be handled or not. + + + + + + + The builder. + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + WKB Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + Point with Z coordinate. + + + + + LineString with Z coordinate. + + + + + Polygon with Z coordinate. + + + + + MultiPoint with Z coordinate. + + + + + MultiLineString with Z coordinate. + + + + + MultiPolygon with Z coordinate. + + + + + GeometryCollection with Z coordinate. + + + + + Point with M ordinate value. + + + + + LineString with M ordinate value. + + + + + Polygon with M ordinate value. + + + + + MultiPoint with M ordinate value. + + + + + MultiLineString with M ordinate value. + + + + + MultiPolygon with M ordinate value. + + + + + GeometryCollection with M ordinate value. + + + + + Point with Z coordinate and M ordinate value. + + + + + LineString with Z coordinate and M ordinate value. + + + + + Polygon with Z coordinate and M ordinate value. + + + + + MultiPoint with Z coordinate and M ordinate value. + + + + + MultiLineString with Z coordinate and M ordinate value. + + + + + MultiPolygon with Z coordinate and M ordinate value. + + + + + GeometryCollection with Z coordinate and M ordinate value. + + + + + Writes a Well-Known Binary byte data representation of a Geometry. + + + WKBWriter stores X,Y,Z values if is not , + otherwise value is discarded and only X,Y are stored. + + + + Converts a byte array to a hexadecimal string. + A byte array + + + Converts a byte array to a hexadecimal string. + A byte array + + + + Initializes writer with LittleIndian byte order. + + + + + Initializes writer with the specified byte order. + + Encoding type + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + M values, present or not, should be emitted + + + + Writes a WKB representation of a given point. + + + + + + + Writes a WKB representation of a given point. + + + + + + + + + + + + + + + Writes LittleIndian ByteOrder. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets or sets whether the value should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Standard byte size for each complex point. + Each complex point (LineString, Polygon, ...) contains: + 1 byte for ByteOrder and + 4 bytes for WKBType. + 4 bytes for SRID value + + + + + Gets a value whether or not EWKB featues may be used. + EWKB features are + 0x80000000 flag if geometry's z-ordinate values are written + 0x40000000 flag if geometry's m-ordinate values are written + 0x20000000 flag if geometry's SRID value is written + + + + + Converts a Well-Known Text string to a Geometry. + + The WKTReader allows + extracting Geometry objects from either input streams or + internal strings. This allows it to function as a parser to read Geometry + objects from text blocks embedded in other data formats (e.g. XML). + + The Well-known + Text format is defined in the + OpenGIS Simple Features Specification for SQL . + + NOTE: There is an inconsistency in the SFS. + The WKT grammar states that MultiPoints are represented by + MULTIPOINT ( ( x y), (x y) ), + but the examples show MultiPoints as MULTIPOINT ( x y, x y ). + Other implementations follow the latter syntax, so NTS will adopt it as well. + A WKTReader is parameterized by a GeometryFactory, + to allow it to create Geometry objects of the appropriate + implementation. In particular, the GeometryFactory will + determine the PrecisionModel and SRID that is used. + The WKTReader will convert the input numbers to the precise + internal representation. + + reads also non-standard "LINEARRING" tags. + + + + + + Creates a WKTReader that creates objects using a basic GeometryFactory. + + + + + Creates a WKTReader that creates objects using the given + GeometryFactory. + + The factory used to create Geometrys. + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + A Reader which will return a "Geometry Tagged Text" + string (see the OpenGIS Simple Features Specification). + + A Geometry read from reader. + + + + + Returns the next array of Coordinates in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next element returned by the stream should be "(" (the + beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". + + + if set to true skip extra parenthesis around coordinates. + + + The next array of Coordinates in the + stream, or an empty array if "EMPTY" is the next element returned by + the stream. + + + + + + + + + + + + + + + + + + + + Returns the next number in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a number. + + The next number in the stream. + if the next token is not a valid number + + + + Returns the next "EMPTY" or "(" in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be "EMPTY" or "(". + + + The next "EMPTY" or "(" in the stream as uppercase text. + + + + Returns the next ")" or "," in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")" or ",". + + + The next ")" or "," in the stream. + + + + Returns the next ")" in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")". + + + The next ")" in the stream. + + + + Returns the next word in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a word. + + The next word in the stream as uppercase text. + + + + Creates a Geometry using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Geometry Tagged Text. + + A Geometry specified by the next token + in the stream. + + + + Creates a Point using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Point Text. + + + A Point specified by the next token in + the stream. + + + + Creates a LineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + + A LineString specified by the next + token in the stream. + + + + Creates a LinearRing using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + A LinearRing specified by the next + token in the stream. + + + + Creates a MultiPoint using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <MultiPoint Text. + + + + A MultiPoint specified by the next + token in the stream. + + + + Creates an array of Points having the given Coordinates. + + + The Coordinates with which to create the Points + + The factory to create the points + + Points created using this WKTReader + s GeometryFactory. + + + + + Creates a Polygon using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a Polygon Text. + + + + A Polygon specified by the next token + in the stream. + + + + + Creates a MultiLineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiLineString Text. + + + + A MultiLineString specified by the + next token in the stream. + + + + Creates a MultiPolygon using the next token in the stream. + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiPolygon Text. + + + + A MultiPolygon specified by the next + token in the stream, or if if the coordinates used to create the + Polygon shells and holes do not form closed linestrings. + + + + Creates a GeometryCollection using the next token in the + stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <GeometryCollection Text. + + + + A GeometryCollection specified by the + next token in the stream. + + + + Gets or sets the factory to create geometries + + + + + Gets or sets the default SRID + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Outputs the textual representation of a . + The outputs coordinates rounded to the precision + model. No more than the maximum number of necessary decimal places will be + output. + The Well-known Text format is defined in the OpenGIS Simple Features + Specification for SQL. + A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does + not define a special tag for LinearRings. The standard tag to use is + "LINESTRING". + + + + + Generates the WKT for a Point specified by a . + + The point coordinate. + The WKT + + + + Generates the WKT for a N-point LineString specified by a . + + The sequence to write. + The WKT + + + Generates the WKT for a LINESTRING + specified by a {@link CoordinateSequence}. + + @param seq the sequence to write + + @return the WKT string + + + + Generates the WKT for a LineString specified by two s. + + The first coordinate. + The second coordinate. + The WKT + + + + Creates the NumberFormatInfo used to write doubles + with a sufficient number of decimal places. + + + The PrecisionModel used to determine + the number of decimal places to write. + + + A NumberFormatInfo that write doubles + without scientific notation. + + + + + Returns a String of repeated characters. + + The character to repeat. + The number of times to repeat the character. + A string of characters. + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Stream to write into + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + + A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + + A Geometry Tagged Text string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process + + + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification). + + + + + Converts a Geometry to <Geometry Tagged Text format, + then appends it to the writer. + + /he Geometry to process. + + /he output writer to append to. + + + + Converts a Coordinate to Point Tagged Text format, + then appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a LineString to <LineString Tagged Text + format, then appends it to the writer. + + The LineString to process. + + The output writer to append to. + + + + Converts a LinearRing to <LinearRing Tagged Text + format, then appends it to the writer. + + The LinearRing to process. + + The output writer to append to. + + + + Converts a Polygon to Polygon Tagged Text format, + then appends it to the writer. + + The Polygon to process. + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Tagged Text + format, then appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to MultiLineString Tagged + Text format, then appends it to the writer. + + The MultiLineString to process. + + The output writer to append to. + + + + Converts a MultiPolygon to MultiPolygon Tagged Text + format, then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollection + Tagged Text format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + Converts a Coordinate to Point Text format, then + appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + Appends the i'th coordinate from the sequence to the writer + the to process + the index of the coordinate to write + writer the output writer to append to + + + + + Converts a Coordinate to Point format, then appends + it to the writer. + + The Coordinate to process. + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a to a . + + The to convert. + + The as a . + + + + Converts a to <LineString Text> format, then appends it to the writer + + + + + Converts a LineString to <LineString Text format, then + appends it to the writer. + + The LineString to process. + + + The output writer to append to. + + + + Converts a Polygon to Polygon Text format, then + appends it to the writer. + + The Polygon to process. + + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Text format, then + appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to <MultiLineString Text + format, then appends it to the writer. + + The MultiLineString to process. + + + The output writer to append to. + + + + Converts a MultiPolygon to <MultiPolygon Text format, + then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollectionText + format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + + + + + + + + + + + + + + + + + Gets/sets whther the output woll be formatted + + + + + Gets/sets the maximum number of coordinates per line written in formatted output. + + If the provided coordinate number is < 0, coordinates will be written all on one line. + + + Gets/sets the tab size to use for indenting. + If the size is non-positive + + + + Extracts the subline of a linear between + two s on the line. + + + + + Computes the subline of a between + two s on the line. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The line to use as the baseline. + The start location. + The end location. + The extracted subline. + + + + Initializes a new instance of the class. + + + + + + Extracts a subline of the input. + If is minor that , + the linear geometry computed will be reversed. + + The start location. + The end location. + A linear geometry. + + + + + + + + + + + Assumes input is valid + (e.g. minor or equals to ). + + + + + + + + Supports linear referencing along a linear + using the length along the line as the index. + Negative length values are taken as measured in the reverse direction + from the end of the geometry. + Out-of-range index values are handled by clamping + them to the valid range of values. + Non-simple lines (i.e. which loop back to cross or touch + themselves) are supported. + + + + + Constructs an object which allows a linear + to be linearly referenced using length as an index. + + The linear geometry to reference along. + + + + Computes the for the point + on the line at the given index. + If the index is out of range the first or last point on the + line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the lies before the , + the computed geometry is reversed. + + + + + + + + + + + + + + + Computes the minimum index for a point on the line. + If the line is not simple (i.e. loops back on itself) + a single point may have more than one possible index. + In this case, the smallest index is returned. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The minimum index of the point. + + + + + Finds the index for a point on the line + which is greater than the given index. + If no such index exists, returns . + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The value the returned index must be greater than. + The index of the point greater than the given minimum index. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline.. + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + + + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line + by clamping the given index to the valid range of index values + + A valid index value + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Finds the nearest index along the linear + to a given after the specified minimum index. + If possible the location returned will be strictly + greater than the . + If this is not possible, the value returned + will equal . + (An example where this is not possible is when + = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + + + + + + + + + + + + + + + + + + Computes the for a given length + along a linear + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + + + + + Computes the for a + given length along a linear . + + The linear geometry to use. + The length index of the location. + The for the length. + + + + Computes the for a + given length along a linear , + with control over how the location + is resolved at component endpoints. + + The linear geometry to use + The length index of the location + If true lengths are resolved to the lowest possible index + + + + Computes the length for a given + on a linear . + + The linear geometry to use. + The index of the location. + The length for the . + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest possible location value. + + The length index. + The corresponding . + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest or highest possible location value, + depending on the value of resolveLower + + The length index + + The corresponding . + + + + + + + + + + + + + + + + + + Builds a linear geometry ( or ) + incrementally (point-by-point). + + + + + Creates an instance of this class. + + The geometry factory to use. + + + + Adds a point to the current line. + + The to add. + + + + Adds a point to the current line. + + The to add. + If true, allows the insertions of repeated points. + + + + Terminate the current . + + + + + + + + + + + + Builds and returns the . + + + + + + Allows invalid lines to be fixed rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + Allows invalid lines to be ignored rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + + + + + + An iterator over the components and coordinates of a linear geometry + (s and s. + + + + + + + + + + + + Invariant: currentLine <> null if the iterator is pointing at a valid coordinate + + + + + Creates an iterator initialized to the start of a linear . + + The linear geometry to iterate over. + if is not + + + + Creates an iterator starting at a on a linear . + + The linear geometry to iterate over. + The location to start at. + if is not + + + + Creates an iterator starting at + a component and vertex in a linear . + + The linear geometry to iterate over. + The component to start at. + The vertex to start at. + if is not + + + + + + + + + Tests whether there are any vertices left to iterator over. + Specifically, HasNext() returns true if the + current state of the iterator represents a valid location + on the linear geometry. + + true if there are more vertices to scan. + + + + Jump to the next element of the iteration. + + + + + Checks whether the iterator cursor is pointing to the + endpoint of a component . + + + + + The component index of the vertex the iterator is currently at. + + + + + The vertex index of the vertex the iterator is currently at. + + + + + Gets the component the iterator is current at. + + + + + Gets the first of the current segment + (the coordinate of the current vertex). + + + + + Gets the second of the current segment + (the coordinate of the next vertex). + If the iterator is at the end of a line, null is returned. + + + + + Represents a location along a or .
+ The referenced geometry is not maintained within this location, + but must be provided for operations which require it. + Various methods are provided to manipulate the location value + and query the geometry it references. +
+
+ + + Gets a location which refers to the end of a linear . + + The linear geometry. + A new LinearLocation. + + + + Computes the of a point a given fraction + along the line segment (p0, p1). + + + + If the fraction is greater than 1.0 the last + point of the segment is returned. + If the fraction is less than or equal to 0.0 the first point + of the segment is returned. + + The Z ordinate is interpolated from the Z-ordinates of the given points, + if they are specified. + + The first point of the line segment. + The last point of the line segment. + The length to the desired point. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + If true, ensures the individual values are locally valid. + + + + Creates a new location equal to a given one. + + A linear location + + + + Ensures the individual values are locally valid. + Does not ensure that the indexes are valid for + a particular linear geometry. + + + + + Ensures the indexes are valid for a given linear . + + A linear geometry. + + + + Snaps the value of this location to + the nearest vertex on the given linear , + if the vertex is closer than . + + A linear geometry. + The minimum allowable distance to a vertex. + + + + Gets the length of the segment in the given + Geometry containing this location. + + A linear geometry. + The length of the segment. + + + + Sets the value of this location to + refer to the end of a linear geometry. + + The linear geometry to use to set the end. + + + + Gets the along the + given linear which is + referenced by this location. + + A linear geometry. + The at the location. + + + + Gets a representing the segment of the given linear which contains this location. + + A linear geometry + the LineSegment containing the location + + + + Tests whether this location refers to a valid + location on the given linear . + + A linear geometry. + true if this location is valid. + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + is not the same type as this instance. + + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + + + Compares this object with the specified index values for order. + + The component index. + The segment index. + The segment fraction. + + A negative integer, zero, or a positive integer as this LineStringLocation + is less than, equal to, or greater than the specified locationValues. + + + + + Compares two sets of location values for order. + + The first component index. + The first segment index. + The first segment fraction. + The second component index. + The second segment index. + The second segment fraction. + + A negative integer, zero, or a positive integer + as the first set of location values is less than, equal to, + or greater than the second set of locationValues. + + + + + Tests whether two locations are on the same segment in the parent . + + A location on the same geometry + true if the locations are on the same segment of the parent geometry + + + + Tests whether this location is an endpoint of + the linear component it refers to. + + The linear geometry referenced by this location + True if the location is a component endpoint + + + + Converts a linear location to the lowest equivalent location index. + The lowest index has the lowest possible component and segment indices. + Specifically: + * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) + * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned + If the location index is already the lowest possible value, the original location is returned. + + The linear geometry referenced by this location. + The lowest equivalent location. + + + + Copies this location. + + A copy of this location. + + + + Gets the component index for this location. + + + + + Gets the segment index for this location. + + + + + Gets the segment fraction for this location. + + + + + Tests whether this location refers to a vertex: + returns true if the location is a vertex. + + + + + Supports linear referencing along a linear + using s as the index. + + + + + Constructs an object which allows linear referencing along + a given linear . + + The linear geometry to reference alo + + + + Computes the for the point on the line at the given index. + If the is out of range, + the first or last point on the line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point + on the line at the given index, offset by the given distance. + If the index is out of range the first or last point on the + line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment + (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The index of the start of the interval. + The index of the end of the interval. + The linear interval between the indices. + + + + Computes the index for a given point on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The index of the point. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline. + + + + Finds the index for a point on the line which is greater than the given index. + If no such index exists, returns . + + + + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + + + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + + A point on the line + The value the returned index must be greater than + The index of the point greater than the given minimum index + + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + A point on the line. + The index of the point. + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line by clamping + the given index to the valid range of index values. + + + A valid index value. + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + Determines the location of a subline along a linear . + The location is reported as a pair of s. + NOTE: Currently this algorithm is not guaranteed to + return the correct substring in some situations where + an endpoint of the test line occurs more than once in the input line. + (However, the common case of a ring is always handled correctly). + + + + + + + + + + + + + Initializes a new instance of the class. + + The linear geom. + + + + + + + + + + + Computes the of the point + on a linear nearest a given . + The nearest point is not necessarily unique; this class + always computes the nearest point closest + to the start of the geometry. + + + + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Find the nearest along the linear + to a given after the specified minimum . + If possible the location returned will be strictly greater than the . + If this is not possible, the value returned will equal . + (An example where this is not possible is when = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + Represents a list of contiguous line segments, + and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + An interface for classes which represent a sequence of contiguous line segments. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + + + + + Gets/Sets the user-defined data for this segment string. + + + + + Points that make up ISegmentString + + + + + Size of Coordinate Sequence + + + + + States whether ISegmentString is closed + + + + + Creates a new segment string from a list of vertices. + + the vertices of the segment string + the user-defined data of this segment string (may be null) + + + + Gets the octant of the segment starting at vertex index + + the index of the vertex starting the segment. Must not be the last index in the vertex list + octant of the segment at the vertex + + + Gets the user-defined data for this segment string. + + + + + Validates that a collection of s is correctly noded. + Indexing is used to improve performance. + + + + In the most common use case, validation stops after a single + non-noded intersection is detected, + but the class can be requested to detect all intersections + by using the property. + + The validator does not check for a-b-a topology collapse situations. + + The validator does not check for endpoint-interior vertex intersections. + This should not be a problem, since the JTS noders should be + able to compute intersections between vertices correctly. + + + The client may either test the condition, + or request that a suitable be thrown. + + + + + + Creates a new noding validator for a given set of linework. + + A collection of s + + + + Returns an error message indicating the segments containing the intersection. + + an error message documenting the intersection location + + + + Checks for an intersection and throws + a TopologyException if one is found. + + if an intersection is found + + + + Gets or sets whether all intersections should be found. + + + + + Gets a list of all intersections found. + + Intersections are represented as s. + List is empty if none were found. + + + + + + Checks for an intersection and reports if one is found. + + + + + An interface for classes which support adding nodes to a segment string. + + + + Adds an intersection node for a given point and segment to this segment string. + + the location of the intersection + the index of the segment containing the intersection + + + + + + + + Creates an intersection finder which tests if there is at least one interior intersection. + Uses short-circuiting for efficient performance. + The intersection found is recorded. + + A line intersector. + A intersection finder which tests if there is at least one interior intersection. + + + + Creates an intersection finder which finds all interior intersections. + The intersections are recorded for later inspection. + + A line intersector. + a intersection finder which finds all interior intersections. + + + + Creates an intersection finder which counts all interior intersections. + The intersections are note recorded to reduce memory usage. + + A line intersector. + a intersection finder which counts all interior intersections. + + + + Creates an intersection finder which finds an interior intersection if one exists + + the LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + Tests whether a segment in a is an end segment. + (either the first or last). + + a segment string + the index of a segment in the segment string + true if the segment is an end segment + + + + Gets/Sets whether all intersections should be computed. + + When this is false (the default value), the value of + is true after the first intersection is found. + Default is false. + + + + + + Gets/Sets whether intersection points are recorded. + + If the only need is to count intersection points, this can be set to false. + Default is true. + + + + + + Gets/Sets whether only end segments should be tested for interior intersection. + This is a performance optimization that may be used if + the segments have been previously noded by an appropriate algorithm. + It may be known that any potential noding failures will occur only in + end segments. + + + + + Tests whether an intersection was found. + + + + + Gets the intersections found. + + A list of . + + + + Gets the count of intersections found. + + The intersection count. + + + + Gets the computed location of the intersection. + Due to round-off, the location may not be exact. + + + + + Gets the endpoints of the intersecting segments. + + + + + Computes the possible intersections between two line segments in s + and adds them to each string + using . + + + + + + + + + + + + These variables keep track of what types of intersections were + found during ALL edges that have been intersected. + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning and end segments. + + + + + + + + + + This method is called by clients + of the class to process + intersections for two segments of the being intersected.
+ Note that some clients (such as MonotoneChain") may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Returns the proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire , since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the . + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this . + + + + + An interior intersection is an intersection which is + in the interior of some segment. + + + + + Always process all intersections + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + This class is obsolete. + Use instead. + + + + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Nodes a set of s completely. + The set of s is fully noded; + i.e. noding is repeated until no further intersections are detected. + + Iterated noding using a precision model is not guaranteed to converge, + due to roundoff error. This problem is detected and an exception is thrown. + Clients can choose to rerun the noding using a lower precision model. + + + + + + Computes all intersections between segments in a set of s. + Intersections found are represented as s and added to the + s in which they occur. + As a final step in the noding a new set of segment strings split at the nodes may be returned. + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Fully nodes a list of s, i.e. peforms noding iteratively + until no intersections are found between segments. + Maintains labelling of edges correctly through the noding. + + A collection of SegmentStrings to be noded. + If the iterated noding fails to converge. + + + + Node the input segment strings once + and create the split edges between the nodes. + + + + + + + Gets/Sets the maximum number of noding iterations performed before + the noding is aborted. Experience suggests that this should rarely need to be changed + from the default. The default is . + + + + + Nodes a set of s using a index based + on s and a . + The used should be something that supports + envelope (range) queries efficiently (such as a Quadtree" + or . + + + + + Base class for s which make a single pass to find intersections. + This allows using a custom + (which for instance may simply identify intersections, rather than insert them). + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Gets/sets the to use with this noder. + A will normally add intersection nodes + to the input segment strings, but it may not - it may + simply record the presence of intersections. + However, some s may require that intersections be added. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The + + + + + + + + + + + + + Validates that a collection of s is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Creates a new validator for the given collection + of s. + + The seg strings. + + + + Checks whether the supplied segment strings + are correctly noded. Throws an exception if they are not. + + + + + Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). + + + + + Checks all pairs of segments for intersections at an interior point of a segment. + + + + + Checks for intersections between an endpoint of a segment string + and an interior vertex of another segment string + + + + + Octants in the Cartesian plane. + Octants are numbered as follows: + + \2|1/ + 3 \|/ 0 + ---+-- + 4 /|\ 7 + /5|6\ + + If line segments lie along a coordinate axis, the octant is the lower of the two possible values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Methods for computing and working with of the Cartesian plane. + + + + + Returns the octant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + + + + + Returns the octant of a directed line segment from p0 to p1. + + + + + + + + Allows comparing arrays in an orientation-independent way. + + + + + Creates a new } + for the given array. + + + + + + Computes the canonical orientation for a coordinate array. + + + + true if the points are oriented forwards
+ or falseif the points are oriented in reverse. +
+
+ + + Compares two s for their relative order. + + + + -1 this one is smaller;
+ 0 the two objects are equal;
+ 1 this one is greater. +
+
+ + + + + + + + + + + + + Wraps a and transforms its input into the integer domain. + This is intended for use with Snap-Rounding noders, + which typically are only intended to work in the integer domain. + Offsets can be provided to increase the number of digits of available precision. + + Clients should be aware that rescaling can involve loss of precision, + which can cause zero-length line segments to be created. + These in turn can cause problems when used to build a planar graph. + This situation should be checked for and collapsed segments removed if necessary. + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an intersection point between two s. + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + -1 this SegmentNode is located before the argument location;
+ 0 this SegmentNode is at the argument location;
+ 1 this SegmentNode is located after the argument location. +
+
+ + + + + + + + + Gets the giving the location of this node. + + + + + + + + + + + A list of the s present along a noded . + + + + + Initializes a new instance of the class. + + The edge. + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + The SegmentIntersection found or added. + + + + Returns an iterator of SegmentNodes. + + An iterator of SegmentNodes. + + + + Adds nodes for the first and last points of the edge. + + + + + Adds nodes for any collapsed edge pairs. + Collapsed edge pairs can be caused by inserted nodes, or they can be + pre-existing in the edge vertex list. + In order to provide the correct fully noded semantics, + the vertex at the base of a collapsed pair must also be added as a node. + + + + + Adds nodes for any collapsed edge pairs + which are pre-existing in the vertex list. + + + + + + Adds nodes for any collapsed edge pairs caused by inserted nodes + Collapsed edge pairs occur when the same coordinate is inserted as a node + both before and after an existing edge vertex. + To provide the correct fully noded semantics, + the vertex must be added as a node as well. + + + + + + + + + + + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the provided argument list + (this is so a single list can be used to accumulate all split edges + for a set of s). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + Gets the list of coordinates for the fully noded segment string, + including all original segment string vertices and vertices + introduced by nodes in this list. + Repeated coordinates are collapsed. + + An array of s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not implemented. + + This method is not implemented. + + + + + + + + + + + + + + + + + + + + Implements a robust method of comparing the relative position of two points along the same segment. + The coordinates are assumed to lie "near" the segment. + This means that this algorithm will only return correct results + if the input coordinates have the same precision and correspond to rounded values + of exact coordinates lying on the segment. + + + + + Compares two s for their relative position along a segment + lying in the specified . + + + + + + -1 if node0 occurs first, or
+ 0 if the two nodes are equal, or
+ 1 if node1 occurs first. +
+
+ + + + + + + + + + + + + + + + + + + Represents a list of contiguous line segments, and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + s can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + Gets the s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A collection of NodedSegmentStrings representing the substrings + + + + Adds the noded s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A list which will collect the NodedSegmentStrings representing the substrings + + + + Creates a new segment string from a list of vertices. + + The vertices of the segment string. + The user-defined data of this segment string (may be null). + + + + + + + + + + + Gets the octant of the segment starting at vertex index. + + + The index of the vertex starting the segment. + Must not be the last index in the vertex list + + The octant of the segment at the vertex + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an for intersection intIndex. + An intersection that falls exactly on a vertex + of the is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + + + + + + + + Gets/Sets the user-defined data for this segment string. + + + + + + + + + + + + + + + + + + + + + + + + + + Dissolves a noded collection of s to produce + a set of merged linework with unique segments. + + + A custom merging strategy + can be supplied. + This strategy will be called when two identical (up to orientation) + strings are dissolved together. + The default merging strategy is simply to discard one of the merged strings. + + A common use for this class is to merge noded edges + while preserving topological labelling. + This requires a custom merging strategy to be supplied + to merge the topology labels appropriately. + + + + + + Creates a dissolver with a user-defined merge strategy. + + + + + + Creates a dissolver with the default merging strategy. + + + + + Dissolve all s in the input . + + + + + + + + + + + + + Dissolve the given . + + + + + + + + + Gets the collection of dissolved (i.e. unique) s + + + + + A merging strategy which can be used to update the context data of s + which are merged during the dissolve process. + + mbdavis + + + + Updates the context data of a + when an identical (up to orientation) one is found during dissolving. + + The segment string to update. + The segment string being dissolved. + + true if the strings are in the same direction, + false if they are opposite. + + + + + Nodes a set of s by + performing a brute-force comparison of every segment to every other one. + This has n^2 performance, so is too slow for use on large numbers of segments. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Nodes the linework in a list of s using Snap-Rounding + to a given . + + The input coordinates are expected to be rounded + to the given precision model. + This class does not perform that function. + GeometryPrecisionReducer" may be used to do this. + + This class does not dissolve the output linework, + so there may be duplicate linestrings in the output. + Subsequent processing (e.g. polygonization) may require + the linework to be unique. Using UnaryUnion is one way + to do this (although this is an inefficient approach). + + + + + Creates a new noder which snap-rounds to a grid specified by the given + + The precision model for the grid to snap-round to. + + + + Nodes the linework of a set of Geometrys using SnapRounding. + + A collection of Geometrys of any type + A list of LineStrings representing the noded linework of the input + + + + Gets or sets whether noding validity is checked after noding is performed. + + + + + Implements a "hot pixel" as used in the Snap Rounding algorithm. + A hot pixel contains the interior of the tolerance square and the boundary + minus the top and right segments. + The hot pixel operations are all computed in the integer domain + to avoid rounding problems. + + + + + Initializes a new instance of the class. + + The coordinate at the center of the hot pixel + The scale factor determining the pixel size + THe intersector to use for testing intersection with line segments + + + + Returns a "safe" envelope that is guaranteed to contain the hot pixel. + The envelope returned will be larger than the exact envelope of the pixel. + + An envelope which contains the pixel + + + + + + + + + + + + + + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + The first coordinate of the line segment to test + The second coordinate of the line segment to test + true if the line segment intersects this hot pixel. + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + + + + + + + + + + + + + + Tests whether the segment p0-p1 intersects the hot pixel tolerance square. + Because the tolerance square point set is partially open (along the + top and right) the test needs to be more sophisticated than + simply checking for any intersection. + However, it can take advantage of the fact that the hot pixel edges + do not lie on the coordinate grid. + It is sufficient to check if any of the following occur: + - a proper intersection between the segment and any hot pixel edge. + - an intersection between the segment and BOTH the left and bottom hot pixel edges + (which detects the case where the segment intersects the bottom left hot pixel corner). + - an intersection between a segment endpoint and the hot pixel coordinate. + + + + + + + + Test whether the given segment intersects + the closure of this hot pixel. + This is NOT the test used in the standard snap-rounding + algorithm, which uses the partially closed tolerance square instead. + This routine is provided for testing purposes only. + + + + + + + + Adds a new node (equal to the snap pt) to the specified segment + if the segment passes through the hot pixel + + + + true if a node was added to the segment + + + + Gets the coordinate this hot pixel is based at. + + + + + "Snaps" all s in a containing + s to a given . + + + + + Initializes a new instance of the class. + + + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + The edge containing the vertex, if applicable, or null. + + true if a node was added for this pixel. + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + true if a node was added for this pixel. + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + Uses Snap Rounding to compute a rounded, + fully noded arrangement from a set of s. + Implements the Snap Rounding technique described in + papers by Hobby, Guibas and Marimont, and Goodrich et al. + Snap Rounding assumes that all vertices lie on a uniform grid; + hence the precision model of the input must be fixed precision, + and all the input vertices must be rounded to that precision. + + This implementation uses a monotone chains and a spatial index to + speed up the intersection tests. + This implementation appears to be fully robust using an integer precision model. + It will function with non-integer precision models, but the + results are not 100% guaranteed to be correctly noded. + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + + Does NOT node the segStrings. + + + + A list of Coordinates for the intersections. + + + + Snaps segments to nodes created by segment intersections. + + + + + + Snaps segments to all vertices + + The list of segment strings to snap together + + + + Snaps segments to the vertices of a Segment String. + + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + A Collection of NodedSegmentStrings representing the substrings + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + A collection of NodedSegmentStrings + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + Does NOT node the segStrings. + + + + A list of s for the intersections. + + + + Computes nodes introduced as a result of snapping segments to snap points (hot pixels). + + + + + + + + + + + + + + Computes nodes introduced as a result of + snapping segments to vertices of other segments. + + The list of segment strings to snap together + + + + Performs a brute-force comparison of every segment in each . + This has n^2 performance. + + + + + + + Computes the boundary of a . + Allows specifying the to be used. + This operation will always return a of the appropriate + dimension for the boundary (even if the input geometry is empty). + The boundary of zero-dimensional geometries (Points) is + always the empty . + + Martin Davis + + + + A map which maintains the edges in sorted order around the node. + + + + + Stores an integer count, for use as a Map entry. + + Martin Davis + + + + Builds the buffer geometry for a given input geometry and precision model. + Allows setting the level of approximation for circular arcs, + and the precision model in which to carry out the computation. + + + When computing buffers in floating point double-precision + it can happen that the process of iterated noding can fail to converge (terminate). + In this case a will be thrown. + Retrying the computation in a fixed precision + can produce more robust results. + + + + Compute the change in depth as an edge is crossed from R to L + + + Creates a new BufferBuilder + + + + Inserted edges are checked to see if an identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + + + + Completes the building of the input subgraphs by depth-labelling them, + and adds them to the PolygonBuilder. + + + The subgraph list must be sorted in rightmost-coordinate order. + + the subgraphs to build + the PolygonBuilder which will build the final polygons + + + + Gets the standard result for an empty buffer. + Since buffer always returns a polygonal result, this is chosen to be an empty polygon. + + The empty result geometry + + + + Sets the precision model to use during the curve computation and noding, + if it is different to the precision model of the Geometry. + + + If the precision model is less than the precision of the Geometry precision model, + the Geometry must have previously been rounded to that precision. + + + + + Sets the to use during noding. + This allows choosing fast but non-robust noding, or slower + but robust noding. + + + + + Simplifies a buffer input line to remove concavities with shallow depth. + + + + The most important benefit of doing this + is to reduce the number of points and the complexity of + shape which will be buffered. + It also reduces the risk of gores created by + the quantized fillet arcs (although this issue + should be eliminated in any case by the + offset curve generation logic). + + + A key aspect of the simplification is that it + affects inside (concave or inward) corners only. + Convex (outward) corners are preserved, since they + are required to ensure that the generated buffer curve + lies at the correct distance from the input geometry. + + + Another important heuristic used is that the end segments + of the input are never simplified. This ensures that + the client buffer code is able to generate end caps faithfully. + + + No attempt is made to avoid self-intersections in the output. + This is acceptable for use for generating a buffer offset curve, + since the buffer algorithm is insensitive to invalid polygonal + geometry. However, + this means that this algorithm + cannot be used as a general-purpose polygon simplification technique. + + + Martin Davis + + + + Simplify the input coordinate list. + If the distance tolerance is positive, + concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, + concavities on the RIGHT side of the line are simplified. + + The coordinate list to simplify + simplification distance tolerance to use + The simplified coordinate list + + + + Simplify the input coordinate list. + + + If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. + + Simplification distance tolerance to use + + The simplified coordinates list + + + + + Uses a sliding window containing 3 vertices to detect shallow angles + in which the middle vertex can be deleted, since it does not + affect the shape of the resulting buffer in a significant way. + + + + + + Finds the next non-deleted index, or the end of the point array if none + + The start index to search from + The next non-deleted index, if any
+ or _inputLine.Length if there are no more non-deleted indices +
+
+ + + Checks for shallowness over a sample of points in the given section. + This helps to prevent the siplification from incrementally + "skipping" over points which are in fact non-shallow. + + A coordinate of section + A coordinate of section + The start index of section + The end index of section + The tolerated distance + + + + Computes the buffer of a geometry, for both positive and negative buffer distances. + + + + In GIS, the positive (or negative) buffer of a geometry is defined as + the Minkowski sum (or difference) of the geometry + with a circle of radius equal to the absolute value of the buffer distance. + In the CAD/CAM world buffers are known as offset curves. + In morphological analysis the + operation of positive and negative buffering + is referred to as erosion and dilation + + + The buffer operation always returns a polygonal result. + The negative or zero-distance buffer of lines and points is always an empty . + + + Since true buffer curves may contain circular arcs, + computed buffer polygons are only approximations to the true geometry. + The user can control the accuracy of the approximation by specifying + the number of linear segments used to approximate arcs. + This is specified via + or . + + + The of a linear buffer may be specified. + The following end cap styles are supported: +
    +
  • - the usual round end caps
  • +
  • - end caps are truncated flat at the line ends
  • +
  • - end caps are squared off at the buffer distance beyond the line ends
  • +
+
+ + The of the corners in a buffer may be specified. + The following join styles are supported: +
    +
  • - the usual round join
  • +
  • - corners are "sharp" (up to a distance limit})
  • +
  • - corners are beveled (clipped off)
  • +
+
+ + The buffer algorithm can perform simplification on the input to increase performance. + The simplification is performed a way that always increases the buffer area + (so that the simplified input covers the original input). + The degree of simplification can be specified with , + with a used otherwise. + Note that if the buffer distance is zero then so is the computed simplify tolerance, + no matter what the simplify factor. + +
+
+ + + A number of digits of precision which leaves some computational "headroom" + for floating point operations. + + + This value should be less than the decimal precision of double-precision values (16). + + + + + Compute a scale factor to limit the precision of + a given combination of Geometry and buffer distance. + The scale factor is determined by + the number of digits of precision in the (geometry + buffer distance), + limited by the supplied value. + + The scale factor is based on the absolute magnitude of the (geometry + buffer distance). + since this determines the number of digits of precision which must be handled. + + the Geometry being buffered + the buffer distance + the max # of digits that should be allowed by + the precision determined by the computed scale factor + + a scale factor for the buffer computation + + + + Computes the buffer of a geometry for a given buffer distance. + + the geometry to buffer + the buffer distance + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the buffer parameters to use + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the end cap style to use + the buffer of the input geometry + + + + Initializes a buffer computation for the given geometry + + the geometry to buffer + + + + Initializes a buffer computation for the given geometry + with the given set of parameters + + the geometry to buffer + the buffer parameters to use + + + + Returns the buffer computed for a geometry for a given buffer distance. + + the buffer distance + the buffer of the input geometry + + + + Specifies the end cap style of the generated buffer. + The styles supported are , , and . + The default is . + + + + + Sets the number of segments used to approximate a angle fillet + + + + + A value class containing the parameters which + specify how a buffer should be constructed. + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + Martin Davis + + + + The default number of facets into which to divide a fillet of 90 degrees. + A value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + + + + + The default mitre limit + Allows fairly pointy mitres. + + + + + The default simplify factor. + Provides an accuracy of about 1%, which matches + the accuracy of the parameter. + + + + + Creates a default set of parameters + + + + + Creates a set of parameters with the given quadrantSegments value. + + The number of quadrant segments to use + + + + Creates a set of parameters with the + given quadrantSegments and endCapStyle values. + + the number of quadrant segments to use + the end cap style to use + + + + Creates a set of parameters with the + given parameter values. + + the number of quadrant segments to use + the end cap style to use + the join style to use + the mitre limit to use + + + + Computes the maximum distance error due to a given level of approximation to a true arc. + + The number of segments used to approximate a quarter-circle + The error of approximation + + + + Gets/sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. + QuadrantSegments = 0joins are beveled + QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| + + For round joins, QuadrantSegments determines the maximum + error in the approximation to the true buffer curve. + The default value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + The error is always less than the buffer distance + (in other words, the computed buffer curve is always inside the true + curve). + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , + , and + . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), + and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + A connected subset of the graph of + DirectedEdges and Nodes. + Its edges will generate either + a single polygon in the complete buffer, with zero or more holes, or + one or more connected holes. + + + + + + + + + + Creates the subgraph consisting of all edges reachable from this node. + Finds the edges in the graph and the rightmost coordinate. + + A node to start the graph traversal from. + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + A node known to be in the subgraph. + + + + Adds the argument node and all its out edges to the subgraph + + The node to add. + The current set of nodes being traversed. + + + + + + + + + + + + + + + Compute depths for all dirEdges via breadth-first traversal of nodes in graph. + + Edge to start processing with. + + + + + + + + + + + + + + + + Find all edges whose depths indicates that they are in the result area(s). + Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + BufferSubgraphs are compared on the x-value of their rightmost Coordinate. + This defines a partial ordering on the graphs such that: + g1 >= g2 - Ring(g2) does not contain Ring(g1) + where Polygon(g) is the buffer polygon that is built from g. + This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to + be built before holes. + + + + + + + + + + + + + + + Gets the rightmost coordinate in the edges of the subgraph. + + + + + Computes the raw offset curve for a + single component (ring, line or point). + A raw offset curve line is not noded - + it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded + to a given . + + + + + This method handles single points as well as LineStrings. + LineStrings are assumed not to be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + The vertices of the line to offset + The offset distance + A Coordinate array representing the curve
+ or null if the curve is empty +
+
+ + + This method handles the degenerate cases of single points and lines, + as well as rings. + + A Coordinate array representing the curve
+ or null if the curve is empty
+
+ + + Computes the distance tolerance to use during input + line simplification. + + The buffer distance + The simplification tolerance + + + + Gets the buffer parameters being used to generate the curve. + + + + + Generates segments which form an offset curve. + Supports all end cap and join options + provided for buffering. + This algorithm implements various heuristics to + produce smoother, simpler curves which are + still within a reasonable tolerance of the + true curve. + + Martin Davis + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + The Closing Segment Length Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + Add last offset point + + + + + Adds the offset points for an outside (convex) turn + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point , terminating a line segment coming from + + + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments + around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. + Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc + between two specified angles. + The start and end point for the fillet are not added - + the caller must add them if required. + + Is -1 for a angle, 1 for a angle + The radius of the fillet + + + + Creates a circle around a point + + + + + Creates a square around a point + + + + + Gets whether the input has a narrow concave angle + (relative to the offset distance). + In this case the generated offset curve will contain self-intersections + and heuristic closing segments. + This is expected behaviour in the case of buffer curves. + For pure offset curves, + the output needs to be further treated + before it can be used. + + + + + A dynamic list of the vertices in a constructed offset curve. + Automatically removes adjacent vertices + which are closer than a given tolerance. + + Martin Davis + + + The distance below which two adjacent points on the curve + are considered to be coincident. + This is chosen to be a small fraction of the offset distance. + + + + Tests whether the given point is redundant + relative to the previous + point in the list (up to tolerance). + + + true if the point is redundant + + + + Computes the raw offset curve for a single component (ring, line or point). + + + A raw offset curve line is not noded - it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded to the required precision model. + + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + Use a value which results in a potential distance error which is + significantly less than the error due to + the quadrant segment discretization. + For QS = 8 a value of 100 is reasonable. + This should produce a maximum of 1% distance error. + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The Closing Segment Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + + This method handles single points as well as lines. + Lines are assumed to not be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + a List of Coordinate[] + + + + This method handles the degenerate cases of single points and lines, as well as rings. + + a List of Coordinate[] + + + Computes the distance tolerance to use during input + line simplification. + + @param distance the buffer distance + @return the simplification tolerance + + + + Adds the offset points for an outside (convex) turn + + + + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Add last offset point + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment () the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point p1, terminating a line segment coming from p0 + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + The base point + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + + + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc between two specified angles. + + + The start and end point for the fillet are not added - the caller must add them if required. + + The point around which to add the fillet points + The start angle (in radians) + The end angle (in radians) + Is -1 for a CW angle, 1 for a CCW angle + The radius of the fillet + + + + Adds a CW circle around a point + + + + + Adds a CW square around a point + + + + + Creates all the raw offset curves for a buffer of a Geometry. + Raw curves need to be noded together and polygonized to form the final buffer area. + + + + + + + + + + + + + Computes the set of raw offset curves for the buffer. + Each offset curve has an attached {Label} indicating + its left and right location. + + A Collection of SegmentStrings representing the raw buffer curves. + + + + Creates a {SegmentString} for a coordinate list which is a raw offset curve, + and adds it to the list of buffer curves. + The SegmentString is tagged with a Label giving the topology of the curve. + The curve may be oriented in either direction. + If the curve is oriented CW, the locations will be: + Left: Location.Exterior. + Right: Location.Interior. + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + + + + + + + + + + + + + Adds an offset curve for a polygon ring. + The side and left and right topological location arguments + assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged and the side flipped. + + The coordinates of the ring (must not contain repeated points). + The distance at which to create the buffer. + The side of the ring on which to construct the buffer line. + The location on the L side of the ring (if it is CW). + The location on the R side of the ring (if it is CW). + + + + The ringCoord is assumed to contain no repeated points. + It may be degenerate (i.e. contain only 1, 2, or 3 points). + In this case it has no area, and hence has a minimum diameter of 0. + + + + + + + + Tests whether a triangular ring would be eroded completely by the given + buffer distance. + This is a precise test. It uses the fact that the inner buffer of a + triangle converges on the inCentre of the triangle (the point + equidistant from all sides). If the buffer distance is greater than the + distance of the inCentre from a side, the triangle will be eroded completely. + This test is important, since it removes a problematic case where + the buffer distance is slightly larger than the inCentre distance. + In this case the triangle buffer curve "inverts" with incorrect topology, + producing an incorrect hole in the buffer. + + + + + + + + A list of the vertices in a constructed offset curve. + + Automatically removes close adjacent vertices. + Martin Davis + + + + Function to add a point + + + The point is only added if evaluates to false. + + The point to add. + + + + Tests whether the given point duplicates the previous point in the list (up to tolerance) + + The point to test + true if the point duplicates the previous point + + + + Automatically closes the ring (if it not alread is). + + + + + Gets/Sets the precision model to use when adding new points. + + + + + The distance below which two adjacent points on the curve are considered to be coincident. + + This is chosen to be a small fraction of the offset distance. + + + + Gets the Coordinates for the curve. + + + + + A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, + and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Locates a subgraph inside a set of subgraphs, + in order to determine the outside depth of the subgraph. + The input subgraphs are assumed to have had depths + already calculated for their edges. + + + + + + + + + + + + + + + + + + Finds all non-horizontal segments intersecting the stabbing line. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + A List of {DepthSegments} intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the list of dirEdges. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the input dirEdge. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + A segment from a directed edge which has been assigned a depth value + for its sides. + + + + + + + + + + + + Defines a comparison operation on DepthSegments + which orders them left to right. + Assumes the segments are normalized. + + The definition of ordering is: + + -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). + 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). + 0 : if the segments are identical + + + + Known Bugs: + + The logic does not obey the contract. + This is acceptable for the intended usage, but may cause problems if used with some + utilities in the .Net standard library (e.g. . + + + A DepthSegment + The comparison value + + + + Compare two collinear segments for left-most ordering. + If segs are vertical, use vertical ordering for comparison. + If segs are equal, return 0. + Segments are assumed to be directed so that the second coordinate is >= to the first + (e.g. up and to the right). + + A segment to compare. + A segment to compare. + + + + + + + + + + Finds the approximate maximum distance from a buffer curve to + the originating geometry. + + The approximate maximum distance is determined by testing + all vertices in the buffer curve, as well + as midpoints of the curve segments. + Due to the way buffer curves are constructed, this + should be a very close approximation. + This is similar to the Discrete Oriented Hausdorff distance + from the buffer curve to the input. + + mbdavis + + + + Validates that a given buffer curve lies an appropriate distance + from the input generating it. + + + Useful only for round buffers (cap and join). + Can be used for either positive or negative distances. + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + mbdavis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + + Checks that two geometries are at least a minumum distance apart. + + A geometry + A geometry + The minimum distance the geometries should be separated by + + + + Checks that the furthest distance from the buffer curve to the input + is less than the given maximum distance. + + + This uses the Oriented Hausdorff distance metric. It corresponds to finding + the point on the buffer curve which is furthest from some point on the input. + + A geometry + A geometry + The maximum distance that a buffer result can be from the input + + + + Gets a geometry which indicates the location and nature of a validation failure. + + The indicator is a line segment showing the location and size + of the distance discrepancy. + + + A geometric error indicator + or null, if no error was found + + + + Validates that the result of a buffer operation + is geometrically correct, within a computed tolerance. + + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + This test may be (much) more expensive than the original buffer computation. + + Martin Davis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + Checks whether the geometry buffer is valid, and returns an error message if not. + + + + + An appropriate error message
+ or nullif the buffer is valid
+ +
+ + + Gets the error message + + + + + Gets the error location + + + + + Gets a geometry which indicates the location and nature of a validation failure. + + If the failure is due to the buffer curve being too far or too close + to the input, the indicator is a line segment showing the location and size + of the discrepancy. + + + A geometric error indicator
+ or null, if no error was found
+
+ + + Computes the Euclidean distance (L2 metric) from a Point to a Geometry. + Also computes two points which are separated by the distance. + + + + + Contains a pair of points and the distance between them. + Provides methods to update with a new point pair with + either maximum or minimum distance. + + + + + Initializes the points, avoiding recomputing the distance. + + The first point + The second point + The distance between and + + + + A wrapper which + projects 3D coordinates into one of the + three Cartesian axis planes, + using the standard orthonormal projection + (i.e. simply selecting the appropriate ordinates into the XY ordinates). + The projected data is represented as 2D coordinates. + + Martin Davis + + + + Creates a wrapper projecting to the XY plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the XZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the YZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Find two points on two 3D s which lie within a given distance, + or else are the nearest points on the geometries (in which case this also + provides the distance between the geometries). + + 3D geometries have vertex Z ordinates defined. + 3D s are assumed to lie in a single plane (which is enforced if not actually the case). + 3D s and s may have any configuration. + + The distance computation also finds a pair of points in the input geometries + which have the minimum distance between them. If a point lies in the interior + of a line segment, the coordinate computed is a close approximation to the + exact point. + + The algorithms used are straightforward O(n^2) comparisons. This worst-case + performance could be improved on by using Voronoi techniques or spatial + indexes. + + 1.13 + + + + Compute the distance between the nearest points of two geometries. + + A geometry + A geometry + The distance between the geometries + + + + Test whether two geometries lie within a given distance of each other. + + A geometry + A geometry + The distance to test + true if g0.distance(g1) <= + + + + Compute the the nearest points of two geometries. The points are + presented in the same order as the input Geometries. + + A geometry + A geometry + The nearest points in the geometries + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + The distance on which to terminate the search + + + + Report the distance between the nearest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty
+ Thrown if either input geometry is null. +
+ + + Report the coordinates of the nearest points in the input geometries. The + points are presented in the same order as the input Geometries. + + A pair of s of the nearest points + + + + Gets the locations of the nearest points in the input geometries. The + locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points + + + + Finds the index of the "most polygonal" input geometry. + This optimizes the computation of the best-fit plane, + since it is cached only for the left-hand geometry. + + The index of the most polygonal geometry + + + + Convenience method to create a Plane3DPolygon + + + + + Computes distance between two polygons. + + + To compute the distance, compute the distance + between the rings of one polygon and the other polygon, + and vice-versa. + If the polygons intersect, then at least one ring must + intersect the other polygon. + Note that it is NOT sufficient to test only the shell rings. + A counter-example is a "figure-8" polygon A + and a simple polygon B at right angles to A, with the ring of B + passing through the holes of A. + The polygons intersect, + but A's shell does not intersect B, and B's shell does not intersect A. + + + Compute distance between a polygon and the rings of another. + + + Computes a point at a distance along a segment + specified by two relatively proportional values. + The fractional distance along the segment is d0/(d0+d1). + + @param p0 + start point of the segment + @param p1 + end point of the segment + @param d0 + proportional distance from start point to computed point + @param d1 + proportional distance from computed point to end point + @return the computed point + + + + Models a polygon lying in a plane in 3-dimensional Cartesian space. + The polygon representation is supplied + by a , + containing coordinates with XYZ ordinates. + 3D polygons are assumed to lie in a single plane. + The plane best fitting the polygon coordinates is + computed and is represented by a . + + Martin Davis + + + + Computes an average normal vector from a list of polygon coordinates. + Uses Newell's method, which is based + on the fact that the vector with components + equal to the areas of the projection of the polygon onto + the Cartesian axis planes is normal. + + @param seq the sequence of coordinates for the polygon + @return a normal vector + + + Computes a point which is the average of all coordinates + in a sequence. + If the sequence lies in a single plane, + the computed point also lies in the plane. + + @param seq a coordinate sequence + @return a Coordinate with averaged ordinates + + + + A ConnectedElementPointFilter extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list. The elements of the list are + com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + Returns a list containing a point from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. The elements of the list + are com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + + + + + + + + + + + + + Extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list + + + + + Returns a list containing a Coordinate from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. + + + + + + + + + + + + + + + + + Computes the distance and + closest points between two Geometrys. + The distance computation finds a pair of points in the input geometries + which have minimum distance between them. These points may + not be vertices of the geometries, but may lie in the interior of + a line segment. In this case the coordinate computed is a close + approximation to the exact point. + The algorithms used are straightforward O(n^2) + comparisons. This worst-case performance could be improved on + by using Voronoi techniques. + + + + + Compute the distance between the closest points of two geometries. + + A Geometry. + Another Geometry. + The distance between the geometries. + + + + Test whether two geometries lie within a given distance of each other. + + + + + + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + The distance on which to terminate the search. + + + + Report the distance between the closest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty.
+ if either input geometry is null +
+ + + Report the coordinates of the closest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the closest points. + + + + Report the locations of the closest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the closest points. + + + + Report the coordinates of the nearest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the nearest points. + + + + Report the locations of the nearest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points. + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes distance between facets (lines and points) of input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a sequence of facets (points or line segments) of a + specified by a subsequence of a . + + Martin Davis + + + + Creates a new section based on a CoordinateSequence. + + The sequence holding the points in the section + The index of the start point + The index of the end point + 1 + + + + Creates a new sequence for a single point from a CoordinateSequence. + + The sequence holding the points in the facet sequence + the index of the point + + + + Gets the coordinate at the given index + + The index + The coordinate at the given index + + + + Computes the distance to another facet sequence + + The other facet sequence + The distance between this and . + + + + Gets the envelope of this facet sequence + + + + + Gets the number of coordinates in this facet sequence + + + + + Tests if this facet sequence consists of only one point + + + + + Utility class to build facet sequencs STRtrees- + + + + + + + + + + + + Creates facet sequences from a given geometry + + The geometry + A list of s + + + + Represents the location of a point on a Geometry. + Maintains both the actual point location + (which may not be exact, if the point is not a vertex) + as well as information about the component + and segment index where the point occurs. + Locations inside area Geometrys will not have an associated segment index, + so in this case the segment index will have the sentinel value of . + + + + + A special value of segmentIndex used for locations inside area geometries. + These locations are not located on a segment, + and thus do not have an associated segment index. + + + + + Constructs a GeometryLocation specifying a point on a point, as well as the + segment that the point is on (or if the point is not on a segment). + + The component of the geometry containing the point + The segment index of the location, or + The coordinate of the location + + + + Constructs a GeometryLocation specifying a point inside an area point. + + The component of the geometry containing the point + The coordinate of the location + + + + Returns the geometry component on (or in) which this location occurs. + + + + + Returns the segment index for this location. If the location is inside an + area, the index will have the value . + + + + + Returns the of this location. + + + + + Tests whether this location represents a point inside an area geometry. + + + + + Computes the distance between the facets (segments and vertices) + of two s + using a Branch-and-Bound algorithm. + The Branch-and-Bound algorithm operates over a + traversal of R-trees built + on the target and possibly also the query geometries. + + This approach provides the following benefits: + + + Performance is improved due to the effects of the R-tree index + and the pruning due to the Branch-and-Bound approach + + The spatial index on the target geometry can be cached + to allow reuse in an incremental query situation. + + Using this technique can be much more performant + than using + when one or both input geometries are large, + or when evaluating many distance computations against + a single geometry. + + + This class is not thread-safe. + + Martin Davis + + + + + Computes the distance between two geometries using the indexed approach. + + + For geometries with many segments or points, + this can be faster than using a simple distance + algorithm. + + A geometry + A geometry + The distance between the two geometries + + + + Creates a new distance-finding instance for a given target . + + + + Distances will be computed to all facets of the input geometry. + The facets of the geometry are the discrete segments and points + contained in its components. + + In the case of and inputs, + this is equivalent to computing the conventional distance. + + In the case of inputs, this is equivalent + to computing the distance to the polygons boundaries. + + + A Geometry, which may be of any type. + + + + Computes the distance from the base geometry to the given geometry. + + The geometry to compute the distance to. + The computed distance + + + * Tests whether the base geometry lies within + * a specified distance of the given geometry. + * + //* @param g the geomtry to test + //* @param maximumDistance the maximum distance to test + //* @return true if the geometry lies with the specified distance + + + + The base class for operations that require s. + + + + + + + + + + The operation args into an array so they can be accessed by index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether a is simple. + In general, the SFS specification of simplicity + follows the rule: + + + A Geometry is simple if and only if the only self-intersections are at boundary points. + + + + + Simplicity is defined for each } subclass as follows: + + Valid geometries are simple by definition, so + IsSimple trivially returns true.
+ (Note: this means that IsSimple cannot be used to test + for (invalid) self-intersections in Polygons. + In order to check if a Polygonal geometry has self-intersections, + use ).
+ geometries are simple if and only if they do not self-intersect at interior points + (i.e. points other than boundary points). + This is equivalent to saying that no two linear components satisfy the SFS + predicate. + Zero-dimensional () geometries are simple if and only if they have no + repeated points. + Empty s are always simple by definition. +
+ For geometries the evaluation of simplicity + can be customized by supplying a + to define how boundary points are determined. + The default is the SFS-standard . + Note that under the Mod-2 rule, closed LineStrings (rings) + will never satisfy the touches predicate at their endpoints, since these are + interior points, not boundary points. + If it is required to test whether a set of LineStrings touch + only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. + For example, this can be used to validate that a set of lines form a topologically valid + linear network. +
+
+ + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + + + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + The geometry to test + + + + Creates a simplicity checker using a given + + The geometry to test + The rule to use + + + + Tests whether the geometry is simple. + + true if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + A MultiPoint is simple if it has no repeated points. + + + + + Computes simplicity for polygonal geometries. + Polygonal geometries are simple if and only if + all of their component rings are simple. + + A Polygonal geometry + true if the geometry is simple + + + Semantics for GeometryCollection is + simple iff all components are simple. + A GeometryCollection + true if the geometry is simple + + + + For all edges, check if there are any intersections which are NOT at an endpoint. + The Geometry is not simple if there are intersections not at endpoints. + + + + + + Tests that no edge intersection is the endpoint of a closed line. + This ensures that closed lines are not touched at their endpoint, + which is an interior point according to the Mod-2 rule + To check this we compute the degree of each endpoint. + The degree of endpoints of closed lines + must be exactly 2. + + + + + Add an endpoint to the map, creating an entry for it if none exists. + + + + + + + + Gets a coordinate for the location where the geometry fails to be simple. + (i.e. where it has a non-boundary self-intersection). + must be called before this location is accessed + + a coordinate for the location of the non-boundary self-intersection + or null if the geometry is simple + + + + + + + + + Creates an instance of this class + + The endpoint + + + + A sequence of LineMergeDirectedEdges forming one of the lines that will + be output by the line-merging process. + + + + + Constructs an EdgeString with the given factory used to convert this EdgeString + to a LineString. + + + + + + Adds a directed edge which is known to form part of this line. + + + + + + Converts this EdgeString into a LineString. + + + + + + + + + + A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. + + + + + Represents a directed edge in a PlanarGraph. A DirectedEdge may or + may not have a reference to a parent Edge (some applications of + planar graphs may not require explicit Edge objects to be created). Usually + a client using a PlanarGraph will subclass DirectedEdge + to add its own application-specific data and methods. + + + + + The base class for all graph component classes. + Maintains flags of use in generic graph algorithms. + Provides two flags: + marked - typically this is used to indicate a state that persists + for the course of the graph's lifetime. For instance, it can be + used to indicate that a component has been logically deleted from the graph. + visited - this is used to indicate that a component has been processed + or visited by an single graph algorithm. For instance, a breadth-first traversal of the + graph might use this to indicate that a node has already been traversed. + The visited flag may be set and cleared many times during the lifetime of a graph. + + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Finds the first + in a set + which has the specified state. + + A to scan. + The state to test. + The first found, or null if none found. + + + + Tests if a component has been visited during the course of a graph algorithm. + + + + + Gets/Sets the visited flag for this component. + + + + + Tests if a component has been marked at some point during the processing + involving this graph. + + + + + Gets/Sets the marked flag for this component. + + + + + Tests whether this component has been removed from its containing graph. + + + + + Gets or sets user defined data for this component + + + + + Returns a List containing the parent Edge (possibly null) for each of the given + DirectedEdges. + + + + + + + Constructs a DirectedEdge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Writes a detailed string representation of this DirectedEdge to the given PrintStream. + + + + + + Removes this directed edge from its containing graph. + + + + + Returns this DirectedEdge's parent Edge, or null if it has none. + Associates this DirectedEdge with an Edge (possibly null, indicating no associated + Edge). + + + + + Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's + orientation lies. + + + + + Returns a point to which an imaginary line is drawn from the from-node to + specify this DirectedEdge's orientation. + + + + + Returns whether the direction of the parent Edge (if any) is the same as that + of this Directed Edge. + + + + + Returns the node from which this DirectedEdge leaves. + + + + + Returns the node to which this DirectedEdge goes. + + + + + Returns the coordinate of the from-node. + + + + + Returns the angle that the start of this DirectedEdge makes with the + positive x-axis, in radians. + + + + + Returns the symmetric DirectedEdge -- the other DirectedEdge associated with + this DirectedEdge's parent Edge. + Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite + direction. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeDirectedEdge connecting the from node to the to node. + + + + + specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the directed edge that starts at this directed edge's end point, or null + if there are zero or multiple directed edges starting there. + + + + + An edge of a LineMergeGraph. The marked field indicates + whether this Edge has been logically deleted from the graph. + + + + + Represents an undirected edge of a {PlanarGraph}. An undirected edge + in fact simply acts as a central point of reference for two opposite + DirectedEdges. + Usually a client using a PlanarGraph will subclass Edge + to add its own application-specific data and methods. + + + + + The two DirectedEdges associated with this Edge. + + + + + Constructs an Edge whose DirectedEdges are not yet set. Be sure to call + SetDirectedEdges(DirectedEdge, DirectedEdge). + + + + + Constructs an Edge initialized with the given DirectedEdges, and for each + DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds + this Edge to its from-Node. + + + + + + + Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the + Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. + + + + + + + Returns one of the DirectedEdges associated with this Edge. + + 0 or 1. + + + + + Returns the DirectedEdge that starts from the given node, or null if the + node is not one of the two nodes associated with this Edge. + + + + + + + If node is one of the two nodes associated with this Edge, + returns the other node; otherwise returns null. + + + + + + + Removes this edge from its containing graph. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeEdge with vertices given by the specified LineString. + + + + + + Returns the LineString specifying the vertices of this edge. + + + + + A planar graph of edges that is analyzed to sew the edges together. The + marked flag on com.vividsolutions.planargraph.Edges + and com.vividsolutions.planargraph.Nodes indicates whether they have been + logically deleted from the graph. + + + + + Represents a directed graph which is embeddable in a planar surface. + This class and the other classes in this package serve as a framework for + building planar graphs for specific algorithms. This class must be + subclassed to expose appropriate methods to construct the graph. This allows + controlling the types of graph components ({DirectedEdge}s, + Edges and Nodes) which can be added to the graph. An + application which uses the graph framework will almost always provide + subclasses for one or more graph components, which hold application-specific + data and graph algorithms. + + + + + + + + + + + + + + + + + + + + Returns the at the given location, or null if no was there. + + The location + The node found
+ or null if this graph contains no node at the location +
+
+ + + Adds a node to the map, replacing any that is already at that location. + Only subclasses can add Nodes, to ensure Nodes are of the right type. + + + The added node. + + + + Adds the Edge and its DirectedEdges with this PlanarGraph. + Assumes that the Edge has already been created with its associated DirectEdges. + Only subclasses can add Edges, to ensure the edges added are of the right class. + + + + + + Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, + to ensure the edges added are of the right class. + + + + + + Returns an IEnumerator over the Nodes in this PlanarGraph. + + + + + + Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they + were added. + + + + + + Returns an Iterator over the Edges in this PlanarGraph, in the order in which they + were added. + + + + + + Removes an Edge and its associated DirectedEdges from their from-Nodes and + from this PlanarGraph. Note: This method does not remove the Nodes associated + with the Edge, even if the removal of the Edge reduces the degree of a + Node to zero. + + + + + + Removes a from its from- and from this PlanarGraph. + + + This method does not remove the s associated with the DirectedEdge, + even if the removal of the DirectedEdge reduces the degree of a Node to zero. + + + + + + Removes a node from the graph, along with any associated DirectedEdges and + Edges. + + + + + + Returns all Nodes with the given number of Edges around it. + + + + + + + Returns the Nodes in this PlanarGraph. + + + + + Returns the Edges that have been added to this PlanarGraph. + + + + + Adds an Edge, DirectedEdges, and Nodes for the given LineString representation + of an edge. + + + + + + + + + + + + Sews together a set of fully noded LineStrings. + + + Sewing stops at nodes of degree 1 + or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, + in which case a node is simply chosen as a starting point. The direction of each + merged LineString will be that of the majority of the LineStrings from which it + was derived. + + Any dimension of Geometry is handled -- the constituent linework is extracted to + form the edges. The edges must be correctly noded; that is, they must only meet + at their endpoints. The LineMerger will still run on incorrectly noded input + but will not form polygons from incorrected noded edges. + + NOTE:once merging has been performed, no more + + + + + Adds a Geometry to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the LineStrings built by the merging process. + + + + + + + + + + + + + + + + + + + + + + + + Builds a sequence from a set of s, + so that they are ordered end to end. + A sequence is a complete non-repeating list of the linear + components of the input. Each linestring is oriented + so that identical endpoints are adjacent in the list. + + + The input linestrings may form one or more connected sets. + The input linestrings should be correctly noded, or the results may + not be what is expected. + The output of this method is a single , + containing the ordered linestrings in the sequence. + + + The sequencing employs the classic 'Eulerian path' graph algorithm. + Since Eulerian paths are not uniquely determined, further rules are used to + make the computed sequence preserve as much as possible of the input ordering. + Within a connected subset of lines, the ordering rules are: + - If there is degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If there is a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + + + Not all arrangements of lines can be sequenced. + For a connected set of edges in a graph, + Euler's Theorem states that there is a sequence containing each edge once + if and only if there are no more than 2 nodes of odd degree. + If it is not possible to find a sequence, the + property will return false. + + + + + + Tests whether a is sequenced correctly. + s are trivially sequenced. + s are checked for correct sequencing. + Otherwise, IsSequenced is defined + to be true for geometries that are not lineal. + + The to test. + + true if the is sequenced or is not lineal. + + + + + Adds a of s to be sequenced. + May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be extracted. + + A of geometries to add. + + + + Adds a to be sequenced. + May be called multiple times. + Any dimension of may be added; + the constituent linework will be extracted. + + + + + + Tests whether the arrangement of linestrings has a valid sequence. + + true if a valid sequence exists. + + + + Returns the or + built by the sequencing process, if one exists. + + The sequenced linestrings, + or null if a valid sequence does not exist. + + + + Tests whether a complete unique path exists in a graph + using Euler's Theorem. + + The containing the edges. + true if a sequence exists. + + + + Finds an for an unvisited edge (if any), + choosing the which preserves orientation, if possible. + + The to examine. + + The found, + or null if none were unvisited. + + + + + Computes a version of the sequence which is optimally + oriented relative to the underlying geometry. + + Heuristics used are: + - If the path has a degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If the path has a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + (NOTE: in this case could orient the sequence according to the majority of the + linestring orientations). + + + A of s. + + A of s oriented appropriately. + + + + + Reverse the sequence. + This requires reversing the order of the s, + and flipping each as well. + + + A enumeration of s, + in sequential order. + + The reversed sequence. + + + + Builds a geometry ( or ) + representing the sequence. + + + An enumeration of s of s + with s as their parent edges. + + + The sequenced geometry, or null if no sequence exists. + + + + + A private implementation for + + + + + Initializes a new instance of the class. + + The sequencer. + + + + Performs an operation with or on + + + A to which the filter is applied. + + + + + Nodes a set of edges. + Takes one or more sets of edges and constructs a + new set of edges consisting of all the split edges created by + noding the input edges together. + + + + + + + + + + + + + + + + + + + + + + Forms NTS LineStrings out of a the graph of DirectedEdges + created by an OverlayOp. + + + + + + + + + + + + + + + + + A list of the LineStrings in the result of the specified overlay operation. + + + + + Find and mark L edges which are "covered" by the result area (if any). + L edges at nodes which also have A edges can be checked by checking + their depth at that node. + L edges at nodes which do not have A edges can be checked by doing a + point-in-polygon test with the previously computed result areas. + + + + + + + + + + + + + + + + + + + Collect edges from Area inputs which should be in the result but + which have not been included in a result area. + This happens ONLY: + during an intersection when the boundaries of two + areas touch in a line segment + OR as a result of a dimensional collapse. + + + + + + + + + + + + + + + + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A ring of edges which may contain nodes of degree > 2. + A MaximalEdgeRing may represent two different spatial entities: + a single polygon possibly containing inversions (if the ring is oriented CW) + a single hole possibly containing exversions (if the ring is oriented CCW) + If the MaximalEdgeRing represents a polygon, + the interior of the polygon is strongly connected. + These are the form of rings used to define polygons under some spatial data models. + However, under the OGC SFS model, MinimalEdgeRings are required. + A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the + BuildMinimalRings() method. + + + + + + + + + + + + + + + + + + + + + + + + + + For all nodes in this EdgeRing, + link the DirectedEdges at the node to form minimalEdgeRings + + + + + + + + + + + A ring of edges with the property that no node + has degree greater than 2. These are the form of rings required + to represent polygons under the OGC SFS spatial data model. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates nodes for use in the PlanarGraphs constructed during + overlay operations. + + + + + + + + + + + + The spatial functions supported by this class. + These operations implement various bool combinations of the resultants of the overlay. + + + + + The code for the Intersection overlay operation + + + + + The code for the Union overlay operation + + + + + The code for the Difference overlay operation + + + + + The code for the Symmetric Difference overlay operation + + + + + Computes the geometric overlay of two s. The overlay + can be used to determine any bool combination of the geometries. + + + + + Computes an overlay operation + for the given geometry arguments. + + The first geometry argument + The second geometry argument + The code for the desired overlay operation + The result of the overlay operation + Thrown if a robustness problem is encountered. + + + + Tests whether a point with a given topological + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + The topological label of the point + The code for the overlay operation to test + true if the label locations correspond to the overlayOpCode + + + + Tests whether a point with given s + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + the code for the location in the first geometry + the code for the location in the second geometry + the code for the overlay operation to test + true if the locations correspond to the overlayOpCode. + + + + Constructs an instance to compute a single overlay operation + for the given geometries. + + The first geometry argument + The second geometry argument + + + + Gets the result of the overlay for a given overlay operation. + + Note: this method can be called once only. + + The code of the overlay operation to perform + The computed result geometry + Thrown if a robustness problem is encountered + + + + Insert an edge from one of the noded input graphs. + Checks edges that are inserted to see if an + identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + The edge to insert + + + + Update the labels for edges according to their depths. + For each edge, the depths are first normalized. + Then, if the depths for the edge are equal, + this edge must have collapsed into a line edge. + If the depths are not equal, update the label + with the locations corresponding to the depths + (i.e. a depth of 0 corresponds to a Location of Exterior, + a depth of 1 corresponds to Interior) + + + + + If edges which have undergone dimensional collapse are found, + replace them with a new edge which is a L edge + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a previously computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Compute initial labelling for all DirectedEdges at each node. + In this step, DirectedEdges will acquire a complete labelling + (i.e. one with labels for both Geometries) + only if they + are incident on a node which has edges for both Geometries + + + + + For nodes which have edges from only one Geometry incident on them, + the previous step will have left their dirEdges with no labelling for the other + Geometry. However, the sym dirEdge may have a labelling for the other + Geometry, so merge the two labels. + + + + + Incomplete nodes are nodes whose labels are incomplete. + (e.g. the location for one Geometry is null). + These are either isolated nodes, + or nodes which have edges from only a single Geometry incident on them. + Isolated nodes are found because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + When each node labelling is completed, the labelling of the incident + edges is updated, to complete their labelling as well. + + + + + Label an isolated node with its relationship to the target point. + + + + + Find all edges whose label indicates that they are in the result area(s), + according to the operation being performed. Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + If both a dirEdge and its sym are marked as being in the result, cancel + them out. + + + + + Tests if a point node should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Line or Area geometry. + + + + Tests if an L edge should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Area geometry. + + + + true if the coord is located in the interior or boundary of + a point in the list. + + + + + Creates an empty result geometry of the appropriate dimension, + based on the given overlay operation and the dimensions of the inputs. + The created geometry is always an atomic geometry, + not a collection. + + The empty result is constructed using the following rules: + + - result has the dimension of the lowest input dimension + - result has the dimension of the highest input dimension + - result has the dimension of the left-hand input + - result has the dimension of the highest input dimension + (since symDifference is the union of the differences). + + + The overlay operation being performed + An input geometry + An input geometry + The geometry factory being used for the operation + An empty atomic geometry of the appropriate dimension + + + + Disable + when an intersection is made (), + so performances are dramatically improved but failures are not managed. + + + Use ay your own risk! + + + + + Gets the graph constructed to compute the overlay. + + + + + Constructs Points from the nodes of an overlay graph. + + + + + + + + + + + + + + + + + A list of the Points in the result of the specified overlay operation. + + + + + + + + + + + + This method simplifies the resultant Geometry by finding and eliminating + "covered" points. + A point is covered if it is contained in another element Geometry + with higher dimension (e.g. a point might be contained in a polygon, + in which case the point can be eliminated from the resultant). + + + + + + + Forms Polygons out of a graph of {DirectedEdge}s. + The edges to use are marked as being in the result Area. + + + + + + + + + + + Add a complete graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + Add a set of edges and nodes, which form a graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + + For all DirectedEdges in result, form them into MaximalEdgeRings. + + + + + + + + + + + + + + + + This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, + and tests whether they form a Polygon. This is the case if there is a single shell + in the list. In this case the shell is returned. + The other possibility is that they are a series of connected holes, in which case + no shell is returned. + + The shell EdgeRing, if there is one
or + null, if all the rings are holes.
+
+ + + This method assigns the holes for a Polygon (formed from a list of + MinimalEdgeRings) to its shell. + Determining the holes for a MinimalEdgeRing polygon serves two purposes: + it is faster than using a point-in-polygon check later on. + it ensures correctness, since if the PIP test was used the point + chosen might lie on the shell, which might return an incorrect result from the + PIP test. + + + + + + + For all rings in the input list, + determine whether the ring is a shell or a hole + and add it to the appropriate list. + Due to the way the DirectedEdges were linked, + a ring is a shell if it is oriented CW, a hole otherwise. + + + + + + + + This method determines finds a containing shell for all holes + which have not yet been assigned to a shell. + These "free" holes should + all be properly contained in their parent shells, so it is safe to use the + findEdgeRingContaining method. + (This is the case because any holes which are NOT + properly contained (i.e. are connected to their + parent shell) would have formed part of a MaximalEdgeRing + and been handled in a previous step). + + + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
or + null if no containing EdgeRing is found.
+
+ + + + + + + + + + Checks the current set of shells (with their associated holes) to + see if any of them contain the point. + + + + + + + + + + + + Snaps the vertices and segments of a + to another Geometry's vertices. + A snap distance tolerance is used to control where snapping is performed. + Snapping one geometry to another can improve + robustness for overlay operations by eliminating + nearly-coincident edges + (which cause problems during noding and intersection calculation). + It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. + Too much snapping can result in invalid topology + beging created, so the number and location of snapped vertices + is decided using heuristics to determine when it + is safe to snap. + This can result in some potential snaps being omitted, however. + + Martin Davis + + + + Estimates the snap tolerance for a Geometry, taking into account its precision model. + + + The estimated snap tolerance + + + + + + + + + + + + + + + + + + + Snaps two geometries together with a given tolerance. + + + + + + + + + Snaps a geometry to itself. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. + + the geometry to snap + the snapping tolerance + whether the result should be made valid + a new snapped + + + + Creates a new snapper acting on the given geometry + + the geometry to snap + + + + Snaps the vertices in the component s + of the source geometry to the vertices of the given snap geometry. + + a geometry to snap the source to + + a new snapped Geometry + + + Snaps the vertices in the component s + of the source geometry to the vertices of the same geometry. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + The snapping tolerance + Whether the result should be made valid + The geometry snapped to itself + + + + + + + + + + + Computes the snap tolerance based on the input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snaps the vertices and segments of a + to a set of target snap vertices. + A snap distance tolerance is used to control where snapping is performed. + The implementation handles empty geometry and empty snap vertex sets. + + + + + Creates a new snapper using the points in the given + as target snap points. + + A LineString to snap (may be empty) + the snap tolerance to use + + + + Creates a new snapper using the given points + as source points to be snapped. + + + + + + + Snaps the vertices and segments of the source LineString + to the given set of snap points. + + the vertices to snap to + list of the snapped points + + + + Snap source vertices to vertices in the target. + + the points to snap + the points to snap to + + + + + + + + + + + + Snap segments of the source to nearby snap vertices. + Source segments are "cracked" at a snap vertex. + A single input segment may be snapped several times + to different snap vertices. + For each distinct snap vertex, at most one source segment + is snapped to. This prevents "cracking" multiple segments + at the same point, which would likely cause + topology collapse when being used on polygonal linework. + + The coordinates of the source linestring to snap + The target snap vertices + + + + Finds a src segment which snaps to (is close to) the given snap point + Only a single segment is selected for snapping. + This prevents multiple segments snapping to the same snap vertex, + which would almost certainly cause invalid geometry + to be created. + (The heuristic approach of snapping used here + is really only appropriate when + snap pts snap to a unique spot on the src geometry) + Also, if the snap vertex occurs as a vertex in the src coordinate list, + no snapping is performed. + + The point to snap to + The source segment coordinates + The index of the snapped segment
+ or -1 if no segment snaps to the snap point.
+
+ + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class only uses snapping + if an error is detected when running the standard JTS overlay code. + Errors detected include thrown exceptions + (in particular, ) + and invalid overlay computations. + + + + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class always uses snapping. + This is less performant than the standard JTS overlay code, + and may even introduce errors which were not present in the original data. + For this reason, this class should only be used + if the standard overlay code fails to produce a correct result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds the most likely of a point relative to + the polygonal components of a geometry, using a tolerance value. + + + If a point is not clearly in the Interior or Exterior, + it is considered to be on the Boundary. + In other words, if the point is within the tolerance of the Boundary, + it is considered to be on the Boundary; otherwise, + whether it is Interior or Exterior is determined directly. + + Martin Davis + + + + Extracts linework for polygonal components. + + The geometry from which to extract + A lineal geometry containing the extracted linework + + + + Extracts the LineStrings in the boundaries of all the polygonal elements in the target . + + Martin Davis + + + + Filters out all linework for polygonal elements + + + + + Gets the list of polygonal linework. + + + + + Generates points offset by a given distance from both sides of the midpoint of all segments in a . + + + + Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. + + + The input geometry may have any orientation for its rings, + but is + only meaningful if the orientation is known. + + + Martin Davis + + + Set the sides on which to generate offset points. + + @param doLeft + @param doRight + + + + Gets the computed offset points. + + + + + Generates the two points which are offset from the + midpoint of the segment (p0, p1) by the offsetDistance + + The first point of the segment to offset from. + The second point of the segment to offset from + + + + + + Validates that the result of an overlay operation is geometrically correct within a determined tolerance. + Uses fuzzy point location to find points which are + definitely in either the interior or exterior of the result + geometry, and compares these results with the expected ones. + + + This algorithm is only useful where the inputs are polygonal. + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + Martin Davis + + + + + Represents a ring of PolygonizeDirectedEdges which form + a ring of a polygon. The ring may be either an outer shell or a hole. + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
+ or null if no containing EdgeRing is found.
+
+ + + Finds a point in a list of points which is not contained in another list of points. + + The Coordinates to test. + An array of Coordinates to test the input points against. + A Coordinate from testPts which is not in pts,
+ or null.
+
+ + + Tests whether a given point is in an array of points. + Uses a value-based test. + + A Coordinate for the test point. + An array of Coordinates to test, + true if the point is in the array. + + + Traverses a ring of DirectedEdges, accumulating them into a list. + This assumes that all dangling directed edges have been removed + from the graph, so that there is always a next dirEdge. + + @param startDE the DirectedEdge to start traversing at + @return a List of DirectedEdges that form a ring + + + + + + + + + + Adds a DirectedEdge which is known to form part of this ring. + + The DirectedEdge to add. + + + + Computes whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + + + + Adds a hole to the polygon formed by this ring. + + The LinearRing forming the hole. + + + + Adds a hole to the polygon formed by this ring. + + the forming the hole. + + + + + + + + + + + + Updates the included status for currently non-included shells + based on whether they are adjacent to an included shell. + + + + + Gets a string representation of this object. + + + + + Tests whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + true if this ring is a hole. + + + + Computes and returns the Polygon formed by this ring and any contained holes. + + + + + Tests if the ring formed by this edge ring is topologically valid. + + true if the ring is valid. + + + + Computes and returns the list of coordinates which are contained in this ring. + The coordinatea are computed once only and cached. + + + + + Gets the coordinates for this ring as a LineString. + Used to return the coordinates in this ring + as a valid point, when it has been detected that the ring is topologically + invalid. + + + + + Returns this ring as a LinearRing, or null if an Exception occurs while + creating it (such as a topology problem). Details of problems are written to + standard output. + + + + + Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. + + + + + Gets a value indicating whether this ring has a shell assigned to it. + + + + + Tests whether this ring is an outer hole. + A hole is an outer hole if it is not contained by a shell. + + + + + Tests whether this ring is an outer shell. + + + + + Gets or sets a value indicating whether this ring has been processed. + + + + + Compares EdgeRings based on their envelope, + using the standard lexicographic ordering. + This ordering is sufficient to make edge ring sorting deterministic. + + mbdavis + + + + A DirectedEdge of a PolygonizeGraph, which represents + an edge of a polygon formed by the graph. + May be logically deleted from the graph by setting the marked flag. + + + + + Constructs a directed edge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the identifier attached to this directed edge. + Attaches an identifier to this directed edge. + + + + + Returns the next directed edge in the EdgeRing that this directed edge is a member of. + Sets the next directed edge in the EdgeRing that this directed edge is a member of. + + + + + Returns the ring of directed edges that this directed edge is + a member of, or null if the ring has not been set. + + + + + Gets/Sets the ring of directed edges that this directed edge is + a member of. + + + + + An edge of a polygonization graph. + + + + + + + + + + + + + + + + Represents a planar graph of edges that can be used to compute a + polygonization, and implements the algorithms to compute the + EdgeRings formed by the graph. + The marked flag on DirectedEdges is used to indicate that a directed edge + has be logically deleted from the graph. + + + + + + + + + + + + + + + + + + + + Deletes all edges at a node. + + + + + + Create a new polygonization graph. + + + + + + Add a LineString forming an edge of the polygon graph. + + The line to add. + + + + + + + + + + + + + + + + Convert the maximal edge rings found by the initial graph traversal + into the minimal edge rings required by NTS polygon topology rules. + + The list of start edges for the edgeRings to convert. + + + + Finds all nodes in a maximal edgering which are self-intersection nodes + + + + + The list of intersection nodes found, + or null if no intersection nodes were found. + + + + + Computes the minimal EdgeRings formed by the edges in this graph. + + A list of the{EdgeRings found by the polygonization process. + + + + Finds and labels all edgerings in the graph. + The edge rings are labeling with unique integers. + The labeling allows detecting cut edges. + + A List of the DirectedEdges in the graph. + A List of DirectedEdges, one for each edge ring found. + + + + Finds and removes all cut edges from the graph. + + A list of the LineStrings forming the removed cut edges. + + + + + + + + + + + + + + + + + Computes the next edge pointers going CCW around the given node, for the + given edgering label. + This algorithm has the effect of converting maximal edgerings into minimal edgerings + + + + + + + + + + + + + + Marks all edges from the graph which are "dangles". + Dangles are which are incident on a node with degree 1. + This process is recursive, since removing a dangling edge + may result in another edge becoming a dangle. + In order to handle large recursion depths efficiently, + an explicit recursion stack is used. + + A List containing the s that formed dangles. + + + + Traverses the polygonized edge rings in the graph + and computes the depth parity (odd or even) + relative to the exterior of the graph. + + If the client has requested that the output + be polygonally valid, only odd polygons will be constructed. + + + + + Traverses all connected edges, computing the depth parity of the associated polygons. + + + + + + Polygonizes a set of s which contain linework that + represents the edges of a planar graph. + + + All types of Geometry are accepted as input; + the constituent linework is extracted as the edges to be polygonized. + The processed edges must be correctly noded; that is, they must only meet + at their endpoints. Polygonization will accept incorrectly noded input + but will not form polygons from non-noded edges, + and reports them as errors. + + The Polygonizer reports the follow kinds of errors: + Dangles - edges which have one or both ends which are not incident on another edge endpoint + Cut Edges - edges which are connected at both ends but which do not form part of polygon + Invalid Ring Lines - edges which form rings which are invalid + (e.g. the component lines contain a self-intersection). + + Polygonization supports extracting only polygons which form a valid polygonal geometry. + The set of extracted polygons is guaranteed to be edge-disjoint. + This is useful for situations where it is known that the input lines form a + valid polygonal geometry. + + + + + + The default polygonizer output behavior + + + + + Default linestring adder. + + + + + Creates a polygonizer with the same + as the input Geometrys. + The output mask is + + + + + + Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. + + true if only polygons which form a valid polygonal geometry are to be extracted + + + + Adds a collection of s to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used. + + A list of Geometrys with linework to be polygonized. + + + + Adds a to the linework to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used + + A Geometry with linework to be polygonized. + + + + Adds a to the graph of polygon edges. + + The to add. + + + + Gets the list of polygons formed by the polygonization. + + + + + Gets a geometry representing the polygons formed by the polygonization. + If a valid polygonal geometry was extracted the result is a geometry. + + A geometry containing the polygons + + + + Gets the list of dangling lines found during polygonization. + + + + + Gets the list of cut edges found during polygonization. + + + + + Gets the list of lines forming invalid rings found during polygonization. + + + + + Performs the polygonization, if it has not already been carried out. + + + + + For each outer hole finds and includes a single outer shell. + This seeds the travesal algorithm for finding only polygonal shells. + + The list of shell EdgeRings + + + + Allows disabling the valid ring checking, + to optimize situations where invalid rings are not expected. + + The default is true + + + + Adds every linear element in a into the polygonizer graph. + + + + + Filters all geometry instances + + The geometry instance + + + + Optimized implementation of spatial predicate "contains" + for cases where the first Geometry is a rectangle. + As a further optimization, + this class can be used directly to test many geometries against a single rectangle. + + + + + + + + + + + + + Create a new contains computer for two geometries. + + A rectangular geometry. + + + + + + + + + + + + + + + + + + + + + + + + + Tests if a point is contained in the boundary of the target rectangle. + + the point to test + true if the point is contained in the boundary + + + + Tests if a linestring is completely contained in the boundary of the target rectangle. + + the linestring to test + true if the linestring is contained in the boundary + + + + Tests if a line segment is contained in the boundary of the target rectangle. + + an endpoint of the segment + an endpoint of the segment + true if the line segment is contained in the boundary + + + I + Implementation of the Intersects spatial predicate + optimized for the case where one is a rectangle. + + + This class works for all input geometries, including s. + + As a further optimization, this class can be used in batch style + to test many geometries against a single rectangle. + + + + + Crossover size at which brute-force intersection scanning + is slower than indexed intersection detection. + Must be determined empirically. Should err on the + safe side by making value smaller rather than larger. + + + + + Tests whether a rectangle intersects a given geometry. + + A rectangular polygon + A geometry of any kind + true if the geometries intersect. + + + + Create a new intersects computer for a rectangle. + + A rectangular polygon. + + + + Tests whether the given Geometry intersects the query rectangle. + + The Geometry to test (may be of any type) + true if an intersection must occur + or false if no conclusion about intersection can be made + + + + Tests whether it can be concluded that a rectangle intersects a geometry, + based on the relationship of the envelope(s) of the geometry. + + Martin Davis + + + + Creates an instance of this class using the provided Envelope + + The query envelope + + + + + + + + + + + + + + + + Reports whether it can be concluded that an intersection occurs, + or whether further testing is required. + + true if an intersection must occur
+ or false if no conclusion about intersection can be made
+
+ + + A visitor which tests whether it can be + concluded that a geometry contains a vertex of + a query geometry. + + Martin Davis + + + + + + + + + + + + + + + + + + + + + + Gets a value indicating whether it can be concluded that a corner point of the rectangle is + contained in the geometry, or whether further testing is required. + + true if a corner point is contained + or false if no conclusion about intersection can be made + + + + + A visitor to test for intersection between the query rectangle and the line segments of the geometry. + + Martin Davis + + + + Creates a visitor for checking rectangle intersection with segments + + the query rectangle + + + Reports whether any segment intersection exists. + true if a segment intersection exists or + false if no segment intersection exists + + + + Tests if any line segments in two sets of intersect. + Optimized for use when at least one input is of small size. + Short-circuited to return as soon an intersection is found. + + + + + + + + + + + + + + + + + + + + + An EdgeEndBuilder creates EdgeEnds for all the "split edges" + created by the intersections determined for an Edge. + Computes the EdgeEnds which arise from a noded Edge. + + + + + + + + + + + + Creates stub edges for all the intersections in this + Edge (if any) and inserts them into the graph. + + + + + + + Create a EdgeStub for the edge before the intersection eiCurr. + The previous intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the previous point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiPrev may be null. + + + + + + + + + Create a StubEdge for the edge after the intersection eiCurr. + The next intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the next point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiNext may be null. + + + + + + + + + A collection of EdgeStubs which obey the following invariant: + They originate at the same node and have the same direction. + Contains all EdgeEnds which start at the same point and are parallel. + + + + + + + + + + + + + + + + + + + + + + + + This computes the overall edge label for the set of + edges in this EdgeStubBundle. It essentially merges + the ON and side labels for each edge. + These labels must be compatible + + + + + + Compute the overall ON location for the list of EdgeStubs. + (This is essentially equivalent to computing the self-overlay of a single Geometry) + edgeStubs can be either on the boundary (eg Polygon edge) + OR in the interior (e.g. segment of a LineString) + of their parent Geometry. + In addition, GeometryCollections use the to determine + whether a segment is on the boundary or not. + Finally, in GeometryCollections it can occur that an edge is both + on the boundary and in the interior (e.g. a LineString segment lying on + top of a Polygon edge.) In this case the Boundary is given precendence. + These observations result in the following rules for computing the ON location: + if there are an odd number of Bdy edges, the attribute is Bdy + if there are an even number >= 2 of Bdy edges, the attribute is Int + if there are any Int edges, the attribute is Int + otherwise, the attribute is Null. + + + + + + + Compute the labelling for each side + + + + + + To compute the summary label for a side, the algorithm is: + FOR all edges + IF any edge's location is Interior for the side, side location = Interior + ELSE IF there is at least one Exterior attribute, side location = Exterior + ELSE side location = Null + Note that it is possible for two sides to have apparently contradictory information + i.e. one edge side may indicate that it is in the interior of a point, while + another edge side may indicate the exterior of the same point. This is + not an incompatibility - GeometryCollections may contain two Polygons that touch + along an edge. This is the reason for Interior-primacy rule above - it + results in the summary label having the Geometry interior on both sides. + + + + + + + Update the IM with the contribution for the computed label for the EdgeStubs. + + + + + + + + + + + + + + + + + An ordered list of EdgeEndBundles around a RelateNode. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + Insert a EdgeEnd in order in the list. + If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is + added to the bundle. Otherwise, a new EdgeEndBundle is created + to contain the EdgeEnd. + + + + + + Update the IM with the contribution for the EdgeStubs around the node. + + + + + + Computes the topological relationship between two Geometries. + RelateComputer does not need to build a complete graph structure to compute + the IntersectionMatrix. The relationship between the geometries can + be computed by simply examining the labelling of edges incident on each node. + RelateComputer does not currently support arbitrary GeometryCollections. + This is because GeometryCollections can contain overlapping Polygons. + In order to correct compute relate on overlapping Polygons, they + would first need to be noded and merged (if not explicitly, at least + implicitly). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + For all intersections on the edges of a Geometry, + label the corresponding node IF it doesn't already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + If the Geometries are disjoint, we need to enter their dimension and + boundary dimension in the Ext rows in the IM + + + + + + + + + + + Update the IM with the sum of the IMs for each component. + + + + + + Processes isolated edges by computing their labelling and adding them + to the isolated edges list. + Isolated edges are guaranteed not to touch the boundary of the target (since if they + did, they would have caused an intersection to be computed and hence would + not be isolated). + + + + + + + Label an isolated edge of a graph with its relationship to the target point. + If the target has dim 2 or 1, the edge can either be in the interior or the exterior. + If the target has dim 0, the edge must be in the exterior. + + + + + + + + Isolated nodes are nodes whose labels are incomplete + (e.g. the location for one Geometry is null). + This is the case because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A RelateNode is a Node that maintains a list of EdgeStubs + for the edges that are incident on it. + + + + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + Update the IM with the contribution for the EdgeEnds incident on this node. + + + + + + Used by the NodeMap in a RelateNodeGraph to create RelateNodes. + + + + + + + + + + + + Implements the simple graph of Nodes and EdgeEnd which is all that is + required to determine topological relationships between Geometries. + Also supports building a topological graph of a single Geometry, to + allow verification of valid topology. + It is not necessary to create a fully linked + PlanarGraph to determine relationships, since it is sufficient + to know how the Geometries interact locally around the nodes. + In fact, this is not even feasible, since it is not possible to compute + exact intersection points, and hence the topology around those nodes + cannot be computed robustly. + The only Nodes that are created are for improper intersections; + that is, nodes which occur at existing vertices of the Geometries. + Proper intersections (e.g. ones which occur between the interior of line segments) + have their topology determined implicitly, without creating a Node object + to represent them. + + + + + + + + + + + + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + Precondition: edge intersections have been computed. + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule). + + + + + + + + + + + + + Implements the SFS relate() generalized spatial predicate on two s. +
+ The class supports specifying a custom + to be used during the relate computation. +
+ + If named spatial predicates are used on the result + of the RelateOp, the result may or not be affected by the + choice of BoundaryNodeRule, depending on the exact nature of the pattern. + For instance, is insensitive + to the choice of BoundaryNodeRule, + whereas is affected by the rule chosen. + + Note: custom Boundary Node Rules do not (currently) + affect the results of other methods (such + as . The results of + these methods may not be consistent with the relationship computed by + a custom Boundary Node Rule. + +
+ + + Computes the for the spatial relationship + between two s, using the default (OGC SFS) Boundary Node Rule + + A geometry to test + A geometry to test + The IntersectonMatrix for the spatial relationship between the geometries + + + + Computes the for the spatial relationship + between two s, using the specified Boundary Node Rule + + A geometry to test + A geometry to test + The Boundary Node Rule to use + The IntersectonMatrix for the spatial relationship between the geometries + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + The Boundary Node Rule to use + + + + Gets the IntersectionMatrix for the spatial relationship + between the input geometries. + + + + + Provides an efficient method of unioning a collection of + geometrys. + The geometries are indexed using a spatial index, + and unioned recursively in index order. + For geometries with a high degree of overlap, + this has the effect of reducing the number of vertices + early in the process, which increases speed + and robustness. + + This algorithm is faster and more robust than + the simple iterated approach of + repeatedly unioning each polygon to a result geometry. + + The buffer(0) trick is sometimes faster, but can be less robust and + can sometimes take a long time to complete. + This is particularly the case where there is a high degree of overlap + between the polygons. In this case, buffer(0) is forced to compute + with all line segments from the outset, + whereas cascading can eliminate many segments + at each stage of processing. + The best situation for using buffer(0) is the trivial case + where there is no overlap between the input geometries. + However, this case is likely rare in practice. + + Martin Davis + + + + The effectiveness of the index is somewhat sensitive + to the node capacity. + Testing indicates that a smaller capacity is better. + For an STRtree, 4 is probably a good number (since + this produces 2x2 "squares"). + + + + Computes the union of + a collection of s. + + A collection of s. + + + + + Creates a new instance to union + the given collection of s. + + A collection of s + + + + Computes the union of the input geometries. + + + + This method discards the input geometries as they are processed. + In many input cases this reduces the memory retained + as the operation proceeds. + Optimal memory usage is achieved + by disposing of the original input collection + before calling this method. + + The union of the input geometries, + or null if no input geometries were provided + + if this method is called more than once + + + + Unions a list of geometries + by treating the list as a flattened binary tree, + and performing a cascaded union on the tree. + + The list of geometries to union + The union of the list + + + + Unions a section of a list using a recursive binary union on each half + of the section. + + The list of geometries containing the section to union + The start index of the section + The index after the end of the section + The union of the list section + + + + Gets the element at a given list index, or + null if the index is out of range. + + The list of geometries + The index + The geometry at the given index or + null if the index is out of range + + + + Reduces a tree of geometries to a list of geometries + by recursively unioning the subtrees in the list. + + A tree-structured list of geometries + A list of Geometrys + + + + Computes the union of two geometries, + either or both of which may be null. + + A Geometry + A Geometry + The union of the input(s) or + null if both inputs are null + + + + Unions two polygonal geometries, restricting computation + to the envelope intersection where possible. + The case of MultiPolygons is optimized to union only + the polygons which lie in the intersection of the two geometry's envelopes. + Polygons outside this region can simply be combined with the union result, + which is potentially much faster. + This case is likely to occur often during cascaded union, and may also + occur in real world data (such as unioning data for parcels on different street blocks). + + A polygonal geometry + A polygonal geometry + The intersection of the envelopes of the inputs + The union of the inputs + + + + Encapsulates the actual unioning of two polygonal geometries. + + + + Computes a containing only components. + Extracts the s from the input + and returns them as an appropriate geometry. + + If the input is already Polygonal, it is returned unchanged. + + A particular use case is to filter out non-polygonal components + returned from an overlay operation. + + The geometry to filter + A polygonal geometry + + + + Computes the union of a geometry with + another arbitrary . + Does not copy any component geometries. + + + + + + + + Unions a Collection of s or a single Geometry (which may be a ) together. + + + + By using this special-purpose operation over a collection of geometries + it is possible to take advantage of various optimizations to improve performance. + + + Heterogeneous s are fully supported. + + + The result obeys the following contract: + + Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). + Unioning a set of s has the effect of fully noding + and dissolving the input linework. + In this context "fully noded" means that there will be + an endpoint or node in the result + for every endpoint or line segment crossing in the input. + "Dissolved" means that any duplicate (e.g. coincident) line segments or portions + of line segments will be reduced to a single line segment in the output. + This is consistent with the semantics of the + operation. + If merged linework is required, the class can be used. + Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). + + + UnaryUnion always operates on the individual components of MultiGeometries. + So it is possible to use it to "clean" invalid self-intersecting MultiPolygons + (although the polygon components must all still be individually valid.) + + + + mbdavis + + + + + Computes the geometric union of a + + A collection of geometries + The union of the geometries, + or null if the input is empty + + + + Computes the geometric union of a + If no input geometries were provided but a was provided, + an empty is returned. + + A collection of geometries + The geometry factory to use if the collection is empty + The union of the geometries + or an empty GEOMETRYCOLLECTION + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + The union of the elements of the geometry + or an empty GEOMETRYCOLLECTION + + + + Constructs a unary union operation for an enumeration + of s, using the + of the input geometries. + + An enumeration of geometries + + + + Constructs a unary union operation for an enumeration + of s. + If no input geometries were provided but a was provided, + + An enumeration of geometries + The geometry factory to use if the enumeration is empty + + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + + + + Gets the union of the input geometries. + If no input geometries were provided but a was provided, + an empty is returned. + Otherwise, the return value is null + + + A Geometry containing the union + or an empty if no geometries were provided in the input, + or null if not GeometryFactory was provided + + + + + Computes the union of two geometries, either of both of which may be null. + + + + + The union of the input(s) + or null if both inputs are null + + + + + Computes a unary union with no extra optimization, and no short-circuiting. + + + Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. + + A geometry + The union of the input geometry + + + + Experimental code to union MultiPolygons with processing limited to the elements which actually interact. + + Not currently used, since it doesn't seem to offer much of a performance advantage. + mbdavis + + + + This class tests that the interior of an area + ( or ) + is connected. An area Geometry is invalid if the interior is disconnected. + This can happen if: + - a shell self-intersects, + - one or more holes form a connected chain touching a shell at two different points, + - one or more holes form a ring around a subset of the interior. + If a disconnected situation is found the location of the problem is recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form s in graph into Minimal EdgeRings. + (Minimal Edgerings must be used, because only they are guaranteed to provide + a correct isHole computation). + + + + + + + Mark all the edges for the edgeRings corresponding to the shells of the input polygons. + Only ONE ring gets marked for each shell - if there are others which remain unmarked + this indicates a disconnected interior. + + + + + + + + + + + + + + + + + + + + Check if any shell ring has an unvisited edge. + A shell ring is a ring which is not a hole and which has the interior + of the parent area on the RHS. + (Note that there may be non-hole rings with the interior on the LHS, + since the interior of holes will also be polygonized into CW rings + by the LinkAllDirectedEdges() step). + + + true if there is an unvisited edge in a non-hole ring. + + + + + + + + + Checks that a {GeometryGraph} representing an area + (a Polygon or MultiPolygon ) + is consistent with the SFS semantics for area geometries. + Checks include: + Testing for rings which self-intersect (both properly and at nodes). + Testing for duplicate rings. + If an inconsistency if found the location of the problem is recorded. + + + + + + + + + + + Returns the intersection point, or null if none was found. + + + + + + + + + + Check all nodes to see if their labels are consistent. + If any are not, return false. + + + + + Checks for two duplicate rings in an area. + Duplicate rings are rings that are topologically equal + (that is, which have the same sequence of points up to point order). + If the area is topologically consistent (determined by calling the + isNodeConsistentArea, + duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. + (This is because topologically consistent areas cannot have two rings sharing + the same line segment, unless the rings are equal). + The start point of one of the equal rings will be placed in invalidPoint. + Returns true if this area Geometry is topologically consistent but has two duplicate rings. + + + + Tests whether any of a set of {@link LinearRing}s are + nested inside another ring in the set, using a spatial + index to speed up the comparisons. + + @version 1.7 + + + + Implements the algorithsm required to compute the + method for s. + See the documentation for the various geometry types for a specification of validity. + + + + + Checks whether a coordinate is valid for processing. + Coordinates are valid iff their x and y ordinates are in the + range of the floating point representation. + + The coordinate to validate. + true if the coordinate is valid. + + + + Find a point from the list of testCoords + that is NOT a node in the edge for the list of searchCoords. + + + + + The point found, or null if none found. + + + If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). + + + + + + + + + + + + + + + + Checks validity of a Point. + + + + + + Checks validity of a MultiPoint. + + + + + + Checks validity of a LineString. + Almost anything goes for lineStrings! + + + + + + Checks validity of a LinearRing. + + + + + + Checks the validity of a polygon and sets the validErr flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there is no ring which self-intersects (except of course at its endpoints). + This is required by OGC topology rules (but not by other models + such as ESRI SDE, which allow inverted shells and exverted holes). + + + + + + Check that a ring does not self-intersect, except at its endpoints. + Algorithm is to count the number of times each node along edge occurs. + If any occur more than once, that must be a self-intersection. + + + + + Tests that each hole is inside the polygon shell. + This routine assumes that the holes have previously been tested + to ensure that all vertices lie on the shell or inside it. + A simple test of a single point in the hole can be used, + provide the point is chosen such that it does not lie on the + boundary of the shell. + + The polygon to be tested for hole inclusion. + A GeometryGraph incorporating the polygon. + + + + Tests that no hole is nested inside another hole. + This routine assumes that the holes are disjoint. + To ensure this, holes have previously been tested + to ensure that: + They do not partially overlap + (checked by checkRelateConsistency). + They are not identical + (checked by checkRelateConsistency). + + + + + Tests that no element polygon is wholly in the interior of another element polygon. + Preconditions: + Shells do not partially overlap. + Shells do not touch along an edge. + No duplicate rings exists. + This routine relies on the fact that while polygon shells may touch at one or + more vertices, they cannot touch at ALL vertices. + + + + + Check if a shell is incorrectly nested within a polygon. This is the case + if the shell is inside the polygon shell, but not inside a polygon hole. + (If the shell is inside a polygon hole, the nesting is valid.) + The algorithm used relies on the fact that the rings must be properly contained. + E.g. they cannot partially overlap (this has been previously checked by + CheckRelateConsistency). + + + + + This routine checks to see if a shell is properly contained in a hole. + It assumes that the edges of the shell and hole do not + properly intersect. + + + + + + null if the shell is properly contained, or + a Coordinate which is not inside the hole if it is not. + + + + + + + + + + + + Gets/Sets whether polygons using Self-Touching Rings to form + holes are reported as valid. + If this flag is set, the following Self-Touching conditions + are treated as being valid: + - The shell ring self-touches to create a hole touching the shell. + - A hole ring self-touches to create two holes touching at a point. + + + The default (following the OGC SFS standard) + is that this condition is not valid (false). + + + This does not affect whether Self-Touching Rings + disconnecting the polygon interior are considered valid + (these are considered to be invalid under the SFS, and many other + spatial models as well). + This includes "bow-tie" shells, + which self-touch at a single point causing the interior to be disconnected, + and "C-shaped" holes which self-touch at a single point causing an island to be formed. + + + States whether geometry with this condition is valid. + + + + Computes the validity of the geometry, + and returns true if it is valid. + + + + + Computes the validity of the geometry, + and if not valid returns the validation error for the geometry, + or null if the geometry is valid. + + The validation error, if the geometry is invalid
+ or null if the geometry is valid
+
+ + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a Quadtree + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the appropriate checks for repeated points + (consecutive identical coordinates) as defined in the + NTS spec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a simple O(n^2) + comparison. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a SweepLineIndex + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about the nature and location of + a validation error. + + + + + Not used. + + + + + No longer used: + repeated points are considered valid as per the SFS. + + + + + Indicates that a hole of a polygon lies partially + or completely in the exterior of the shell. + + + + + Indicates that a hole lies + in the interior of another hole in the same polygon. + + + + + Indicates that the interior of a polygon is disjoint + (often caused by set of contiguous holes splitting + the polygon into two parts). + + + + + Indicates that two rings of a polygonal geometry intersect. + + + + + Indicates that a ring self-intersects. + + + + + Indicates that a polygon component of a + lies inside another polygonal component. + + + + + Indicates that a polygonal geometry + contains two rings which are identical. + + + + + Indicates that either: + - A contains a single point. + - A contains 2 or 3 points. + + + + + Indicates that the X or Y ordinate of + a is not a valid + numeric value (e.g. ). + + + + + Indicates that a ring is not correctly closed + (the first and the last coordinate are different). + + + + + Contains information about the nature and location of a Geometry + validation error. + + + + + These messages must synch up with the indexes above + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds all connected s of a . + + + + + Initializes a new instance of the class. + + The . + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + + + + + + Adds the argument node and all its out edges to the subgraph. + + + + + + + + A sorted collection of DirectedEdges which leave a Node + in a PlanarGraph. + + + + + The underlying list of outgoing DirectedEdges. + + + + + Adds a new member to this DirectedEdgeStar. + + + + + + Drops a member of this DirectedEdgeStar. + + + + + + Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the zero-based index of the given DirectedEdge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the remainder when i is divided by the number of edges in this + DirectedEdgeStar. + + + + + + + Returns the on the left-hand + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + + + Returns the on the right-hand (CW) + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + Returns the number of edges around the Node associated with this DirectedEdgeStar. + + + + + Returns the coordinate for the node at wich this star is based. + + + + + Returns the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + A node in a PlanarGraph is a location where 0 or more Edges + meet. A node is connected to each of its incident Edges via an outgoing + DirectedEdge. Some clients using a PlanarGraph may want to + subclass Node to add their own application-specific + data and methods. + + + + + Returns all Edges that connect the two nodes (which are assumed to be different). + + + + + + + + The location of this Node. + + + + + The collection of DirectedEdges that leave this Node. + + + + + Constructs a Node with the given location. + + + + + + Constructs a Node with the given location and collection of outgoing DirectedEdges. + + + + + + + Adds an outgoing DirectedEdge to this Node. + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Removes a incident on this node. Does not change the state of the directed edge. + + + + + Removes this node from its containing graph. + + + + + + + + + + + Returns the location of this Node. + + + + + Returns the collection of DirectedEdges that leave this Node. + + + + + Returns the number of edges around this Node. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + Adds a node to the map, replacing any that is already at that location. + + + The added node. + + + + Removes the Node at the given location, and returns it (or null if no Node was there). + + + + + + + Returns the Node at the given location, or null if no Node was there. + + + + + + + Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the number of Nodes in this NodeMap. + + + + + A subgraph of a . + A subgraph may contain any subset of s + from the parent graph. + It will also automatically contain all s + and s associated with those edges. + No new objects are created when edges are added - + all associated components must already exist in the parent graph. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new subgraph of the given . + + + + + + Gets the which this subgraph is part of. + + + + + + Adds an to the subgraph. + The associated s and s are also added. + + The to add. + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph. + + + + + + Tests whether an is contained in this subgraph. + + The to test. + true if the is contained in this subgraph. + + + + Determines the maximum number of common most-significant + bits in the mantissa of one or numbers. + Can be used to compute the double-precision number which + is represented by the common bits. + If there are no common bits, the number computed is 0.0. + + + + + Computes the bit pattern for the sign and exponent of a + double-precision number. + + + The bit pattern for the sign and exponent. + + + + This computes the number of common most-significant bits in the mantissas + of two double-precision numbers. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + /// + The number of common most-significant mantissa bits. + + + + Zeroes the lower n bits of a bitstring. + + The bitstring to alter. + the number of bits to zero. + The zeroed bitstring. + + + + Extracts the i'th bit of a bitstring. + + The bitstring to extract from. + The bit to extract. + The value of the extracted bit. + + + + + + + + + + A representation of the Double bits formatted for easy readability + + + + + + + + + + + + Provides versions of Geometry spatial functions which use + common bit removal to reduce the likelihood of robustness problems. + In the current implementation no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + Client classes should check the validity of the returned result themselves. + + + + + Creates a new instance of class, which reshifts result Geometrys. + + + + + Creates a new instance of class, specifying whether + the result Geometrys should be reshifted. + + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry, to be subtracted from the first. + The Geometry representing the set-theoretic difference of the input Geometries. + + + Computes the set-theoretic symmetric difference of two geometries, + using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer a point, using enhanced precision. + + The Geometry to buffer. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + If required, returning the result to the orginal precision if required. + In this current implementation, no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + + The result Geometry to modify. + The result Geometry with the required precision. + + + + Computes a copy of the input Geometry with the calculated common bits + removed from each coordinate. + + The Geometry to remove common bits from. + A copy of the input Geometry with common bits removed. + + + + Computes a copy of each input Geometrys with the calculated common bits + removed from each coordinate. + + A Geometry to remove common bits from. + A Geometry to remove common bits from. + + An array containing copies + of the input Geometry's with common bits removed. + + + + + Removes common most-significant mantissa bits + from one or more s. + + The CommonBitsRemover "scavenges" precision + which is "wasted" by a large displacement of the geometry + from the origin. + For example, if a small geometry is displaced from the origin + by a large distance, + the displacement increases the significant figures in the coordinates, + but does not affect the relative topology of the geometry. + Thus the geometry can be translated back to the origin + without affecting its topology. + In order to compute the translation without affecting + the full precision of the coordinate values, + the translation is performed at the bit level by + removing the common leading mantissa bits. + + If the geometry envelope already contains the origin, + the translation procedure cannot be applied. + In this case, the common bits value is computed as zero. + + If the geometry crosses the Y axis but not the X axis + (and mutatis mutandum), + the common bits for Y are zero, + but the common bits for X are non-zero. + + + + + Add a point to the set of geometries whose common bits are + being computed. After this method has executed the + common coordinate reflects the common bits of all added + geometries. + + A Geometry to test for common bits. + + + + Removes the common coordinate bits from a Geometry. + The coordinates of the Geometry are changed. + + The Geometry from which to remove the common coordinate bits. + The shifted Geometry. + + + + Adds the common coordinate bits back into a Geometry. + The coordinates of the Geometry are changed. + + The Geometry to which to add the common coordinate bits. + + + + The common bits of the Coordinates in the supplied Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate sequence + + + + Reduces the precision of the s in a + to match the supplied . + + + Uses . + The input is modified in-place, so + it should be cloned beforehand if the + original should not be modified. + + mbdavis + + + + Creates a new precision reducer filter. + + The PrecisionModel to use + + + + Rounds the Coordinates in the sequence to match the PrecisionModel + + + + + Always runs over all geometry components. + + + + + Always reports that the geometry has changed + + + + + Provides versions of Geometry spatial functions which use + enhanced precision techniques to reduce the likelihood of robustness problems. + + + + + Only static methods! + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic difference of the input Geometries. + + + + Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer of a Geometry, using enhanced precision. + This method should no longer be necessary, since the buffer algorithm + now is highly robust. + + The first Geometry. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + Reduces the precision of a + according to the supplied , + ensuring that the result is topologically valid. + + + + + Convenience method for doing precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + and preserving polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Convenience method for doing pointwise precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + but NOT preserving valid polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Duplicates a geometry to one that uses a different PrecisionModel, + without changing any coordinate values. + + The geometry to duplicate + The precision model to use + The geometry value with a new precision model + + + Gets or sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + The default is to remove collapsed components. + + + + + /// Gets or sets whether the of the new reduced Geometry + will be changed to be the supplied to + specify the precision reduction. + + The default is to not change the precision model + + + + + Gets or sets whether the precision reduction will be done + in pointwise fashion only. + Pointwise precision reduction reduces the precision + of the individual coordinates only, but does + not attempt to recreate valid topology. + This is only relevant for geometries containing polygonal components. + + + + + Computes the Minimum Clearance of a . + + The Minimum Clearance is a measure of + what magnitude of perturbation of + the vertices of a geometry can be tolerated + before the geometry becomes topologically invalid. + The smaller the Minimum Clearance distance, + the less vertex pertubation the geometry can tolerate + before becoming invalid. + + + The concept was introduced by Thompson and Van Oosterom + [TV06], based on earlier work by Milenkovic [Mi88]. + + The Minimum Clearance of a geometry G + is defined to be the value r + such that "the movement of all points by a distance + of r in any direction will + guarantee to leave the geometry valid" [TV06]. + An equivalent constructive definition [Mi88] is that + r is the largest value such: + + No two distinct vertices of G are closer than r. + No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint + + The following image shows an example of the Minimum Clearance + of a simple polygon. + +
+ + If G has only a single vertex (i.e. is a + ), the value of the minimum clearance + is . + + If G is a or geometry, + then in fact no amount of perturbation + will render the geometry invalid. + In this case a Minimum Clearance is still computed + based on the vertex and segment distances + according to the constructive definition. + + It is possible for no Minimum Clearance to exist. + For instance, a with all members identical + has no Minimum Clearance + (i.e. no amount of perturbation will cause + the member points to become non-identical). + Empty geometries also have no such distance. + The lack of a meaningful MinimumClearance distance is detected + and suitable values are returned by + and . + + The computation of Minimum Clearance utilizes + the + method to provide good performance even for + large inputs. + + An interesting note is that for the case of s, + the computed Minimum Clearance line + effectively determines the Nearest Neighbours in the collection. +

References

+ + [Mi88] Milenkovic, V. J., + Verifiable implementations of geometric algorithms + using finite precision arithmetic. + in Artificial Intelligence, 377-401. 1988 + [TV06] Thompson, Rod and van Oosterom, Peter, + Interchange of Spatial Data-Inhibiting Factors, + Agile 2006, Visegrad, Hungary. 2006 + +
+ /// Martin Davis +
+ + + Computes the Minimum Clearance distance for + the given Geometry. + + The input geometry + The minimum clearance + + + + Gets a LineString containing two points + which are at the Minimum Clearance distance + for the given Geometry. + + The input geometry + The value of the minimum clearance distance
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + Creates an object to compute the Minimum Clearance for the given Geometry + + The input geometry + + + + Gets the Minimum Clearance distance. + If no distance exists + (e.g. in the case of two identical points) + is returned. + + + The value of the minimum clearance distance
+ or if no Minimum Clearance distance exists +
+
+ + + Gets a LineString containing two points + which are at the Minimum Clearance distance. + If no distance could be found + (e.g. in the case of two identical points) + LINESTRING EMPTY is returned. + + The value of the minimum clearance distance,
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + + Reduces the precision of the coordinates of a Geometry + according to the supplied {PrecisionModel}, without + attempting to preserve valid topology. + + + In case of geometries, + the topology of the resulting geometry may be invalid if + topological collapse occurs due to coordinates being shifted. + It is up to the client to check this and handle it if necessary. + Collapses may not matter for some uses. An example + is simplifying the input to the buffer algorithm. + The buffer algorithm does not depend on the validity of the input point. + + + + + Convenience method for doing precision reduction on a single geometry, + with collapses removed and keeping the geometry precision model the same. + + The reduced geometry + + + + + + + + + + + + + + + + + Sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + + + + + Gets/Sets whether the PrecisionModel of the new reduced Geometry + will be changed to be the PrecisionModel supplied to + specify the precision reduction. + The default is to not change the precision model. + + + + + + + + + + + + + + + + + + + + + + + + Computes the minimum clearance of a geometry or + set of geometries. + The Minimum Clearance is a measure of + what magnitude of perturbation of its vertices can be tolerated + by a geometry before it becomes topologically invalid. + + This class uses an inefficient O(N^2) scan. + It is primarily for testing purposes. + + + Martin Davis + + + + Gets or sets the total number of points in the created . + The created geometry will have no more than this number of points, + unless more are needed to create a valid geometry. + + + + + The height of an equilateral triangle of side one + + + + + Creates random point sets contained in a + region defined by either a rectangular or a polygonal extent. + + mbdavis + + + + Create a shape factory which will create shapes using the default + . + + + + + Create a shape factory which will create shapes using the given + + + The factory to use + + + + Sets a polygonal mask. + + if the mask is not polygonal + + + + Creates random point sets where the points + are constrained to lie in the cells of a grid. + + mbdavis + + + + Create a builder which will create shapes using the default + . + + + + + Create a builder which will create shapes using the given + . + + The factory to use + + + + Gets the containing the generated point + + A MultiPoint + + + + Gets or sets whether generated points are constrained to lie + within a circle contained within each grid cell. + This provides greater separation between points + in adjacent cells. + + The default is to not be constrained to a circle. + + + + + Gets or sets the fraction of the grid cell side which will be treated as + a gutter, in which no points will be created. + + The provided value is clamped to the range [0.0, 1.0]. + + + + + Simplifies a line (sequence of points) using + the standard Douglas-Peucker algorithm. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a using the Douglas-Peucker algorithm. + + + Ensures that any polygonal geometries returned are valid. + Simple lines are not guaranteed to remain simple after simplification. + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + Note that in general D-P does not preserve topology - + e.g. polygons can be split, collapse to lines or disappear + holes can be created or disappear, + and lines can cross. + To simplify point while preserving topology use TopologySafeSimplifier. + (However, using D-P is significantly faster). + + KNOWN BUGS: + In some cases the approach used to clean invalid simplified polygons + can distort the output geometry severely. + + + + + + Simplifies a geometry using a given tolerance. + + The geometry to simplify. + The tolerance to use. + A simplified version of the geometry. + + + + Creates a simplifier for a given geometry. + + The geometry to simplify. + + + + Gets the simplified geometry. + + The simplified geometry. + + + + The distance tolerance for the simplification. + + + All vertices in the simplified geometry will be within this + distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" + to have valid topology. + + + The caller may choose to disable this because: + + valid topology is not required + fixing topology is a relative expensive operation + in some pathological cases the topology fixing operation may either fail or run for too long + + The default is to fix polygon topology. + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a polygon, fixing it if required. + + + + + + + + Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. + + null if the simplification results in a degenerate ring + + + + + + + + + + + + Creates a valid area point from one that possibly has + bad topology (i.e. self-intersections). + Since buffer can handle invalid topology, but always returns + valid point, constructing a 0-width buffer "corrects" the + topology. + Note this only works for area geometries, since buffer always returns + areas. This also may return empty geometries, if the input + has no actual area. + + An area point possibly containing self-intersections. + A valid area point. + + + + An index of LineSegments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemVisitor subclass to reduce volume of query results. + + + + + + + + + + + + + + + + + + + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + A LineSegment which is tagged with its location in a Geometry. + Used to index the segments in a point and recover the segment locations + from the index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a collection of TaggedLineStrings, preserving topology + (in the sense that no new intersections are introduced). + This class is essentially just a container for the common + indexes used by . + + + + + Simplifies a collection of TaggedLineStrings. + + The collection of lines to simplify. + + + + Gets or sets the distance tolerance for the simplification.
+ Points closer than this tolerance to a simplified segment may + be removed. +
+
+ + + Represents a which can be modified to a simplified shape. + This class provides an attribute which specifies the minimum allowable length + for the modified result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a TaggedLineString, preserving topology + (in the sense that no new intersections are introduced). + Uses the recursive Douglas-Peucker algorithm. + + + + + Simplifies the given + using the distance tolerance specified. + + The linestring to simplify. + + + + Flattens a section of the line between + indexes and , + replacing them with a line between the endpoints. + The input and output indexes are updated + to reflect this. + + The start index of the flattened section. + The end index of the flattened section. + The new segment created. + + + + Tests whether a segment is in a section of a . + + + + + + + + + Remove the segs in the section of the line. + + + + + + + + Sets the distance tolerance for the simplification. + All vertices in the simplified geometry will be within this + distance of the original geometry. + + + + + Simplifies a point and ensures that + the result is a valid point having the + same dimension and number of components as the input, + and with the components having the same topological + relationship. + + If the input is a polygonal geometry + ( or ): + + The result has the same number of shells and holes as the input, + with the same topological structure + The result rings touch at no more than the number of touching points in the input + (although they may touch at fewer points). + The key implication of this statement is that if the + input is topologically valid, so is the simplified output. + + For linear geometries, if the input does not contain + any intersecting line segments, this property + will be preserved in the output. + + For all geometry types, the result will contain + enough vertices to ensure validity. For polygons + and closed linear geometries, the result will have at + least 4 vertices; for open linestrings the result + will have at least 2 vertices. + + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + The simplification uses a maximum-distance difference algorithm + similar to the Douglas-Peucker algorithm. + + +

KNOWN BUGS

+ + May create invalid topology if there are components which are small + relative to the tolerance value. + In particular, if a small hole is very near an edge, + it is possible for the edge to be moved by a relatively large tolerance value + and end up with the hole outside the result shell (or inside another hole). + Similarly, it is possible for a small polygon component to end up inside + a nearby larger polygon. + A workaround is to test for this situation in post-processing and remove + any invalid holes or polygons. + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A filter to add linear geometries to the linestring map + with the appropriate minimum size constraint. + Closed s (including s + have a minimum output size constraint of 4, + to ensure the output is valid. + For all other linestrings, the minimum size is 2 points. + + Martin Davis + + + + Filters linear geometries. + + A geometry of any type + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a using the Visvalingam-Whyatt area-based algorithm. + Ensures that any polygonal geometries returned are valid. Simple lines are not + guaranteed to remain simple after simplification. All geometry types are + handled. Empty and point geometries are returned unchanged. Empty geometry + components are deleted. + The simplification tolerance is specified as a distance. + This is converted to an area tolerance by squaring it. + + Known Bugs + * Not yet optimized for performance. + * Does not simplify the endpoint of rings. + To Do + * Allow specifying desired number of vertices in the output. + + + + Note that in general this algorithm does not preserve topology - e.g. polygons can be split, + collapse to lines or disappear holes can be created or disappear, and lines + can cross. + + 1.7 + + + + Simplifies a using a given tolerance. + + The to simplify. + The tolerance to use. + A simplified version of the . + + + + Creates a simplifier for a given . + + The to simplify. + + + + Gets the semplified . + + The semplified . + + + + Sets the distance tolerance for the simplification. All vertices in the + simplified will be within this distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" to have valid + topology. The caller may choose to disable this because: + * valid topology is not required. + * fixing topology is a relative expensive operation. + * in some pathological cases the topology fixing operation may either + fail or run for too long. + + The default is to fix polygon topology. + + + + Simplifies a , fixing it if required. + + + + + + + + Simplifies a . If the simplification results in a degenerate + ring, remove the component. + + + + null if the simplification results in a degenerate ring. + + + + Simplifies a , fixing it if required. + + + + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections. + A valid area geometry. + + + + A utility class which creates Conforming Delaunay Trianglulations + from collections of points and linear constraints, and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Sets the sites (point or vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + The site vertices do not have to contain the constraint + vertices as well; any site vertices which are + identical to a constraint vertex will be removed + from the site vertex set. + + The geometry from which the sites will be extracted. + + + + Gets the QuadEdgeSubdivision which models the computed triangulation. + + The subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + The geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the linear constraints to be conformed to. + All linear components in the input will be used as constraints. + The constraint vertices do not have to be disjoint from + the site vertices. + The constraints must not contain duplicate segments (up to orientation). + + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + + Creates a Conforming Delaunay Triangulation based on the given + unconstrained initial vertices. The initial vertex set should not contain + any vertices which appear in the constraint set. + + a collection of + the distance tolerance below which points are considered identical + + + + Sets the constraints to be conformed to by the computed triangulation. + The constraints must not contain duplicate segments (up to orientation). + The unique set of vertices (as es) + forming the constraints must also be supplied. + Supplying it explicitly allows the ConstraintVertexes to be initialized + appropriately(e.g. with external data), and avoids re-computing the unique set + if it is already available. + + list of the constraint {@link Segment}s + the set of unique es referenced by the segments + + + + Creates a vertex on a constraint segment + + the location of the vertex to create + the constraint segment it lies on + the new constraint vertex + + + + Inserts all sites in a collection + + a collection of ConstraintVertex + + + + Inserts a site into the triangulation, maintaining the conformal Delaunay property. + This can be used to further refine the triangulation if required + (e.g. to approximate the medial axis of the constraints, + or to improve the grading of the triangulation). + + the location of the site to insert + + + + Computes the Delaunay triangulation of the initial sites. + + + + + Enforces the supplied constraints into the triangulation. + + + if the constraints cannot be enforced + + + + Given a set of points stored in the kd-tree and a line segment defined by + two points in this set, finds a in the circumcircle of + the line segment, if one exists. This is called the Gabriel point - if none + exists then the segment is said to have the Gabriel condition. Uses the + heuristic of finding the non-Gabriel point closest to the midpoint of the + segment. + + the line segment + + A point which is non-Gabriel, + or null if no point is non-Gabriel + + + + + Gets or sets the to be + used during constraint enforcement. + Different splitting strategies may be appropriate + for special situations. + + the ConstraintSplitPointFinder to be used + + + + Gets the tolerance value used to construct the triangulation. + + a tolerance value + + + + Gets and sets the used to create new constraint vertices at split points. + + Allows the setting of a custom {@link ConstraintVertexFactory} to be used + to allow vertices carrying extra information to be created. + + + + + Gets the which represents the triangulation. + + + + + Gets the which contains the vertices of the triangulation. + + + + + Gets the sites (vertices) used to initialize the triangulation. + + + + + Gets the s which represent the constraints. + + + + + Gets the convex hull of all the sites in the triangulation, + including constraint vertices. + Only valid after the constraints have been enforced. + + the convex hull of the sites + + + + Indicates a failure during constraint enforcement. + + Martin Davis + 1.0 + + + + Creates a new instance with a given message. + + a string + + + + Creates a new instance with a given message and approximate location. + + a string + the location of the error + + + + Gets the approximate location of this error. + + a location + + + + An interface for strategies for determining the location of split points on constraint segments. + The location of split points has a large effect on the performance and robustness of enforcing a + constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, + especially at narrow constraint angles, since the split point will end up encroaching on the + segment containing the original encroaching point. With detailed knowledge of the geometry of the + constraints, it is sometimes possible to choose better locations for splitting. + + mbdavis + + + + Finds a point at which to split an encroached segment to allow the original segment to appear + as edges in a constrained Delaunay triangulation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + A vertex in a Constrained Delaunay Triangulation. + The vertex may or may not lie on a constraint. + If it does it may carry extra information about the original constraint. + + Martin Davis + + + + Models a site (node) in a . + The sites can be points on a line string representing a + linear site. + The vertex can be considered as a vector with a norm, length, inner product, cross + product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle + defined by this point and two others, etc.) are also defined in this class. + + It is common to want to attach user-defined data to + the vertices of a subdivision. + One way to do this is to subclass Vertex + to carry any desired information. + + David Skea + Martin Davis + + + + Creates an instance of this class using the given x- and y-ordinate valuse + + x-ordinate value + y-ordinate value + + + + Creates an instance of this class using the given x-, y- and z-ordinate values + + x-ordinate value + y-ordinate value + z-ordinate value + + + + Creates an instance of this class using a clone of the given . + + The coordinate + + + + Computes the cross product k = u X v. + + a vertex + returns the magnitude of u X v + + + + Computes the inner or dot product + + A vertex + The dot product u.v + + + + Computes the scalar product c(v) + + A vertex + The scaled vector + + + + Tests if this is inside the circle defined by the points a, b, c. This test uses simple + double-precision arithmetic, and thus may not be robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + true if this vertex is inside the circumcircle (a, b, c) + + + + Tests whether the triangle formed by this vertex and two + other vertices is in CCW orientation. + + a vertex + a vertex + true if the triangle is oriented CCW + + + + Computes the value of the ratio of the circumradius to shortest edge. If smaller than some + given tolerance B, the associated triangle is considered skinny. For an equal lateral + triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: + circumRadius/shortestEdge = 1/(2sin(theta)). + + second vertex of the triangle + third vertex of the triangle + ratio of circumradius to shortest edge. + + + + returns a new vertex that is mid-way between this vertex and another end point. + + the other end point. + the point mid-way between this and that. + + + + Computes the centre of the circumcircle of this vertex and two others. + + + + the Coordinate which is the circumcircle of the 3 points. + + + + For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate + a z value from the surrounding vertices. + + + + + Interpolates the Z-value (height) of a point enclosed in a triangle + whose vertices all have Z values. + The containing triangle must not be degenerate + (in other words, the three vertices must enclose a + non-zero area). + + The point to interpolate the Z value of + A vertex of a triangle containing the + A vertex of a triangle containing the + A vertex of a triangle containing the + The interpolated Z-value (height) of the point + + + + Computes the interpolated Z-value for a point p lying on the segment p0-p1 + + The point to interpolate the Z value of + A vertex of the segment is lying on + A vertex of the segment is lying on + The interpolated Z-value (height) of the point + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + Gets the z-ordinate value + + + + + Gets the coordinate + + + + + Creates a new constraint vertex + + the location of the vertex + + + + Merges the constraint data in the vertex other into this vertex. + This method is called when an inserted vertex is + very close to an existing vertex in the triangulation. + + the constraint vertex to merge + + + + Gets or sets whether this vertex lies on a constraint. + + true if the vertex lies on a constraint + + + + Gets or sets the external constraint object + + object which carries information about the constraint this vertex lies on + + + + An interface for factories which create a {@link ConstraintVertex} + + Martin Davis + + + + A utility class which creates Delaunay Trianglulations + from collections of points and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Extracts the unique s from the given . + + the geometry to extract from + a List of the unique Coordinates + + + + Converts all s in a collection to es. + + the coordinates to convert + a List of Vertex objects + + + + Computes the of a collection of s. + + a List of Coordinates + the envelope of the set of coordinates + + + + Sets the sites (vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + + the geometry from which the sites will be extracted. + + + + Sets the sites (vertices) which will be triangulated + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed triangulation. + + the subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + the geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + Computes a Delauanay Triangulation of a set of es, using an + incrementatal insertion algorithm. + + Martin Davis + 1.0 + + + + Creates a new triangulator using the given . + The triangulator uses the tolerance of the supplied subdivision. + + a subdivision in which to build the TIN + + + + Inserts all sites in a collection. The inserted vertices MUST be + unique up to the provided tolerance value. (i.e. no two vertices should be + closer than the provided tolerance value). They do not have to be rounded + to the tolerance grid, however. + + a Collection of Vertex + if the location algorithm fails to converge in a reasonable number of iterations + + + + Inserts a new point into a subdivision representing a Delaunay + triangulation, and fixes the affected edges so that the result is still a + Delaunay triangulation. + + a quadedge containing the inserted vertex + + + + A simple split point finder which returns the midpoint of the split segment. This is a default + strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. + Other points which could be used are: +
    +
  • The projection of the encroaching point on the segment
  • +
  • A point on the segment which will produce two segments which will not be further encroached
  • +
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • + point +
+
+ Martin Davis +
+ + + Gets the midpoint of the split segment + + + + + A strategy for finding constraint split points which attempts to maximise the length of the split + segments while preventing further encroachment. (This is not always possible for narrow angles). + + Martin Davis + + + + A basic strategy for finding split points when nothing extra is known about the geometry of + the situation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a split point which is the projection of the encroaching point on the segment + + The segment + The enchroaching point + A split point on the segment + + + + A framework to visit sets of edge-connected s in breadth-first order + + Martin Davis + 1.0 + + + + Called to initialize the traversal queue with a given set of s + + a collection of QuadEdgeTriangle + + + + Subclasses call this method to perform the visiting process. + + + + + An interface for classes which locate an edge in a + which either contains a given V + or is an edge of a triangle which contains V. + Implementors may utilized different strategies for + optimizing locating containing edges/triangles. + + Martin Davis + + + + Interface for classes which process triangles visited during travesals of a + + + Martin Davis + + + + Visits a triangle during a traversal of a . An implementation of + this method may perform processing on the current triangle. It must also decide whether a + neighbouring triangle should be added to the queue so its neighbours are visited. Often it + will perform processing on the neighbour triangle as well, in order to mark it as processed + (visited) and/or to determine if it should be visited. Note that choosing not to + visit the neighbouring triangle is the terminating condition for many traversal algorithms. + In particular, if the neighbour triangle has already been visited, it should not be visited + again. + + the current triangle being processed + the index of the edge in the current triangle being traversed + a neighbouring triangle next in line to visit + true if the neighbour triangle should be visited + + + + An interface for algorithms which process the triangles in a . + + Martin Davis + 1.0 + + + + + Locates s in a , + optimizing the search by starting in the + locality of the last edge found. + + Martin Davis + + + + Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. + The search starts from the last located edge amd proceeds on the general direction of v. + + + + + A class that represents the edge data structure which implements the quadedge algebra. + The quadedge algebra was described in a well-known paper by Guibas and Stolfi, + "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", + ACM Transactions on Graphics, 4(2), 1985, 75-123. + + Each edge object is part of a quartet of 4 edges, + linked via their Rot references. + Any edge in the group may be accessed using a series of operations. + Quadedges in a subdivision are linked together via their Next references. + The linkage between the quadedge quartets determines the topology + of the subdivision. + + + The edge class does not contain separate information for vertice or faces; a vertex is implicitly + defined as a ring of edges (created using the Next field). + + + David Skea + Martin Davis + + + + Creates a new QuadEdge quartet from o to d. + + the origin Vertex + the destination Vertex + the new QuadEdge quartet + + + + Creates a new QuadEdge connecting the destination of a to the origin of + b, in such a way that all three have the same left face after the + connection is complete. Additionally, the data pointers of the new edge + are set. + + the connected edge + + + + Splices two edges together or apart. + Splice affects the two edge rings around the origins of a and b, and, independently, the two + edge rings around the left faces of a and b. + In each case, (i) if the two rings are distinct, + Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it + into two separate pieces. Thus, Splice can be used both to attach the two edges together, and + to break them apart. + + an edge to splice + an edge to splice + + + + Turns an edge counterclockwise inside its enclosing quadrilateral. + + the quadedge to turn + + + + Quadedges must be made using {@link makeEdge}, + to ensure proper construction. + + + + + Gets the primary edge of this quadedge and its sym. + The primary edge is the one for which the origin + and destination coordinates are ordered + according to the standard ordering + + the primary quadedge + + + + Marks this quadedge as being deleted. + This does not free the memory used by + this quadedge quartet, but indicates + that this edge no longer participates + in a subdivision. + + + + + Sets the connected edge + + edge + + + + Tests if this quadedge and another have the same line segment geometry, + regardless of orientation. + + a quadege + true if the quadedges are based on the same line segment regardless of orientation + + + + Tests if this quadedge and another have the same line segment geometry + with the same orientation. + + a quadege + true if the quadedges are based on the same line segment + + + + Creates a representing the + geometry of this edge. + + a LineSegment + + + + Converts this edge to a WKT two-point LINESTRING indicating + the geometry of this edge. + + a String representing this edge's geometry + + + + Gets or sets the external data value for this edge. + + + an object containing external data + + + + + Tests whether this edge has been deleted. + + true if this edge has not been deleted. + + + + Gets the dual of this edge, directed from its right to its left. + + Gets or Sets the rotated edge + + + + Gets the dual of this edge, directed from its left to its right. + + Gets the inverse rotated edge. + + + + Gets the edge from the destination to the origin of this edge. + + Gets the sym of the edge. + + + + Gets the next CCW edge around the origin of this edge. + + Gets the next linked edge. + + + + Gets the next CW edge around (from) the origin of this edge. + + Gets the previous edge. + + + + Gets the next CCW edge around (into) the destination of this edge. + + Get the next destination edge. + + + + Gets the next CW edge around (into) the destination of this edge. + + Get the previous destination edge. + + + + Gets the CCW edge around the left face following this edge. + + Gets the next left face edge. + + + + Gets the CCW edge around the left face before this edge. + + Get the previous left face edge. + + + + Gets the edge around the right face ccw following this edge. + + Gets the next right face edge. + + + + Gets the edge around the right face ccw before this edge. + + Gets the previous right face edge. + + + + Gets or sets the vertex for the edge's origin + + Gets the origin vertex + + + + Gets or sets the vertex for the edge's destination + + Gets the destination vertex + + + + Gets the length of the geometry of this quadedge. + + Gets the length of the quadedge + + + + A class that contains the s representing a planar + subdivision that models a triangulation. + The subdivision is constructed using the + quadedge algebra defined in the classs . + All metric calculations + are done in the class. + In addition to a triangulation, subdivisions + support extraction of Voronoi diagrams. + This is easily accomplished, since the Voronoi diagram is the dual + of the Delaunay triangulation. + + Subdivisions can be provided with a tolerance value. Inserted vertices which + are closer than this value to vertices already in the subdivision will be + ignored. Using a suitable tolerance value can prevent robustness failures + from happening during Delaunay triangulation. + + + Subdivisions maintain a frame triangle around the client-created + edges. The frame is used to provide a bounded "container" for all edges + within a TIN. Normally the frame edges, frame connecting edges, and frame + triangles are not included in client processing. + + + David Skea + Martin Davis + + + + Gets the edges for the triangle to the left of the given . + + + + if the edges do not form a triangle + + + + Creates a new instance of a quad-edge subdivision based on a frame triangle + that encloses a supplied bounding box. A new super-bounding box that + contains the triangle is computed and stored. + + the bouding box to surround + the tolerance value for determining if two sites are equal + + + + Gets the collection of base s (one for every pair of + vertices which is connected). + + a collection of QuadEdges + + + + Sets the to use for locating containing triangles + in this subdivision. + + a QuadEdgeLocator + + + + Creates a new quadedge, recording it in the edges list. + + The origin vertex + The destination vertex + A new quadedge + + + + Creates a new QuadEdge connecting the destination of a to the origin of b, + in such a way that all three have the same left face after the connection + is complete. The quadedge is recorded in the edges list. + + A quadedge + A quadedge + A quadedge + + + + Deletes a quadedge from the subdivision. Linked quadedges are updated to + reflect the deletion. + + the quadedge to delete + + + + Locates an edge of a triangle which contains a location + specified by a Vertex v. + The edge returned has the + property that either v is on e, or e is an edge of a triangle containing v. + The search starts from startEdge amd proceeds on the general direction of v. + + + This locate algorithm relies on the subdivision being Delaunay. For + non-Delaunay subdivisions, this may loop for ever. + + the location to search for + an edge of the subdivision to start searching at + a QuadEdge which contains v, or is on the edge of a triangle containing v + + if the location algorithm fails to converge in a reasonable + number of iterations + + + + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the vertex to locate + a quadedge on the edge of a triangle which touches or contains the location
+ or null if no such triangle exists +
+
+ + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the Coordinate to locate + a quadedge on the edge of a triangle which touches or contains the location, + or null if no such triangle exists + + + + + Locates the edge between the given vertices, if it exists in the + subdivision. + + a coordinate + another coordinate + the edge joining the coordinates, if present, + or null if no such edge exists + + + + + Inserts a new site into the Subdivision, connecting it to the vertices of + the containing triangle (or quadrilateral, if the split point falls on an + existing edge). + + + + This method does NOT maintain the Delaunay condition. If desired, this must + be checked and enforced by the caller. + + + This method does NOT check if the inserted vertex falls on an edge. This + must be checked by the caller, since this situation may cause erroneous + triangulation + + + the vertex to insert + a new quad edge terminating in v + + + + Tests whether a QuadEdge is an edge incident on a frame triangle vertex. + + the edge to test + true if the edge is connected to the frame triangle + + + + Tests whether a QuadEdge is an edge on the border of the frame facets and + the internal facets. E.g. an edge which does not itself touch a frame + vertex, but which touches an edge which does. + + the edge to test + true if the edge is on the border of the frame + + + + Tests whether a vertex is a vertex of the outer triangle. + + the vertex to test + true if the vertex is an outer triangle vertex + + + + Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a + tolerance determined by the subdivision tolerance. + + a QuadEdge + a point + true if the vertex lies on the edge + + + + Tests whether a is the start or end vertex of a + , up to the subdivision tolerance distance. + + + + true if the vertex is a endpoint of the edge + + + + Gets the unique es in the subdivision, + including the frame vertices if desired. + + true if the frame vertices should be included + a collection of the subdivision vertices + + + + + Gets a collection of s whose origin + vertices are a unique set which includes + all vertices in the subdivision. + The frame vertices can be included if required. + + + This is useful for algorithms which require traversing the + subdivision starting at all vertices. + Returning a quadedge for each vertex + is more efficient than + the alternative of finding the actual vertices + using and then locating + quadedges attached to them. + + true if the frame vertices should be included + a collection of QuadEdge with the vertices of the subdivision as their origins + + + + Gets all primary quadedges in the subdivision. + A primary edge is a + which occupies the 0'th position in its array of associated quadedges. + These provide the unique geometric edges of the triangulation. + + true if the frame edges are to be included + a List of QuadEdges + + + + The quadedges forming a single triangle. + Only one visitor is allowed to be active at a + time, so this is safe. + + + + + Stores the edges for a visited triangle. Also pushes sym (neighbour) edges + on stack to visit later. + + + + + + the visited triangle edges,
+ or null if the triangle should not be visited (for instance, if it is outer) +
+
+ + + Gets a list of the triangles + in the subdivision, specified as + an array of the primary quadedges around the triangle. + + true if the frame triangles should be included + a List of QuadEdge[3] arrays + + + + Gets a list of the triangles in the subdivision, + specified as an array of the triangle es. + + true if the frame triangles should be included + a List of Vertex[3] arrays + + + + Gets the coordinates for each triangle in the subdivision as an array. + + true if the frame triangles should be included + a list of Coordinate[4] representing each triangle + + + + Gets the geometry for the edges in the subdivision as a + containing 2-point lines. + + the GeometryFactory to use + a IMultiLineString + + + + Gets the geometry for the triangles in a triangulated subdivision as a + of triangular s. + + the GeometryFactory to use + a GeometryCollection of triangular Polygons + + + + Gets the cells in the Voronoi diagram for this triangulation. + The cells are returned as a of s + + + The userData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a GeometryCollection of Polygons + + + + Gets a List of s for the Voronoi cells + of this triangulation. + + + The UserData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a List of Polygons + + + + Gets the Voronoi cell around a site specified + by the origin of a QuadEdge. + + + The userData of the polygon is set to be the + of the site. This allows attaching external + data associated with the site to this cell polygon. + + a quadedge originating at the cell site + a factory for building the polygon + a polygon indicating the cell extent + + + + Gets the vertex-equality tolerance value + used in this subdivision + + Gets the tolerance value + + + + Gets the envelope of the Subdivision (including the frame). + + Gets the envelope + + + + A TriangleVisitor which computes and sets the + circumcentre as the origin of the dual + edges originating in each triangle. + + mbdavis + + + + Models a triangle formed from s in a + which forms a triangulation. The class provides methods to access the + topological and geometric properties of the triangle and its neighbours in + the triangulation. Triangle vertices are ordered in CCW orientation in the + structure. + + + QuadEdgeTriangles support having an external data attribute attached to them. + Alternatively, this class can be subclassed and attributes can + be defined in the subclass. Subclasses will need to define + their own BuilderVisitor class + and CreateOn method. + + Martin Davis + 1.0 + + + + Creates s for all facets of a + representing a triangulation. + The data attributes of the s in the subdivision + will be set to point to the triangle which contains that edge. + This allows tracing the neighbour triangles of any given triangle. + + The QuadEdgeSubdivision to create the triangles on. + A List of the created QuadEdgeTriangles + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 Vertexes + the point to test + true if the point is contained in the triangle + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 QuadEdges + the point to test + true if the point is contained in the triangle + + + + Creates a new triangle from the given edges. + + An array of the edges of the triangle in CCW order + + + + Gets the vertices for this triangle. + + a new array containing the triangle vertices + + + + Gets the index for the given edge of this triangle + + a QuadEdge + the index of the edge in this triangle,
+ or -1 if the edge is not an edge of this triangle +
+
+ + + Gets the index for the edge that starts at vertex v. + + the vertex to find the edge for + the index of the edge starting at the vertex,
+ or -1 if the vertex is not in the triangle +
+
+ + + Tests whether this triangle is adjacent to the outside of the subdivision. + + true if the triangle is adjacent to the subdivision exterior + + + + Gets the triangles which are adjacent (include) to a + given vertex of this triangle. + + The vertex to query + A list of the vertex-adjacent triangles + + + + Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is + null + + an array containing the 3 neighbours of this triangle + + + + Gets or sets the external data value for this triangle. + + + + + Gets all edges which are incident on the origin of the given edge. + + the edge to start at + a List of edges which have their origin at the origin of the given + edge + + + + Algorithms for computing values and predicates + associated with triangles. + + + For some algorithms extended-precision + implementations are provided, which are more robust + (i.e. they produce correct answers in more cases). + Also, some more robust formulations of + some algorithms are provided, which utilize + normalization to the origin. + + Martin Davis + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + However, by using normalization to the origin + it provides improved robustness and increased performance. + Based on code by J.R.Shewchuk. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the + triangle is oriented counterclockwise. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This method uses more robust computation. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness, but a faster approach. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + a vertex of the triangle + a vertex of the triangle + a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + + + + + + + + + + + Computes the inCircle test using distance from the circumcentre. + Uses standard double-precision arithmetic. + + + In general this doesn't + appear to be any more robust than the standard calculation. However, there + is at least one case where the test point is far enough from the + circumcircle that this test gives the correct answer. +
+            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
+            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
+            
+
+ A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + The area of a triangle defined by the points a, b and c +
+ + + Checks if the computed value for isInCircle is correct, using + double-double precision arithmetic. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + + + + + Creates a new instance for the given ordinates. + + + + + Creates a new instance for the given ordinates, with associated external data. + + + + + Creates a new instance for the given points, with associated external data. + + the start point + the end point + an external data object + + + + Creates a new instance for the given points. + + the start point + the end point + + + + Determines whether two segments are topologically equal. + I.e. equal up to orientation. + + a segment + true if the segments are topologically equal + + + + Computes the intersection point between this segment and another one. + + a segment + the intersection point, or null if there is none + + + + Computes a string representation of this segment. + + a string + + + + Gets the start coordinate of the segment + + a Coordinate + + + + Gets the end coordinate of the segment + + a Coordinate + + + + Gets the start X ordinate of the segment + + the X ordinate value + + + + Gets the start Y ordinate of the segment + + the Y ordinate value + + + + Gets the start Z ordinate of the segment + + the Z ordinate value + + + + Gets the end X ordinate of the segment + + the X ordinate value + + + + Gets the end Y ordinate of the segment + + he Y ordinate value + + + + Gets the end Z ordinate of the segment + + the Z ordinate value + + + + Gets a LineSegment modelling this segment. + + a LineSegment + + + + Gets or sets the external data associated with this segment + + a data object + + + + Models a constraint segment which can be split in two in various ways, + according to certain geometric constraints. + + Martin Davis + + + + Computes the {@link Coordinate} that lies a given fraction along the line defined by the + reverse of the given segment. A fraction of 0.0 returns the end point of the + segment; a fraction of 1.0 returns the start point of the segment. + + the LineSegment + the fraction of the segment length along the line + the point at that distance + + + + Creates a map between the vertex s of a + set of s, + and the parent geometry, and transfers the source geometry + data objects to geometry components tagged with the coordinates. + + + This class can be used in conjunction with + to transfer data objects from the input site geometries + to the constructed Voronoi polygons. + + Martin Davis + + + + + Input is assumed to be a multiGeometry + in which every component has its userData + set to be a Coordinate which is the key to the output data. + The Coordinate is used to determine + the output data object to be written back into the component. + + + + + + A utility class which creates Voronoi Diagrams + from collections of points. + The diagram is returned as a of s, + representing the faces of the Voronoi diagram. + /// The faces are clipped to the larger of: + + + an envelope supplied by . + + + an envelope determined by the input sites. + + + The userData attribute of each face Polygon is set to + the Coordinate of the corresponding input site. + This allows using a Map to link faces to data associated with sites. + + Martin Davis + + + + Sets the sites (point or vertices) which will be diagrammed. + All vertices of the given geometry will be used as sites. + + geom the geometry from which the sites will be extracted. + + + + Sets the sites (point or vertices) which will be diagrammed + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed diagram. + + the subdivision containing the triangulation + + + + Gets the faces of the computed diagram as a + of s, clipped as specified. + + The attribute of each face is set to + the Coordinate of the corresponding input site. + This allows using a to link faces to data associated with sites. + + the geometry factory to use to create the output + a containg the face s of the diagram + + + + Sets the envelope to clip the diagram to. + The diagram will be clipped to the larger + of this envelope or an envelope surrounding the sites. + + the clip envelope. + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + tolerance the tolerance distance to use + + + + An alternative implementation of the priority queue abstract data type. + This allows us to do more than , which we + got from JTS. Ultimately, this queue enables scenarios that have more + favorable execution speed characteristics at the cost of less favorable + memory and usability characteristics. + + + The type of the priority for each queue node. + + + The type of data stored in the queue. + + + When enumerating over the queue, note that the elements will not be in + sorted order. To get at the elements in sorted order, use the copy + constructor and repeatedly elements from it. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to + copy from. + + + is . + + + + + Removes all nodes from this queue. + + + + + Determines whether the given node is contained within this queue. + + + The node to locate in the queue. + + + if is found in the + queue, otherwise . + + + + + Adds a given node to the queue with the given priority. + + + The node to add to the queue. + + + The priority for the node. + + + is . + + + + + Removes and returns the head of the queue. + + + The removed element. + + + + + Changes the priority of the given node. + + + The node whose priority to change. + + + The new priority for the node. + + + is . + + + + + Removes the given node from this queue if it is present. + + + The node to remove if present. + + + A value indicating whether the node was removed. + + + + + + + + + + + Gets the number of nodes currently stored in this queue. + + + + + Gets the node at the head of the queue. + This is the node whose compares + less than or equal to the priority of all other nodes in the queue. + + + + + A container for a prioritized node that sites in an + . + + + The type to use for the priority of the node in the queue. + + + The type to use for the data stored by the node in the queue. + + + + + Initializes a new instance of the class. + + + The to store in this node. + + + + + Gets the that is stored in this node. + + + + + Gets the of this node in the queue. + + + The queue may update this priority while the node is still in the queue. + + + + + Gets or sets the index of this node in the queue. + + + This should only be read and written by the queue itself. + It has no "real" meaning to anyone else. + + + + + A utility for making programming assertions. + + + + + + + + + + + + + + + + + + + + + A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. + + + + + + + + + + + + + + + + + + + Static utility class for casting objects + + + + + Cast function from arbitrary-type to + + The output type + The sequence of items to cast. + as an enumerable of + Thrown if cast cannot be performed + + + + Cast function from sub-type to super-type + + The output (super/base) type + The input (sub/derived) type + The sequence of items to cast. + as an enumerable of + + + + Cast function from super-type to sub-type + + The input (sub/derived) type + The output (super/base) type + The sequence of items to cast. + as an enumerable of + + + + Executes a transformation function on each element of a collection + and returns the results in a new List. + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Copies s in an array to an object array + + + + the source array + An array of objects + + + + + + + + + + + + + + + + + + + + + A CoordinateFilter that creates an array containing every coordinate in a Geometry. + + + + + Constructs a CoordinateArrayFilter. + + The number of points that the CoordinateArrayFilter will collect. + + + + + + + + + + Returns the Coordinates collected by this CoordinateArrayFilter. + + + + + CoordinateCompare is used in the sorting of arrays of Coordinate objects. + Implements a lexicographic comparison. + + + + + Compares two object and returns a value indicating whether one is less than, equal to or greater + than the other. + + First Coordinate object to compare. + Second Coordinate object to compare. + + <table cellspacing="0" class="dtTABLE"> + <TR VALIGN="top"> + <TH width=50%>Value</TH> + <TH width=50%>Condition</TH> + </TR> + <TR VALIGN="top"> + <TD width=50%>Less than zero</TD> + <TD width=50%><I>a</I> is less than <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Zero</TD> + <TD width=50%><I>a</I> equals <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Greater than zero</TD> + <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> + </TR> + </table> + + If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b + implements IComparable, then b. CompareTo (a) is returned. + Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not + generate an exception when using IComparable. When sorting, a null reference (Nothing) is + considered to be less than any other object. + + + + + A CoordinateFilter that counts the total number of coordinates + in a Geometry. + + + + + + + + + + + Returns the result of the filtering. + + + + + Converts degrees to radians. + + + + + Converts degrees to radians. + + The angle in degrees. + The angle in radians. + + + + + + + + + Only static methods! + + + + + Convert the given numeric value (passed as string) of the base specified by baseIn + to the value specified by baseOut. + + Numeric value to be converted, as string. + Base of input value. + Base to use for conversion. + Converted value, as string. + + + + + + + + + + + + + + + + + + + + + + + + + Utility functions to report memory usage. + + mbdavis + + + + A priority queue over a set of objects. + + Objects to add + Martin Davis + + + Insert into the priority queue. Duplicates are allowed. + + The item to insert. + + + + Test if the priority queue is logically empty. + + true if empty, false otherwise. + + + + Make the priority queue logically empty. + + + + + Remove the smallest item from the priority queue. + + The smallest item, or default(T) if empty. + + + + Returns size. + + + + + Converts radians to degress. + + + + + Converts radians to degress. + + Angle in radians. + The angle in degrees. + + + + + + + + + + + + + + + + + Buffer for characters. This approximates StringBuilder + but is designed to be faster for specific operations. + This is about 30% faster for the operations I'm interested in + (Append, Clear, Length, ToString). + This trades off memory for speed. + + + To make Remove from the head fast, this is implemented + as a ring buffer. + This uses head and tail indices into a fixed-size + array. This will grow the array as necessary. + + + + + Default constructor. + + + + + Construct with a specific capacity. + + + + + + Reallocate the buffer to be larger. For the new size, this + uses the max of the requested length and double the current + capacity. + This does not shift, meaning it does not change the head or + tail indices. + + The new requested length. + + + + Ensure that we're set for the requested length by + potentially growing or shifting contents. + + + + + + Move the buffer contents such that headIndex becomes 0. + + + + + Overwrite this object's underlying buffer with the specified + buffer. + + The character array. + The number of characters to consider filled + in the input buffer. + + + + Append a character to this buffer. + + + + + + Append a string to this buffer. + + The string to append. + + + + Append a string to this buffer. + + The string to append. + + + + Remove a character at the specified index. + + The index of the character to remove. + + + + + Remove a specified number of characters at the specified index. + + The index of the characters to remove. + The number of characters to remove. + + + + Find the first instance of a character in the buffer, and + return its index. This returns -1 if the character is + not found. + + The character to find. + The index of the specified character, or -1 + for not found. + + + + Empty the buffer. + + + + + Return the current contents as a string. + + The new string. + + + + Gets/Sets the number of characters in the character buffer. + Increasing the length this way provides indeterminate results. + + + + + Returns the capacity of this character buffer. + + + + + Indexer. + + + + + Exception class for unterminated tokens. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated quotes. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated block comments. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Bitwise enumeration for character types. + + + + word characters (usually alpha, digits, and domain specific) + + + # or something for line comments + + + whitespace + + + ' or " type + + + usually 0 to 9 + + + usually 0 to 9, a-f and A-F + + + eof char + + + + This contains the settings that control the behavior of the tokenizer. + This is separated from the StreamTokenizer so that common settings + are easy to package and keep together. + + + + + Default constructor. + + + + + Copy constructor. + + + + + Sets this object to be the same as the specified object. + Note that some settings which are entirely embodied by the character + type table. + + + + + Setup default parse behavior. + This resets to same behavior as on construction. + + bool - true for success. + + + + Apply settings which are commonly used for code parsing + C-endCapStyle code, including C++, C#, and Java. + + + + + + Clear the character type settings. This leaves them unset, + as opposed to the default. Use SetDefaults() for default + settings. + + + + + Specify that a particular character is a word character. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + The character. + + + + Specify that a range of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + First character. + Last character. + + + + Specify that a string of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + + + + + Specify that a character is a whitespace character. + Character table type manipulation method. + This type is exclusive with other types. + + The character. + + + + Specify that a range of characters are whitespace characters. + Character table type manipulation method. + This adds the characteristic to the char(s), rather + than overwriting other characteristics. + + First character. + Last character. + + + + Remove other type settings from a range of characters. + Character table type manipulation method. + + + + + + + Remove other type settings from a character. + Character table type manipulation method. + + + + + + Specify that a particular character is a comment-starting character. + Character table type manipulation method. + + + + + + Specify that a particular character is a quote character. + Character table type manipulation method. + + + + + + Return a string representation of a character type setting. + Since the type setting is bitwise encoded, a character + can have more than one type. + + The character type byte. + The string representation of the type flags. + + + + Check whether the specified char type byte has a + particular type flag set. + + The char type byte. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + This is the character type table. Each byte is bitwise encoded + with the character attributes, such as whether that character is + word or whitespace. + + + + + Whether or not to return whitespace tokens. If not, they're ignored. + + + + + Whether or not to return EolTokens on end of line. Eol tokens will not + break up other tokens which can be multi-line. For example block comments + and quotes will not be broken by Eol tokens. Therefore the number of + Eol tokens does not give you the line count of a stream. + + + + + Whether or not to look for // comments + + + + + Whether or not to look for /* */ block comments. + + + + + Whether or not to return comments. + + + + + Whether or not to check for unterminated quotes and block comments. + If true, and one is encoutered, an exception is thrown of the appropriate type. + + + + + Whether or not digits are specified as Digit type in the + character table. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + This setting may become incorrect if you modify the character + types table directly. + + + + + Whether or not to parse Hex (0xABCD...) numbers. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + + + + + A StreamTokenizer similar to Java's. This breaks an input stream + (coming from a TextReader) into Tokens based on various settings. The settings + are stored in the TokenizerSettings property, which is a + StreamTokenizerSettings instance. + + + + This is configurable in that you can modify TokenizerSettings.CharTypes[] array + to specify which characters are which type, along with other settings + such as whether to look for comments or not. + + + WARNING: This is not internationalized. This treats all characters beyond + the 7-bit ASCII range (decimal 127) as Word characters. + + + There are two main ways to use this: 1) Parse the entire stream at + once and get an ArrayList of Tokens (see the Tokenize* methods), + and 2) call NextToken() successively. + This reads from a TextReader, which you can set directly, and this + also provides some convenient methods to parse files and strings. + This returns an Eof token if the end of the input is reached. + + + Here's an example of the NextToken() endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer(); + tokenizer.GrabWhitespace = true; + tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging + tokenizer.TextReader = File.OpenText(fileName); + Token token; + while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); + + + + Here's an example of the Tokenize... endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer("some string"); + ArrayList tokens = new ArrayList(); + if (!tokenizer.Tokenize(tokens)) + { + // error handling + } + foreach (Token t in tokens) Console.WriteLine("t = {0}", t); + + + + Comment delimiters are hardcoded (// and /*), not affected by char type table. + + + This sets line numbers in the tokens it produces. These numbers are normally + the line on which the token starts. + There is one known caveat, and that is that when GrabWhitespace setting + is true, and a whitespace token contains a newline, that token's line number + will be set to the following line rather than the line on which the token + started. + + + + + + This is the number of characters in the character table. + + + + + Default constructor. + + + + + Construct and set this object's TextReader to the one specified. + + The TextReader to read from. + + + + Construct and set a string to tokenize. + + The string to tokenize. + + + + Utility function, things common to constructors. + + + + + Clear the stream settings. + + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + The state. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + Exclude this state from the possible next state. + The state. + + + + Read the next character from the stream, or from backString + if we backed up. + + The next character. + + + + Get the next token. The last token will be an EofToken unless + there's an unterminated quote or unterminated block comment + and Settings.DoUntermCheck is true, in which case this throws + an exception of type StreamTokenizerUntermException or sub-class. + + The output token. + bool - true for success, false for failure. + + + + Starting from current stream location, scan forward + over an int. Determine whether it's an integer or not. If so, + push the integer characters to the specified CharBuffer. + If not, put them in backString (essentially leave the + stream as it was) and return false. + + If it was an int, the stream is left 1 character after the + end of the int, and that character is output in the thisChar parameter. + + The formats for integers are: 1, +1, and -1 + The + and - signs are included in the output buffer. + + The CharBuffer to append to. + Whether or not to consider + to be part + of an integer. + The last character read by this method. + true for parsed an int, false for not an int + + + + Parse the rest of the stream and put all the tokens + in the input ArrayList. This resets the line number to 1. + + The ArrayList to append to. + bool - true for success + + + + Parse all tokens from the specified TextReader, put + them into the input ArrayList. + + The TextReader to read from. + The ArrayList to append to. + bool - true for success, false for failure. + + + + Parse all tokens from the specified file, put + them into the input ArrayList. + + The file to read. + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Tokenize a file completely and return the tokens in a Token[]. + + The file to tokenize. + A Token[] with all tokens. + + + + Parse all tokens from the specified string, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Parse all tokens from the specified Stream, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + This is the TextReader that this object will read from. + Set this to set the input reader for the parse. + + + + + The settings which govern the behavior of the tokenization. + + + + + The states of the state machine. + + + + + Token class used by StreamTokenizer. + This represents a single token in the input stream. + This is subclassed to provide specific token types, + such as CharToken, FloatToken, etc. + + + + + The line number in the input stream where this token originated. + This is base-1. + + + + + A storage object for the data of this token. + + + + + Backer for UntermError. + + + + An error message associated with unterm error. + + + + Construct a Token with the specified line number. + + The line number where this + token comes from. + + + + Equals override. + + The object to compare to. + bool - true for equals, false otherwise. + + + + Equals overload. + + The string to compare to. + bool + + + + Equals overload. + + The char to compare to. + bool + + + + Operator== overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator!= overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator== overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator!= overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator== overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Operator!= overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Override. Returns the ToString().GetHashCode(). + + The hash code. + + + + Produce a string which includes the line number. + + + + + + Produce a string which includes the token type. + + + + + + Create an object of the specified type corresponding to + this token. + + The type of object to create. + The new object, or null for error. + + + + The line number where this token was found. This is base-1. + + + + + The Object stored by this token. This will be + a primitive C# type. + + + + + Whether or not there was an unterminated token problem + when creating this token. See UntermErrorMessage for + a message associated with the problem. + + + + + The error message if there was an unterminated token error + creating this token. + + + + + Return this token's value as a string. + + This token's value as a string. + + + + Represents end-of-lines (line separator characters). + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Represents end of file/stream. + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Abstract base class for string tokens. + + + + Default constructor. + + + Constructor with the specified value + and line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for words, meaning sequences of word + characters. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for Quotes such as "this is a quote". + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for comments, including line and block + comments. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for whitespace such as spaces and tabs. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for characters, meaning non-word characters. + + + + Constructor with the specified value + and line number. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for floating point numbers, stored internally as a Double. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value and line number. + + + + + Constructor with the specified value and line number. + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Token type for integer tokens. This handles both Int32 and Int64. + + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + Constructor with the specified value + and line number. + + + + Constructor for a 64 bit int + + + + + Parse a string known to be a hex string. This is faster + than Parse which doesn't assume the number is Hex. This will + throw an exception if the input number isn't hex. + + The hex number as a string. + The line where this token was found. + A new IntToken set to the value in the input string. + + + + Convert the input string to an integer, if possible + + The string to parse. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + This enumerates verbosity levels. + + + + For error messages. + + + For warn messages. + + + For info messages. + + + For debug messages. + + + + Framework replacement for string.IsNullOrWhitespace + + The string to test + A value indicating if is null, empty or only contains whitespace characters + + + + A CoordinateFilter that builds a set of Coordinates. + The set of coordinates contains no duplicate points. + + + + + Convenience method which allows running the filter over an array of s. + + an array of coordinates + an array of the unique coordinates + + + + + + + + + + Returns the gathered s. + + + + + An algorithm for computing a distance metric + which is an approximation to the Hausdorff Distance + based on a discretization of the input . + + + + The algorithm computes the Hausdorff distance restricted to discrete points + for one of the geometries. + The points can be either the vertices of the geometries (the default), + or the geometries with line segments densified by a given fraction. + Also determines two points of the Geometries which are separated by the computed distance. + + + This algorithm is an approximation to the standard Hausdorff distance. + Specifically, + + for all geometries a, b: DHD(a, b) <= HD(a, b) + + The approximation can be made as close as needed by densifying the input geometries. + In the limit, this value will approach the true Hausdorff distance: + + DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 + + The default approximation is exact or close enough for a large subset of useful cases. + + + Examples of these are: + + + computing distance between Linestrings that are roughly parallel to each other, + and roughly equal in length. This occurs in matching linear networks. + + Testing similarity of geometries. + + + + An example where the default approximation is not close is: + + A = LINESTRING (0 0, 100 0, 10 100, 10 100) + B = LINESTRING (0 100, 0 10, 80 10) + + DHD(A, B) = 22.360679774997898 + HD(A, B) ~= 47.8 + + + + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The Discrete Hausdorff Distance + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The densify fraction. A value of 0 indicates, that no densification should take place + The Discrete Hausdorff Distance + + + Value of 0.0 indicates that no densification should take place + + + + Gets/sets the fraction by which to densify each segment. + + + Each segment will be (virtually) split into a number of equal-length + subsegments, whose fraction of the total length is closest + to the given fraction. + + +
+
Index: packages/NetTopologySuite.1.14/lib/net40-client/PowerCollections.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net40-client/PowerCollections.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net40-client/PowerCollections.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net40-client/PowerCollections.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,11141 @@ + + + + PowerCollections + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Makes a deep clone of this Deque. A new Deque is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the Deque takes time O(N), where N is the number of items in the Deque. + The cloned Deque. + T is a reference type that does not implement ICloneable. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Serialize the hash table. Called from the serialization infrastructure. + + + + + Called on deserialization. We cannot deserialize now, because hash codes + might not be correct now. We do real deserialization in the OnDeserialization call. + + + + + Deserialize the hash table. Called from the serialization infrastructure when + the object graph has finished deserializing. + + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N log N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Makes a deep clone of this BigList. A new BigList is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then this method is the same as Clone. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + +
+
Index: packages/NetTopologySuite.1.14/lib/net403-client/NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net403-client/NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net403-client/NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net403-client/NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,34111 @@ + + + + NetTopologySuite + + + + + An interface for rules which determine whether node points + which are in boundaries of geometry components + are in the boundary of the parent geometry collection. + The SFS specifies a single kind of boundary node rule, + the rule. + However, other kinds of Boundary Node Rules are appropriate + in specific situations (for instance, linear network topology + usually follows the .) + Some JTS operations + (such as , and ) + allow the BoundaryNodeRule to be specified, + and respect the supplied rule when computing the results of the operation. + + An example use case for a non-SFS-standard Boundary Node Rule is + that of checking that a set of s have + valid linear network topology, when turn-arounds are represented + as closed rings. In this situation, the entry road to the + turn-around is only valid when it touches the turn-around ring + at the single (common) endpoint. This is equivalent + to requiring the set of LineStrings to be + simple under the . + The SFS-standard is not + sufficient to perform this test, since it + states that closed rings have no boundary points. + + This interface and its subclasses follow the Strategy design pattern. + + Martin Davis + + + + + + + + Tests whether a point that lies in boundaryCount + geometry component boundaries is considered to form part of the boundary + of the parent geometry. + + boundaryCount the number of component boundaries that this point occurs in + true if points in this number of boundaries lie in the parent boundary + + + + Provides access to static instances of common s. + + + + + The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). + + + + + The Endpoint Boundary Node Rule. + + + + The MultiValent Endpoint Boundary Node Rule. + + + + The Monovalent Endpoint Boundary Node Rule. + + + + + The Boundary Node Rule specified by the OGC Simple Features Specification, + which is the same as the Mod-2 rule. + + + + + + A specifies that points are in the + boundary of a lineal geometry iff + the point lies on the boundary of an odd number + of components. + Under this rule s and closed + s have an empty boundary. + + + This is the rule specified by the OGC SFS, + and is the default rule used in JTS. + + Martin Davis + + + + A which specifies that any points which are endpoints + of lineal components are in the boundary of the + parent geometry. + This corresponds to the "intuitive" topological definition + of boundary. + Under this rule s have a non-empty boundary + (the common endpoint of the underlying LineString). + + + This rule is useful when dealing with linear networks. + For example, it can be used to check + whether linear networks are correctly noded. + The usual network topology constraint is that linear segments may touch only at endpoints. + In the case of a segment touching a closed segment (ring) at one point, + the Mod2 rule cannot distinguish between the permitted case of touching at the + node point and the invalid case of touching at some other interior (non-node) point. + The EndPoint rule does distinguish between these cases, + so is more appropriate for use. + + Martin Davis + + + + A which determines that only + endpoints with valency greater than 1 are on the boundary. + This corresponds to the boundary of a + being all the "attached" endpoints, but not + the "unattached" ones. + + Martin Davis + + + + A which determines that only + endpoints with valency of exactly 1 are on the boundary. + This corresponds to the boundary of a + being all the "unattached" endpoints. + + Martin Davis + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + It is also a reasonable strategy for cases where the + endpoint of one segment lies on or almost on the interior of another one. + Taking the most central endpoint ensures that the computed intersection + point lies in the envelope of the segments. + Also, by always returning one of the input points, this should result + in reducing segment fragmentation. + Intended to be used as a last resort for + computing ill-conditioned intersection situations which + cause other methods to fail. + + + WARNING: in some cases this algorithm makes a poor choice of endpoint. + It has been replaced by a better heuristic in . + + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + + Creates an instance of this class using the provided input coordinates + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + Determines a point closest to the given point. + + + + + Gets the intersection point + + + + + Computes the centroid of a of any dimension. + If the geometry is nominally of higher dimension, + but has lower effective dimension + (i.e. contains only components + having zero length or area), + the centroid will be computed as for the equivalent lower-dimension geometry. + If the input geometry is empty, a + null Coordinate is returned. + +

Algorithm

+ + Dimension 2 - the centroid ic computed + as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + Holes and multipolygons are handled correctly. + See http://www.faqs.org/faqs/graphics/algorithms-faq/ + for further details of the basic approach. + Dimension 1 - Computes the average of the midpoints + of all line segments weighted by the segment length. + Zero-length lines are treated as points. + + Dimension 0 - Compute the average coordinate over all points. + Repeated points are all included in the average + + + If the input geometries are empty, a null Coordinate is returned. +
+ 1.7 +
+ + + Computes the centroid point of a geometry. + + The geometry to use + + The centroid point, or null if the geometry is empty + + + + + the point all triangles are based at + + + + + temporary variable to hold centroid of triangle + + + + + Partial area sum + + + + + partial centroid sum + + + + + Creates a new instance for computing the centroid of a geometry + + + + + Adds a to the centroid total. + + >The to add. + + + + Gets the computed centroid. + + The computed centroid, or null if the input is empty + + + + Computes three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3. + The area is positive if the triangle is oriented CCW, and negative if CW. + + + + + Adds the line segments defined by an array of coordinates + to the linear centroid accumulators. + + An array of s + + + + Adds a point to the point centroid accumulator. + + A + + + + Computes the centroid of an area point. + + + Algorithm: + + Based on the usual algorithm for calculating + the centroid as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + + The algorithm has been extended to handle holes and multi-polygons. + See + for further details of the basic approach. + + + The code has also be extended to handle degenerate (zero-area) polygons. + In this case, the centroid of the line segments in the polygon + will be returned. + + + + + + Adds the area defined by a Geometry to the centroid total. + If the point has no area it does not contribute to the centroid. + + The point to add. + + + + Adds the area defined by an array of + coordinates. The array must be a ring; + i.e. end with the same coordinate as it starts with. + + An array of Coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3, + positive if a,b,c are oriented ccw, and negative if cw. + + + + + Adds the linear segments defined by an array of coordinates + to the linear centroid accumulators. + This is done in case the polygon(s) have zero-area, + in which case the linear centroid is computed instead. + + an array of s + + + + + + + + + + + + + + Computes the centroid of a linear point. + Algorithm: + Compute the average of the midpoints + of all line segments weighted by the segment length. + + + + + Adds the linear components of by a Geometry to the centroid total. + If the geometry has no linear components it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by an array of coordinates. + + An array of Coordinates. + + + + + + + + + Computes the centroid of a point point. + Algorithm: + Compute the average of all points. + + + + + Adds the point(s) defined by a Geometry to the centroid total. + If the point is not of dimension 0 it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by a coordinate. + + A coordinate. + + + + + + + + Basic computational geometry algorithms + for geometry and coordinates defined in 3-dimensional Cartesian space. + + @author mdavis + + + + Computes the distance between two 3D segments. + + @param A the start point of the first segment + @param B the end point of the first segment + @param C the start point of the second segment + @param D the end point of the second segment + @return the distance between the segments + + + + Implements basic computational geometry algorithms using arithmetic. + + Martin Davis + + + + A value which is safely greater than the + relative round-off error in double-precision numbers + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + Computes the sign of the determinant of the 2x2 matrix + with the given entries. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is 0. + + + + + + A filter for computing the orientation index of three coordinates. + + If the orientation can be computed safely using standard DP + arithmetic, this routine returns the orientation index. + Otherwise, a value i > 1 is returned. + In this case the orientation index must + be computed using some other more robust method. + The filter is fast to compute, so can be used to + avoid the use of slower robust methods except when they are really needed, + thus providing better average performance. + + Uses an approach due to Jonathan Shewchuk, which is in the public domain. + + + + The orientation index if it can be computed safely + > 1 if the orientation index cannot be computed safely> + + + + + + Computes an intersection point between two lines + using DD arithmetic. + Currently does not handle case of parallel lines. + + A point of 1st segment + Another point of 1st segment + A point of 2nd segment + Another point of 2nd segment + + + + + Specifies and implements various fundamental Computational Geometric algorithms. + The algorithms supplied in this class are robust for double-precision floating point. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + Returns the index of the direction of the point q + relative to a vector specified by p1-p2. + + The origin point of the vector. + The final point of the vector. + The point to compute the direction to. + + 1 if q is counter-clockwise (left) from p1-p2, + -1 if q is clockwise (right) from p1-p2, + 0 if q is collinear with p1-p2. + + + + + Tests whether a point lies inside or on a ring. + + + The ring may be oriented in either direction. + A point lying exactly on the ring boundary is considered to be inside the ring. + This method does not first check the point against the envelope + of the ring. + + Point to check for ring inclusion. + An array of s representing the ring (which must have first point identical to last point) + true if p is inside ring. + + + + + Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. + + + The ring may be oriented in either direction. + This method does not first check the point against the envelope of the ring. + + Point to check for ring inclusion + An array of coordinates representing the ring (which must have first point identical to last point) + The of p relative to the ring + + + + Tests whether a point lies on the line segments defined by a + list of coordinates. + + + + true if the point is a vertex of the line + or lies in the interior of a line segment in the linestring + + + + + Computes whether a ring defined by an array of s is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + An array of s froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + A coordinate sequence froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + The first vertex of the line segment + The second vertex of the line segment + The point to compute the relative orientation of + + 1 if q is counter-clockwise from p1-p2, + or -1 if q is clockwise from p1-p2, + or 0 if q is collinear with p1-p2 + + + + + Computes the distance from a point p to a line segment AB. + Note: NON-ROBUST! + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The distance from p to line segment AB. + + + + Computes the perpendicular distance from a point p + to the (infinite) line containing the points AB + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The perpendicular distance from p to line AB. + + + + Computes the distance from a point to a sequence of line segments. + + A point + A sequence of contiguous line segments defined by their vertices + The minimum distance between the point and the line segments + If there are too few points to make up a line (at least one?) + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates of the ring + The signed area of the ring + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates forming the ring + The signed area of the ring + + + + Computes the length of a linestring specified by a sequence of points. + + The points specifying the linestring + The length of the linestring + + + + Computes the convex hull of a . + The convex hull is the smallest convex Geometry that contains all the + points in the input Geometry. + Uses the Graham Scan algorithm. + + + + + Create a new convex hull construction for the input Geometry. + + + + + + Create a new convex hull construction for the input array. + + + + + + + + + + + + + + Returns a Geometry that represents the convex hull of the input point. + The point will contain the minimal number of points needed to + represent the convex hull. In particular, no more than two consecutive + points will be collinear. + + + If the convex hull contains 3 or more points, a Polygon; + 2 points, a LineString; + 1 point, a Point; + 0 points, an empty GeometryCollection. + + + + + Uses a heuristic to reduce the number of points scanned to compute the hull. + The heuristic is to find a polygon guaranteed to + be in (or on) the hull, and eliminate all points inside it. + A quadrilateral defined by the extremal points + in the four orthogonal directions + can be used, but even more inclusive is + to use an octilateral defined by the points in the 8 cardinal directions. + Note that even if the method used to determine the polygon vertices + is not 100% robust, this does not affect the robustness of the convex hull. + + To satisfy the requirements of the Graham Scan algorithm, + the returned array has at least 3 entries. + + + The coordinates to reduce + The reduced array of coordinates + + + + Pre sorts the coordinates + + + + + + + + + + + + + + + + + + + + Whether the three coordinates are collinear + and c2 lies between c1 and c3 inclusive. + + + + + + + + + + + + + + + + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + A 2-vertex LineString if the vertices are collinear; + otherwise, a Polygon with unnecessary (collinear) vertices removed. + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + The coordinates with unnecessary (collinear) vertices removed. + + + + Compares s for their angle and distance + relative to an origin. + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + Computes the Euclidean distance (L2 metric) from a to a . + + + Also computes two points on the geometry which are separated by the distance found. + + + + + Contains a pair of points and the distance between them. + + + Provides methods to update with a new point pair with either maximum or minimum distance. + + + + + Initializes to null. + + + + + Initializes the points. + + 1st coordinate + 2nd coordinate + + + + Initializes the points, avoiding recomputing the distance. + + 1st coordinate + 2nd coordinate + the distance between and + + + + The distance between the paired coordinates + + + + + Returns an array containing the paired points + + + + + Represents a homogeneous coordinate in a 2-D coordinate space. + In NTS s are used as a clean way + of computing intersections between line segments. + + David Skea + + + + Computes the (approximate) intersection point between two line segments using homogeneous coordinates. + + + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + 1st Coordinate of 1st linesegment + 2nd Coordinate of 1st linesegment + 1st Coordinate of 2nd linesegment + 2nd Coordinate of 2nd linesegment + + + + Computes the (approximate) intersection point between two line segments + using homogeneous coordinates. + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a homogeneous coordinate which is the intersection of the lines s. + define by the homogenous coordinates represented by two + + A coordinate + A coordinate + + + + Direct access to x private field + + + + + Direct access to y private field + + + + + Direct access to w private field + + + + + + + + + + Computes a point in the interior of an areal geometry. + + +

Algorithm:

+ + Find a Y value which is close to the centre of + the geometry's vertical extent but is different + to any of it's Y ordinates. + Create a horizontal bisector line using the Y value + and the geometry's horizontal extent + Find the intersection between the geometry + and the horizontal bisector line. + The intersection is a collection of lines and points. + Pick the midpoint of the largest intersection geometry + +

KNOWN BUGS

+ + If a fixed precision model is used, + in some cases this method may return a point + which does not lie in the interior.
+
+ + + + + + + + + + + Creates a new interior point finder + for an areal geometry. + + An areal geometry + + + + Tests the interior vertices (if any) + defined by an areal Geometry for the best inside point. + If a component Geometry is not of dimension 2 it is not tested. + + The point to add. + + + + Finds an interior point of a Polygon. + + The geometry to analyze. + + + + If point is a collection, the widest sub-point; otherwise, + the point itself. + + + + + + + + + + + + Returns the centre point of the envelope. + + The envelope to analyze. + The centre of the envelope. + + + + Gets the computed interior point. + + + + + Finds a safe bisector Y ordinate + by projecting to the Y axis + and finding the Y-ordinate interval + which contains the centre of the Y extent. + The centre of this interval is returned as the bisector Y-ordinate. + + Martin Davis + + + + Computes a point in the interior of an linear point. + Algorithm: + Find an interior vertex which is closest to + the centroid of the linestring. + If there is no interior vertex, find the endpoint which is + closest to the centroid. + + + + + + + + + + + Tests the interior vertices (if any) + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + Tests the endpoint vertices + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + + + + + + + + + + + + Computes a point in the interior of an point point. + Algorithm: + Find a point which is closest to the centroid of the point. + + + + + + + + + + + Tests the point(s) defined by a Geometry for the best inside point. + If a Geometry is not of dimension 0 it is not tested. + + The point to add. + + + + + + + + + + + + + + + An interface for classes which determine the of points in a + + Martin Davis + + + + Determines the of a point in the . + + The point to test + the location of the point in the geometry + + + + A LineIntersector is an algorithm that can both test whether + two line segments intersect and compute the intersection point(s) + if they do. + + There are three possible outcomes when determining whether two line segments intersect: + + - the segments do not intersect + - the segments intersect in a single point + - the segments are collinear and they intersect in a line segment + + + + For segments which intersect in a single point, the point may be either an endpoint + or in the interior of each segment. + If the point lies in the interior of both segments, + this is termed a proper intersection. + The property test for this situation. + + The intersection point(s) may be computed in a precise or non-precise manner. + Computing an intersection point precisely involves rounding it + via a supplied . + + LineIntersectors do not perform an initial envelope intersection test + to determine if the segments are disjoint. + This is because this class is likely to be used in a context where + envelope overlap is already known to occur (or be likely). + + + + + These are deprecated, due to ambiguous naming + + + + Indicates that line segments do not intersect + + + + + Indicates that line segments intersect in a single point + + + + + Indicates that line segments intersect in a line segment + + + + + Computes the "edge distance" of an intersection point p along a segment. + The edge distance is a metric of the point along the edge. + The metric used is a robust and easy to compute metric function. + It is not equivalent to the usual Euclidean metric. + It relies on the fact that either the x or the y ordinates of the + points in the edge are unique, depending on whether the edge is longer in + the horizontal or vertical direction. + NOTE: This function may produce incorrect distances + for inputs where p is not precisely on p1-p2 + (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. + My hypothesis is that the function is safe to use for points which are the + result of rounding points which lie on the line, but not safe to use for truncated points. + + + + + This function is non-robust, since it may compute the square of large numbers. + Currently not sure how to improve this. + + + + + The indexes of the endpoints of the intersection lines, in order along + the corresponding line + + + + + If MakePrecise is true, computed intersection coordinates will be made precise + using Coordinate.MakePrecise. + + + + + Gets an endpoint of an input segment. + + the index of the input segment (0 or 1) + the index of the endpoint (0 or 1) + The specified endpoint + + + + Compute the intersection of a point p and the line p1-p2. + This function computes the bool value of the hasIntersection test. + The actual value of the intersection (if there is one) + is equal to the value of p. + + + + + Computes the intersection of the lines p1-p2 and p3-p4. + This function computes both the bool value of the hasIntersection test + and the (approximate) value of the intersection point itself (if there is one). + + + + + Returns the intIndex'th intersection point. + + is 0 or 1. + The intIndex'th intersection point. + + + + Test whether a point is a intersection point of two line segments. + Note that if the intersection is a line segment, this method only tests for + equality with the endpoints of the intersection segment. + It does not return true if the input point is internal to the intersection segment. + + true if the input point is one of the intersection points. + + + + Tests whether either intersection point is an interior point of one of the input segments. + + + true if either intersection point is in the interior of one of the input segment. + + + + + Tests whether either intersection point is an interior point of the specified input segment. + + + true if either intersection point is in the interior of the input segment. + + + + + Computes the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The intIndex'th intersection point in the direction of the specified input line segment. + + + + + Computes the index (order) of the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The index of the intersection point along the segment (0 or 1). + + + + + Computes the intersection line index + + The segment index + + + + Computes the "edge distance" of an intersection point along the specified input line segment. + + is 0 or 1. + is 0 or 1. + The edge distance of the intersection point. + + + + Alias the [0] for ease of reference + + + + + Alias the [1] for ease of reference + + + + + Force computed intersection to be rounded to a given precision model + + + + + Force computed intersection to be rounded to a given precision model. + No getter is provided, because the precision model is not required to be specified. + + + + + Tests whether the input geometries intersect. + + true if the input geometries intersect. + + + + Returns the number of intersection points found. This will be either 0, 1 or 2. + + The number of intersection points found (0, 1, or 2) + + + + Tests whether an intersection is proper. + The intersection between two line segments is considered proper if + they intersect in a single point in the interior of both segments + (e.g. the intersection is a single point and is not equal to any of the endpoints). + The intersection between a point and a line segment is considered proper + if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). + + true if the intersection is proper. + + + + Determines the location of s relative to + a geometry, using indexing for efficiency. + This algorithm is suitable for use in cases where + many points will be tested against a given area. + + Thread-safe and immutable. + + Martin Davis + + + + An interface for classes which determine the of + points in areal geometries. + + Martin Davis + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + Creates a new locator for a given . + + the Geometry to locate in + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + + A visitor for items in an index. + + + + + + + + + + + Static methods for classes + + + + + Convenience method to test a point for intersection with a geometry + + The geometry is wrapped in a class. + + The locator to use. + The coordinate to test. + true if the point is in the interior or boundary of the geometry. + + + Computes the location of points relative to an areal , using a simple O(n) algorithm. + This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. + + The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. + + + + Determines the of a point in an areal . Currently this will never return a value of . + + The point to test + The areal geometry to test + The Location of the point in the geometry + + + + Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. + + The point to test + A linear ring + true if the point lies inside the ring + + + + Measures the degree of similarity between two s + using the area of intersection between the geometries. + The measure is normalized to lie in the range [0, 1]. + Higher measures indicate a great degree of similarity. + + + NOTE: Currently experimental and incomplete. + + mbdavis + + + + An interface for classes which measures the degree of similarity between two {@link Geometry}s. + + + The computed measure lies in the range [0, 1]. + Higher measures indicate a great degree of similarity. + A measure of 1.0 indicates that the input geometries are identical + A measure of 0.0 indicates that the geometries have essentially no similarity. + The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. + + mbdavis + + + + Function to measure the similarity between two s. + + A geometry + A geometry + The similarity value between two s + + + + Measures the degree of similarity between two s using the Hausdorff distance metric. + + + + The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. + + + The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing + this by dividing it by the diagonal distance across the envelope of the combined geometries. + + + mbdavis + + + + + + + + + + + Provides methods to mathematically combine values. + + Martin Davis + + + + + + + + + + + + Implements IPointInRing + using a MonotoneChains and a BinTree index to increase performance. + + + + + + An interface for classes which test whether a Coordinate lies inside a ring. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The action for the internal iterator for performing + envelope select queries on a MonotoneChain. + + + + + These envelopes are used during the MonotoneChain search process. + + + + + + + + + + This method is overridden to process a segment + in the context of the parent chain. + + The parent chain + The index of the start vertex of the segment being processed + + + + This is a convenience method which can be overridden to obtain the actual + line segment which is selected. + + + + + + + + + + + + + + + + + + + Computes the Minimum Bounding Circle (MBC) for the points in a . + The MBC is the smallest circle which covers all the input points + (this is also sometimes known as the Smallest Enclosing Circle). + This is equivalent to computing the Maximum Diameter of the input point set. + + + + The computed circle can be specified in two equivalent ways, + both of which are provide as output by this class: + + As a centre point and a radius + By the set of points defining the circle. + + Depending on the number of points in the input + and their relative positions, this + will be specified by anywhere from 0 to 3 points. + + 0 or 1 points indicate an empty or trivial input point arrangment. + 2 or 3 points define a circle which contains + all the input points. + + + + + The class can also output a which approximates the + shape of the MBC (although as an approximation it is not + guaranteed to cover all the input points.) + + Martin Davis + + + The algorithm used is based on the one by Jon Rokne in + the article "An Easy Bounding Circle" in Graphic Gems II. + + + + Creates a new object for computing the minimum bounding circle for the + point set defined by the vertices of the given geometry. + + The geometry to use to obtain the point set + + + + Gets a geometry which represents the Minimum Bounding Circle. + + + + If the input is degenerate (empty or a single unique point), + this method will return an empty geometry or a single Point geometry. + Otherwise, a Polygon will be returned which approximates the + Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) + + + A Geometry representing the Minimum Bounding Circle. + + + + Gets a geometry representing a line between the two farthest points + in the input. + These points will be two of the extremal points of the Minimum Bounding Circle. + They also lie on the convex hull of the input. + + A LineString between the two farthest points of the input + An empty LineString if the input is empty + A Point if the input is a point + + + + Gets a geometry representing the diameter of the computed Minimum Bounding Circle. + + + + the diameter line of the Minimum Bounding Circle + an empty line if the input is empty + a Point if the input is a point + + + + + + Gets the extremal points which define the computed Minimum Bounding Circle. + + + There may be zero, one, two or three of these points, + depending on the number of points in the input + and the geometry of those points. + + The points defining the Minimum Bounding Circle + + + + Gets the centre point of the computed Minimum Bounding Circle. + + the centre point of the Minimum Bounding Circle, null if the input is empty + + + + Gets the radius of the computed Minimum Bounding Circle. + + The radius of the Minimum Bounding Circle + + + + Computes the minimum diameter of a . + + + + The minimum diameter is defined to be the + width of the smallest band that contains the point, + where a band is a strip of the plane defined + by two parallel lines. + This can be thought of as the smallest hole that the point can be + moved through, with a single rotation. + + + The first step in the algorithm is computing the convex hull of the Geometry. + If the input Geometry is known to be convex, a hint can be supplied to + avoid this computation. + + + This class can also be used to compute a line segment representing + the minimum diameter, the supporting line segment of the minimum diameter, + and a minimum rectangle enclosing the input geometry. + This rectangle will + have width equal to the minimum diameter, and have one side + parallel to the supporting segment. + + + + + + + Gets the minimum rectangle enclosing a geometry. + + The geometry + The minimum rectangle enclosing the geometry + + + + Gets the minimum diameter enclosing a geometry. + + The geometry + The length of the minimum diameter of the geometry + + + + Compute a minimum diameter for a given . + + a Geometry. + + + + Compute a minimum diameter for a giver Geometry, + with a hint if + the Geometry is convex + (e.g. a convex Polygon or LinearRing, + or a two-point LineString, or a Point). + + a Geometry which is convex. + true if the input point is convex. + + + + + + + + + + + + + + + Compute the width information for a ring of Coordinates. + Leaves the width information in the instance variables. + + + + + + + + + + + + + + + + + + + + + + + Gets the minimum rectangular which encloses the input geometry. + + + + The rectangle has width equal to the minimum diameter, and a longer length. + If the convex hull of the input is degenerate (a line or point) a or is returned. + + + The minimum rectangle can be used as an extremely generalized representation for the given geometry. + + + The minimum rectangle enclosing the input (or a line or point if degenerate) + + + + Gets the length of the minimum diameter of the input Geometry. + + The length of the minimum diameter. + + + + Gets the Coordinate forming one end of the minimum diameter. + + A coordinate forming one end of the minimum diameter. + + + + Gets the segment forming the base of the minimum diameter. + + The segment forming the base of the minimum diameter. + + + + Gets a LineString which is a minimum diameter. + + A LineString which is a minimum diameter. + + + + Non-robust versions of various fundamental Computational Geometric algorithms, + FOR TESTING PURPOSES ONLY!. + The non-robustness is due to rounding error in floating point computation. + + + + + + + + + + + + + Computes whether a ring defined by an array of Coordinate is + oriented counter-clockwise. + This will handle coordinate lists which contain repeated points. + + an array of coordinates forming a ring. + + true if the ring is oriented counter-clockwise. + throws ArgumentException if the ring is degenerate (does not contain 3 different points) + + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + 1 if q is counter-clockwise from p1-p2 + -1 if q is clockwise from p1-p2 + 0 if q is collinear with p1-p2 + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + the origin point of the vector + the final point of the vector + the point to compute the direction to + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + A non-robust version of LineIntersector. + + + + + + + + + + true if both numbers are positive or if both numbers are negative, + false if both numbers are zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RParameter computes the parameter for the point p + in the parameterized equation + of the line from p1 to p2. + This is equal to the 'distance' of p along p1-p2. + + + + + + + + + + + + + + + Computes the topological relationship () of a single point to a Geometry. + + + A may be specified to control the evaluation of whether the point lies on the boundary or not + The default rule is to use the the SFS Boundary Determination Rule + + Notes: + + s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. + + Instances of this class are not reentrant. + + + + + + Initializes a new instance of the class. + + + + + Convenience method to test a point for intersection with a Geometry + + The coordinate to test. + The Geometry to test. + true if the point is in the interior or boundary of the Geometry. + + + + Computes the topological relationship ({Location}) of a single point to a Geometry. + It handles both single-element and multi-element Geometries. + The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. + + The Location of the point relative to the input Geometry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the number of segments crossed by a horizontal ray extending to the right + from a given point, in an incremental fashion. + This can be used to determine whether a point lies in a geometry. + The class determines the situation where the point lies exactly on a segment. + When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. + + + This class handles polygonal geometries with any number of shells and holes. + The orientation of the shell and hole rings is unimportant. + In order to compute a correct location for a given polygonal geometry, + it is essential that all segments are counted which + + touch the ray + lie in in any ring which may contain the point + + + The only exception is when the point-on-segment situation is detected, in which + case no further processing is required. + The implication of the above rule is that segments which can be a priori determined to not touch the ray + (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. + + + Martin Davis + + + + Determines the of a point in a ring. + This method is an exemplar of how to use this class. + + The point to test + An array of Coordinates forming a ring + The location of the point in the ring + + + + Determines the of a point in a ring. + + The point to test + A coordinate sequence forming a ring + The location of the point in the ring + + + + Counts a segment + + An endpoint of the segment + Another endpoint of the segment + + + + Reports whether the point lies exactly on one of the supplied segments. + + This method may be called at any time as segments are processed. If the result of this method is true, + no further segments need be supplied, since the result will never change again. + + + + + + Gets the of the point relative to the ring, polygon + or multipolygon from which the processed segments were provided. + + This property only determines the correct location if all relevant segments have been processed + + + + Tests whether the point lies in or on the ring, polygon + + + This property only determines the correct location if all relevant segments have been processed + + + + Computes whether a rectangle intersects line segments. + + + Rectangles contain a large amount of inherent symmetry + (or to put it another way, although they contain four + coordinates they only actually contain 4 ordinates + worth of information). + The algorithm used takes advantage of the symmetry of + the geometric situation + to optimize performance by minimizing the number + of line intersection tests. + + Martin Davis + + + + Creates a new intersector for the given query rectangle, + specified as an . + + The query rectangle, specified as an Envelope + + + + Tests whether the query rectangle intersects a given line segment. + + The first endpoint of the segment + The second endpoint of the segment + true if the rectangle intersects the segment + + + + Implements an algorithm to compute the + sign of a 2x2 determinant for double precision values robustly. + It is a direct translation of code developed by Olivier Devillers. + + The original code carries the following copyright notice: + ************************************************************************ + Author : Olivier Devillers + Olivier.Devillers@sophia.inria.fr + http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html + + Olivier Devillers has allowed the code to be distributed under + the LGPL (2012-02-16) saying "It is ok for LGPL distribution." + + ************************************************************************* + ************************************************************************* + Copyright (c) 1995 by INRIA Prisme Project + BP 93 06902 Sophia Antipolis Cedex, France. + All rights reserved + ************************************************************************* + + + + + Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is null. + + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + A robust version of . + + + + + + + + + + + + + + + + + + + + + + + This method computes the actual value of the intersection point. + To obtain the maximum precision from the intersection calculation, + the coordinates are normalized by subtracting the minimum + ordinate values (in absolute value). This has the effect of + removing common significant digits from the calculation to + maintain more bits of precision. + + + + + + + + + + Computes a segment intersection using homogeneous coordinates. + Round-off error can cause the raw computation to fail, + (usually due to the segments being approximately parallel). + If this happens, a reasonable approximation is computed instead. + + + + + Normalize the supplied coordinates to + so that the midpoint of their intersection envelope + lies at the origin. + + + + + Tests whether a point lies in the envelopes of both input segments. + A correctly computed intersection point should return true + for this test. + Since this test is for debugging purposes only, no attempt is + made to optimize the envelope test. + + + true if the input point lies within both input segment envelopes. + + + + Finds the endpoint of the segments P and Q which + is closest to the other segment. + This is a reasonable surrogate for the true + intersection points in ill-conditioned cases + (e.g. where two segments are nearly coincident, + or where the endpoint of one segment lies almost on the other segment). + + + This replaces the older CentralEndpoint heuristic, + which chose the wrong endpoint in some cases + where the segments had very distinct slopes + and one endpoint lay almost on the other segment. + + an endpoint of segment P + an endpoint of segment P + an endpoint of segment Q + an endpoint of segment Q + the nearest endpoint to the other segment + + + + Tests whether a Coordinate lies inside + a ring, using a linear-time algorithm. + + + + + + + + + + + + + + + + + + + + + + + Implements PointInRing using a SIRtree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all ICRSObject implementing types + + + + + Base Interface for CRSBase Object types. + + + + + Gets the CRS type. + + + + + Gets the type of the CRSBase object. + + + + + Gets the properties. + + + + + Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. + + + + + Defines the Named CRS type. + + + + + Defines the Linked CRS type. + + + + + Defines the Linked CRS type. + + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Defines the Named CRS type. + + + + + Initializes a new instance of the class. + + + The mandatory name + member must be a string identifying a coordinate reference system. OGC CRS URNs such as + 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. + + + + + A graph containing s. + + + + + A graph comprised of s. + It supports tracking the vertices in the graph + via edges incident on them, + to allow efficient lookup of edges and vertices. + + + This class may be subclassed to use a + different subclass of HalfEdge, + by overriding . + If additional logic is required to initialize + edges then + can be overridden as well. + + + + + Creates a single HalfEdge. + Override to use a different HalfEdge subclass. + + the origin location + a new with the given origin + + + + Adds an edge between the coordinates orig and dest + to this graph. + + + Only valid edges can be added (in particular, zero-length segments cannot be added) + + the edge origin location + the edge destination location + The created edge + null if the edge was invalid and not added + + + + + Test if an the coordinates for an edge form a valid edge (with non-zero length) + + The start coordinate + The end coordinate + true of the edge formed is valid + + + + Inserts an edge not already present into the graph. + + the edge origin location + the edge destination location + an existing edge with same orig (if any) + the created edge + + + + Finds an edge in this graph with the given origin + and destination, if one exists. + + the origin location + the destination location + an edge with the given orig and dest, or null if none exists + + + + A HalfEdge which carries information + required to support . + + + + + A which supports + marking edges with a boolean flag. + Useful for algorithms which perform graph traversals. + + + + + Represents a directed component of an edge in an . + HalfEdges link vertices whose locations are defined by s. + HalfEdges start at an origin vertex, + and terminate at a destination vertex. + HalfEdges always occur in symmetric pairs, with the method + giving access to the oppositely-oriented component. + HalfEdges and the methods on them form an edge algebra, + which can be used to traverse and query the topology + of the graph formed by the edges. + + + By design HalfEdges carry minimal information + about the actual usage of the graph they represent. + They can be subclassed to carry more information if required. + + + HalfEdges form a complete and consistent data structure by themselves, + but an is useful to allow retrieving edges + by vertex and edge location, as well as ensuring + edges are created and linked appropriately. + + + + + Creates a HalfEdge pair representing an edge + between two vertices located at coordinates p0 and p1. + + a vertex coordinate + a vertex coordinate + the HalfEdge with origin at p0 + + + + Initialize a symmetric pair of HalfEdges. + Intended for use by subclasses. + The edges are initialized to have each other + as the edge, and to have pointers + which point to edge other. + This effectively creates a graph containing a single edge. + + a HalfEdge + a symmetric HalfEdge + the initialized edge e0 + + + + Creates an edge originating from a given coordinate. + + the origin coordinate + + + + Finds the edge starting at the origin of this edge + with the given dest vertex, if any. + + the dest vertex to search for + + the edge with the required dest vertex, + if it exists, or null + + + + + Tests whether this edge has the given orig and dest vertices. + + the origin vertex to test + the destination vertex to test + true if the vertices are equal to the ones of this edge + + + + Inserts an edge + into the ring of edges around the origin vertex of this edge. + The inserted edge must have the same origin as this edge. + + the edge to insert + + + + Insert an edge with the same origin after this one. + Assumes that the inserted edge is in the correct + position around the ring. + + the edge to insert (with same origin) + + + + Compares edges which originate at the same vertex + based on the angle they make at their origin vertex with the positive X-axis. + This allows sorting edges around their origin vertex in CCW order. + + + + + Implements the total order relation. + The angle of edge a is greater than the angle of edge b, + where the angle of an edge is the angle made by + the first segment of the edge with the positive x-axis. + When applied to a list of edges originating at the same point, + this produces a CCW ordering of the edges around the point. + Using the obvious algorithm of computing the angle is not robust, + since the angle calculation is susceptible to roundoff error. + + + A robust algorithm is: + 1. compare the quadrants the edge vectors lie in. + If the quadrants are different, + it is trivial to determine which edge has a greater angle. + 2. If the vectors lie in the same quadrant, the + function + can be used to determine the relative orientation of the vectors. + + + + + Computes a string representation of a HalfEdge. + + + + + Computes the degree of the origin vertex. + The degree is the number of edges + originating from the vertex. + + the degree of the origin vertex + + + + Finds the first node previous to this edge, if any. + If no such node exists (i.e the edge is part of a ring) + then null is returned. + + + an edge originating at the node prior to this edge, if any, + or null if no node exists + + + + + Gets the origin coordinate of this edge. + + + + + Gets the destination coordinate of this edge. + + + + + Gets the symmetric pair edge of this edge. + + + + + Gets the next edge CCW around the + destination vertex of this edge. + If the vertex has degree 1 then this is the sym edge. + + + + + Returns the edge previous to this one + (with dest being the same as this orig). + + + + + The X component of the distance between the orig and dest vertices. + + + + + The Y component of the distance between the orig and dest vertices. + + + + + Sets the mark for the given edge pair to a boolean value. + + an edge of the pair to update + the mark value to set + + + + Marks the edges in a pair. + + an edge of the pair to mark + + + + Creates a new marked edge. + + the coordinate of the edge origin + + + + Marks this edge. + + + + + Sets this edge to be the start segment of an input LineString. + + + + + Tests whether this edge is the starting segment + in a LineString being dissolved. + + true if this edge is a start segment + + + + Dissolves the linear components + from a collection of s. + into a set of maximal-length s + in which every unique segment appears once only. + The output linestrings run between node vertices + of the input, which are vertices which have + either degree 1, or degree 3 or greater. + + + Use cases for dissolving linear components + include generalization + (in particular, simplifying polygonal coverages), + and visualization + (in particular, avoiding symbology conflicts when + depicting shared polygon boundaries). + + + This class does NOT node the input lines. + If there are line segments crossing in the input, + they will still cross in the output. + + + + + Dissolves the linear components in a geometry. + + the geometry to dissolve + the dissolved lines + + + + Adds a to be dissolved. + Any number of geometries may be adde by calling this method multiple times. + Any type of Geometry may be added. The constituent linework will be + extracted to be dissolved. + + geometry to be line-merged + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + the geometries to be line-merged + + + + Gets the dissolved result as a . + + the dissolved lines + + + + For each edge in stack + (which must originate at a node) + extracts the line it initiates. + + + + + Updates the tracked ringStartEdge + if the given edge has a lower origin + (using the standard ordering). + + + Identifying the lowest starting node meets two goals: + * It ensures that isolated input rings are created using the original node and orientation. + * For isolated rings formed from multiple input linestrings, + it provides a canonical node and orientation for the output + (rather than essentially random, and thus hard to test). + + + + + + Builds a line starting from the given edge. + The start edge origin is a node (valence = 1 or >= 3), + unless it is part of a pure ring. + + + A pure ring has no other incident lines. + In this case the start edge may occur anywhere on the ring. + + + The line is built up to the next node encountered, + or until the start edge is re-encountered + (which happens if the edges form a ring). + + + + + + Adds edges around this node to the stack. + + + + + + Builds an edge graph from geometries containing edges. + + + + + Adds the edges of a Geometry to the graph. + May be called multiple times. + Any dimension of Geometry may be added; the constituent edges are extracted. + + geometry to be added + + + + Adds the edges in a collection of s to the graph. + May be called multiple times. + Any dimension of may be added. + + the geometries to be added + + + + Represents a feature collection. + + + + + Initializes a new instance of the class. + + The features. + + + + Initializes a new instance of the class. + + + + + Adds the specified feature. + + The feature. + + + + Removes the specified feature. + + The feature. + true if item is successfully removed; otherwise, false. This method also returns + false if item was not found in the collection. + + + + Removes the element at the specified index of the collection. + + The index. + + + + Gets the features. + + The features. + + + + Gets the (mandatory) type of the GeoJSON Object. + + + The type of the object. + + + + + Gets or sets the (optional) Coordinate Reference System Object. + + + The Coordinate Reference System Objects. + + + + + Returns the indexTh element in the collection. + + + + + + Returns the number of features contained by this . + + + + + A representation of a planar, linear vector geometry. + + + +

Binary Predicates:

+ Because it is not clear at this time what semantics for spatial + analysis methods involving GeometryCollections would be useful, + GeometryCollections are not supported as arguments to binary + predicates or the Relate method. +
+ +

Overlay Methods:

+ The spatial analysis methods will + return the most specific class possible to represent the result. If the + result is homogeneous, a Point, LineString, or + Polygon will be returned if the result contains a single + element; otherwise, a MultiPoint, MultiLineString, + or MultiPolygon will be returned. If the result is + heterogeneous a GeometryCollection will be returned. +
+ + Representation of Computed Geometries: + The SFS states that the result + of a set-theoretic method is the "point-set" result of the usual + set-theoretic definition of the operation (SFS 3.2.21.1). However, there are + sometimes many ways of representing a point set as a Geometry. + The SFS does not specify an unambiguous representation of a given point set + returned from a spatial analysis method. One goal of NTS is to make this + specification precise and unambiguous. NTS uses a canonical form for + Geometrys returned from overlay methods. The canonical + form is a Geometry which is simple and noded: + Simple means that the Geometry returned will be simple according to + the NTS definition of IsSimple. + Noded applies only to overlays involving LineStrings. It + means that all intersection points on LineStrings will be + present as endpoints of LineStrings in the result. + This definition implies that non-simple geometries which are arguments to + spatial analysis methods must be subjected to a line-dissolve process to + ensure that the results are simple. + + + Constructed Points And The Precision Model: + The results computed by the set-theoretic methods may + contain constructed points which are not present in the input Geometrys. + These new points arise from intersections between line segments in the + edges of the input Geometrys. In the general case it is not + possible to represent constructed points exactly. This is due to the fact + that the coordinates of an intersection point may contain twice as many bits + of precision as the coordinates of the input line segments. In order to + represent these constructed points explicitly, NTS must truncate them to fit + the PrecisionModel. + Unfortunately, truncating coordinates moves them slightly. Line segments + which would not be coincident in the exact result may become coincident in + the truncated representation. This in turn leads to "topology collapses" -- + situations where a computed element has a lower dimension than it would in + the exact result. + When NTS detects topology collapses during the computation of spatial + analysis methods, it will throw an exception. If possible the exception will + report the location of the collapse. + + + +

Geometry Equality

+ There are two ways of comparing geometries for equality: + structural equality and topological equality. +

Structural Equality

+ Structural Equality is provided by the + method. + This implements a comparison based on exact, structural pointwise + equality. + The is a synonym for this method, + to provide structural equality semantics for + use in collections. + It is important to note that structural pointwise equality + is easily affected by things like + ring order and component order. In many situations + it will be desirable to normalize geometries before + comparing them (using the + or methods). + is provided + as a convenience method to compute equality over + normalized geometries, but it is expensive to use. + Finally, + allows using a tolerance value for point comparison. + +

Topological Equality

+ Topological Equality is provided by the + method. + It implements the SFS definition of point-set equality + defined in terms of the DE-9IM matrix. + To support the SFS naming convention, the method + is also provided as a synonym. + However, due to the potential for confusion with + its use is discouraged. + + Since and are overridden, + Geometries can be used effectively in .Net collections. + +
+
+ + + + + + + An object reference which can be used to carry ancillary data defined + by the client. + + + + The bounding box of this Geometry. + + + + + Creates a new Geometry via the specified GeometryFactory. + + The factory + + + + Returns true if the array contains any non-empty Geometrys. + + an array of Geometrys; no elements may be null + + true if any of the Geometrys + IsEmpty methods return false. + + + + + Returns true if the array contains any null elements. + + an array to validate. + true if any of arrays elements are null. + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + Returns an element Geometry from a GeometryCollection, + or this, if the geometry is not a collection. + + The index of the geometry element. + The n'th geometry contained in this geometry. + + + + Returns the minimum distance between this Geometry + and another Geometry g. + + The Geometry from which to compute the distance. + The distance between the geometries + 0 if either input geometry is empty + if g is null + + + + Tests whether the distance from this Geometry + to another is less than or equal to a specified value. + + the Geometry to check the distance to. + the distance value to compare. + true if the geometries are less than distance apart. + + + + Notifies this geometry that its coordinates have been changed by an external + party (for example, via a ). + + + When this method is called the geometry will flush + and/or update any derived information it has cached (such as its ). + The operation is applied to all component Geometries. + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When GeometryChanged is called, this method will be called for + this Geometry and its component Geometries. + + + + + Tests whether this geometry is disjoint from the argument geometry. + + + The Disjoint predicate has the following equivalent definitions: + + The DE-9IM intersection matrix for the two geometries matches FF*FF****. + !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
+
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys are disjoint. + +
+ + + Tests whether this geometry touches the argument geometry + + + The Touches predicate has the following equivalent definitions: + + The geometries have at least one point in common, + but their interiors do not intersect + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns + + FT*******, + F**T***** or + F***T****. + + + If both geometries have dimension 0, the predicate returns false, + since points have only interiors. + This predicate is symmetric. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys touch; + Returns false if both Geometrys are points. + + + + + Tests whether this geometry intersects the argument geometry. + + + The Intersects predicate has the following equivalent definitions: + + The two geometries have at least one point in common + The DE-9IM Intersection Matrix for the two geometries matches
+ [T********] or
+ [*T*******] or
+ [***T*****] or
+ [****T****]
+ !g.disjoint(this)
+ (Intersects is the inverse of Disjoint)
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys intersect. + +
+ + + Tests whether this geometry crosses the specified geometry. + + + The Crosses predicate has the following equivalent definitions: + + The geometries have some but not all interior points in common. + The DE-9IM Intersection Matrix for the two geometries matches + one of the following patterns: + + CodeDescription + [T*T******]for P/L, P/A, and L/A situations + [T*****T**]for L/P, A/P, and A/L situations) + [0********]for L/L situations + + + + For any other combination of dimensions this predicate returns false. + + The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. + In order to make the relation symmetric, + NTS extends the definition to apply to L/P, A/P and A/L situations as well. + + + The Geometry with which to compare this Geometry + true if the two Geometrys cross. + + + + Tests whether this geometry is within the specified geometry. + + + The within predicate has the following equivalent definitions: + + + Every point of this geometry is a point of the other geometry, + and the interiors of the two geometries have at least one point in common. + + The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] + g.contains(this) == true
(Within is the converse of )
+
+ + An implication of the definition is that "The boundary of a geometry is not within the Polygon". + In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false + (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) + For a predicate with similar behaviour but avoiding + this subtle limitation, see . + +
+ The Geometry with which to compare this Geometry. + true if this Geometry is within other. + + +
+ + + + Tests whether this geometry overlaps the specified geometry. + + + The Overlaps predicate has the following equivalent definitions: + + The geometries have at least one point each not shared by the other (or equivalently neither covers the other), + they have the same dimension, + and the intersection of the interiors of the two geometries has + the same dimension as the geometries themselves. + The DE-9IM Intersection Matrix for the two geometries matches + [T*T***T**] (for two points or two surfaces) + or [1*T***T**] (for two curves) + + If the geometries are of different dimension this predicate returns false. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys overlap. + For this function to return true, the Geometry + s must be two points, two curves or two surfaces. + + + + + Tests whether this geometry covers the argument geometry + + + The covers predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry. + The DE-9IM Intersection Matrix for the two geometries matches at least + one of the following patterns: + + [T*****FF*] or
+ [*T****FF*] or
+ [***T**FF*] or
+ [****T*FF*] +
+
+ g.CoveredBy(this) == true
+ (covers is the converse of )
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + In particular, unlike Contains it does not distinguish between + points in the boundary and in the interior of geometries. + For most situations, Covers should be used in preference to Contains. + As an added benefit, Covers is more amenable to optimization, + and hence should be more performant. + +
+ The Geometry with which to compare this Geometry + true if this Geometry covers + + +
+ + Tests whether this geometry is covered by the specified geometry. + + The CoveredBy predicate has the following equivalent definitions: + + Every point of this geometry is a point of the other geometry. + + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns: + + [T*F**F***] + [*TF**F***] + [**FT*F***] + [**F*TF***] + g.Covers(this) == true
+ (CoveredBy is the converse of ) +
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + +
+ the Geometry with which to compare this Geometry + true if this Geometry is covered by g + + +
+ + + Tests whether the elements in the DE-9IM + for the two Geometrys match the elements in intersectionPattern. + + + The pattern is a 9-character string, with symbols drawn from the following set: + + 0 (dimension 0) + 1 (dimension 1) + 2 (dimension 2) + T ( matches 0, 1 or 2) + F ( matches FALSE) + * ( matches any value) + For more information on the DE-9IM, see the OpenGIS Simple Features + Specification. + + the Geometry with which to compare this Geometry + the pattern against which to check the + intersection matrix for the two Geometrys + true if the DE-9IM intersection + matrix for the two Geometrys match intersectionPattern + + + + + Returns the DE-9IM intersection matrix for the two Geometrys. + + The Geometry with which to compare this Geometry + + A matrix describing the intersections of the interiors, + boundaries and exteriors of the two Geometrys. + + + + + Tests whether this geometry is + topologically equal to the argument geometry. + + This method is included for backward compatibility reasons. + It has been superseded by the method, + which has been named to clearly denote its functionality. + + This method should NOT be confused with the method + , which implements + an exact equality comparison. + + The Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal. + + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS Equals predicate. + + + The SFS equals predicate has the following equivalent definitions: + + The two geometries have at least one point in common, + and no point of either geometry lies in the exterior of the other geometry. + The DE-9IM Intersection Matrix for the two geometries matches + the pattern T*F**FFF* +
+            T*F
+            **F
+            FF*
+            
+
+ Note that this method computes topologically equality. + For structural equality, see {@link #equalsExact(Geometry)}. +
+ the Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal +
+ + + Tests whether this geometry is structurally and numerically equal + to a given Object. + + + If the argument Object is not a Geometry, + the result is false. + Otherwise, the result is computed using + . + + This method is provided to fulfill the Java contract + for value-based object equality. + In conjunction with + it provides semantics which are most useful + for using + Geometrys as keys and values in Java collections. + + Note that to produce the expected result the input geometries + should be in normal form. It is the caller's + responsibility to perform this where required + (using + or as appropriate). + + The object to compare + true if this geometry is exactly equal to the argument + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets a hash code for the Geometry. + + + An integer value suitable for use as a hashcode + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + + + + + + + Returns the Well-known Binary representation of this Geometry. + For a definition of the Well-known Binary format, see the OpenGIS Simple + Features Specification. + + The Well-known Binary representation of this Geometry. + + + + + + + + + + Returns the feature representation as GML 2.1.1 XML document. + This XML document is based on Geometry.xsd schema. + NO features or XLink are implemented here! + + + + + Computes a buffer area around this geometry having the given width. The + buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The buffer geometry is constructed using 8 segments per quadrant to approximate + the circular arcs. + The end cap style is BufferStyle.CapRound. + + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified accuracy of approximation for circular arcs. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + + + + Returns the smallest convex Polygon that contains all the + points in the Geometry. This obviously applies only to Geometry + s which contain 3 or more points. + + the minimum-area convex polygon containing this Geometry's points. + + + + Computes a new geometry which has all component coordinate sequences + in reverse order (opposite orientation) to this one. + + A reversed geometry + + + + Computes a Geometry representing the point-set which is + common to both this Geometry and the other Geometry. + + The intersection of two geometries of different dimension produces a result + geometry of dimension less than or equal to the minimum dimension of the input + geometries. + The result geometry may be a heterogenous . + If the result is empty, it is an atomic geometry + with the dimension of the lowest input dimension. + + Intersection of s is supported + only for homogeneous collection types. + + Non-empty heterogeneous arguments are not supported. + + The Geometry with which to compute the intersection. + A geometry representing the point-set common to the two Geometrys. + if a robustness error occurs. + if the argument is a non-empty heterogenous GeometryCollection + + + + Computes a Geometry representing the point-set + which is contained in both this + Geometry and the other Geometry. + + + The method may be used on arguments of different dimension, but it does not + support arguments. + + The union of two geometries of different dimension produces a result + geometry of dimension equal to the maximum dimension of the input + geometries. + The result geometry may be a heterogenous + . + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Unioning s has the effect of + noding and dissolving the input linework. In this context + "noding" means that there will be a node or endpoint in the result for + every endpoint or line segment crossing in the input. "Dissolving" means + that any duplicate (i.e. coincident) line segments or portions of line + segments will be reduced to a single line segment in the result. + If merged linework is required, the + class can be used. + + Non-empty arguments are not supported. + the Geometry with which to compute the union + A point-set combining the points of this Geometry and the + points of other + Thrown if a robustness error occurs + Thrown if either input is a non-empty GeometryCollection + + + + + Computes a Geometry representing the closure of the point-set + of the points contained in this Geometry that are not contained in + the other Geometry. + + If the result is empty, it is an atomic geometry + with the dimension of the left-hand input. + + Non-empty arguments are not supported. + + The Geometry with which to compute the difference. + A Geometry representing the point-set difference of this Geometry with other. + + + + Computes a Geometry representing the closure of the point-set + which is the union of the points in this Geometry which are not + contained in the other Geometry, + with the points in the other Geometry not contained in this + Geometry. + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Non-empty arguments are not supported. + + The Geometry with which to compute the symmetric difference. + a Geometry representing the point-set symmetric difference of this Geometry with other. + + + + Computes the union of all the elements of this geometry. + + + This method supports s (which the other overlay operations currently do not). + + The result obeys the following contract: + + Unioning a set of s has the effect of fully noding and dissolving the linework. + Unioning a set of s always returns a geometry + (unlike ), which may return geometries of lower dimension if a topology + collapse occurred). + + + Thrown if a robustness error occurs + + + + Returns true if the two Geometrys are exactly equal, + up to a specified tolerance. + Two Geometries are exactly within a tolerance equal if: + + they have the same class, + they have the same values of Coordinates, + within the given tolerance distance, in their internal + Coordinate lists, in exactly the same order. + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry + have identical structure and point values, up to the distance tolerance. + Distance at or below which two Coordinates will be considered equal. + + true if this and the other Geometry + are of the same class and have equal internal data. + + + + + + + + Returns true if the two Geometrys are exactly equal. + Two Geometries are exactly equal if: + + they have the same class, + they have the same values of Coordinates in their internal + Coordinate lists, in exactly the same order. + + This provides a stricter test of equality than + , which is more useful + in certain situations + (such as using geometries as keys in collections). + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry. + + true if this and the other Geometry have identical structure and point values. + + + + + Tests whether two geometries are exactly equal + in their normalized forms. + + This is a convenience method which creates normalized + versions of both geometries before computing + . + This method is relatively expensive to compute. + For maximum performance, the client + should instead perform normalization on the individual geometries + at an appropriate point during processing. + + + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + Performs an operation with or on this Geometry's coordinates. + + + If this method modifies any coordinate values, + must be called to update the geometry state. + Note that you cannot use this method to + modify this Geometry if its underlying CoordinateSequence's #get method + returns a copy of the Coordinate, rather than the actual Coordinate stored + (if it even stores Coordinate objects at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + + + If the filter reports that a coordinate value has been changed, + will be called automatically. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + + + + + + + Converts this Geometry to normal form (or canonical form ). + + + + Normal form is a unique representation for Geometrys. + It can be used to test whether two Geometrys are equal + in a way that is independent of the ordering of the coordinates within + them. Normal form equality is a stronger condition than topological + equality, but weaker than pointwise equality. + + The definitions for normal + form use the standard lexicographical ordering for coordinates. "Sorted in + order of coordinates" means the obvious extension of this ordering to + sequences of coordinates. + + + NOTE that this method mutates the value of this geometry in-place. + If this is not safe and/or wanted, the geometry should be + cloned prior to normalization. + + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry, using the given . + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + A IComparer<ICoordinateSequence> + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether the two Geometrys are equal, from the point + of view of the EqualsExact method. Called by EqualsExact + . In general, two Geometry classes are considered to be + "equivalent" only if they are the same class. An exception is LineString + , which is considered to be equivalent to its subclasses. + + The Geometry with which to compare this Geometry for equality. + + true if the classes of the two Geometry + s are considered to be equal by the equalsExact method. + + + + + Throws an exception if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + if g is a GeometryCollection, but not one of its subclasses. + + + + + Returns true if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + If g is a GeometryCollection, but not one of its subclasses. + + + + + Returns the minimum and maximum x and y values in this Geometry, + or a null Envelope if this Geometry is empty. + Unlike EnvelopeInternal, this method calculates the Envelope + each time it is called; EnvelopeInternal caches the result + of this method. + + + This Geometrys bounding box; if the Geometry + is empty, Envelope.IsNull will return true. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry having the same class. + + A Geometry having the same class as this Geometry. + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry of the same class. + using the given . + + A Geometry having the same class as this Geometry + The comparer + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the JTS Technical + Specifications + + + + + Returns the first non-zero result of CompareTo encountered as + the two Collections are iterated over. If, by the time one of + the iterations is complete, no non-zero result has been encountered, + returns 0 if the other iteration is also complete. If b + completes before a, a positive number is returned; if a + before b, a negative number. + + A Collection of IComparables. + A Collection of IComparables. + The first non-zero compareTo result, if any; otherwise, zero. + + + + + + + + + + + + + + + + + + + + + A predefined with == . + + + + + + + Gets the factory which contains the context in which this point was created. + + The factory for this point. + + + + Gets/Sets the user data object for this point, if any. + + + A simple scheme for applications to add their own custom data to a Geometry. + An example use might be to add an object representing a Coordinate Reference System. + Note that user data objects are not present in geometries created by + construction methods. + + + + + Sets the ID of the Spatial Reference System used by the Geometry. + + + + NOTE: This method should only be used for exceptional circumstances or + for backwards compatibility. Normally the SRID should be set on the + used to create the geometry. + SRIDs set using this method will not be propagated to + geometries returned by constructive methods. + + + + + + Returns the name of this Geometry's actual class. + + The name of this Geometrys actual class. + + + + Gets the OGC geometry type + + + + + Returns the PrecisionModel used by the Geometry. + + + the specification of the grid of allowable points, for this + Geometry and all other Geometrys. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the number of Geometryes in a GeometryCollection, + or 1, if the geometry is not a collection. + + + + + Tests whether this is simple. + + The SFS definition of simplicity + follows the general rule that a Geometry is simple if it has no points of + self-tangency, self-intersection or other anomalous points. + + Simplicity is defined for each subclass as follows: + + Valid polygonal geometries are simple, since their rings + must not self-intersect. IsSimple + tests for this condition and reports false if it is not met. + (This is a looser test than checking for validity). + Linear rings have the same semantics. + Linear geometries are simple iff they do not self-intersect at points + other than boundary points. + Zero-dimensional geometries (points) are simple iff they have no + repeated points. + Empty Geometrys are always simple. + + + true if this Geometry is simple + + + + + Tests whether this Geometry is topologically + valid, according to the OGC SFS specification. + For validity rules see the documentation for the specific geometry subclass. + + true if this Geometry is valid. + + + + Tests whether the set of points covered in this Geometry is empty. + + true if this Geometry does not cover any points. + + + + Returns the area of this Geometry. + Areal Geometries have a non-zero area. + They override this function to compute the area. + Others return 0.0 + + The area of the Geometry. + + + + Returns the length of this Geometry. + Linear geometries return their length. + Areal geometries return their perimeter. + They override this function to compute the length. + Others return 0.0 + + The length of the Geometry. + + + + Computes the centroid of this Geometry. + The centroid + is equal to the centroid of the set of component Geometries of highest + dimension (since the lower-dimension geometries contribute zero + "weight" to the centroid). + + The centroid of an empty geometry is POINT EMPTY. + + A Point which is the centroid of this Geometry. + + + + Computes an interior point of this Geometry. + + + An interior point is guaranteed to lie in the interior of the Geometry, + if it possible to calculate such a point exactly. Otherwise, + the point may lie on the boundary of the point. + + The interior point of an empty geometry is POINT EMPTY. + + A Point which is in the interior of this Geometry. + + + + + + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the boundary, or an empty geometry of appropriate dimension + if this Geometry is empty. + For a discussion of this function, see the OpenGIS Simple + Features Specification. As stated in SFS Section 2.1.13.1, "the boundary + of a Geometry is a set of Geometries of the next lower dimension." + + The closure of the combinatorial boundary of this Geometry. + NOTE: make abstract, remove setter and change geoapi + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + Gets a geometry representing the envelope (bounding box) of this Geometry. + + If this Geometry is + + empty, returns an empty Point + a point, returns a Point + a line parallel to an axis, a two-vertex LineString, + otherwise, returns a + Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, + maxy), (minx, maxy), (minx, miny). + + + + A Geometry representing the envelope of this Geometry + + + + + + Gets an containing + the minimum and maximum x and y values in this Geometry. + If the geometry is empty, an empty Envelope + is returned. + + + The returned object is a copy of the one maintained internally, + to avoid aliasing issues. + For best performance, clients which access this + envelope frequently should cache the return value. + the envelope of this Geometry. + An empty Envelope if this Geometry is empty + + + + + + + + + + + + + + + Extension Methods for geometries + + + + + Function to encode to an array of s. If assigned, is used. + + The geometry to encode + The writer to use + An array of s, that represent + + + + Delegate function declaration to handle filter operation + + The geometry to filter + + + + An implementation that applies filtering with the provided + + + + + Creates an instance of this class + + The filter method to be used + + + + OGC compliant geometry factory + + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + Note that the factory constructor methods do not change the input coordinates in any way. + In particular, they are not rounded to the supplied PrecisionModel. + It is assumed that input Coordinates meet the given precision. + + + + + A predefined with + == . + + + + + A predefined with + == . + + A shortcut for . + + + + A predefined with + == . + + + + + A predefined with + == . + + + + + + + + + + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. + + + + + Constructs a GeometryFactory that generates Geometries having the given + CoordinateSequence implementation, a double-precision floating PrecisionModel and a + spatial-reference ID of 0. + + + + + Constructs a GeometryFactory that generates Geometries having the given + {PrecisionModel} and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel and spatial-reference ID, and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + The SRID to use. + + + + Constructs a GeometryFactory that generates Geometries having a floating + PrecisionModel and a spatial-reference ID of 0. + + + + + Converts the ICollection to an array. + + The ICollection of Points to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Geometry's to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LinearRings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Polygons to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPoints to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiLineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPolygons to convert. + The ICollection in array format. + + + + Creates a with the same extent as the given envelope. + + + + The Geometry returned is guaranteed to be valid. + To provide this behaviour, the following cases occur: + + + If the Envelope is: +
    +
  • null returns an empty
  • +
  • a point returns a non-empty
  • +
  • a line returns a two-point
  • +
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
  • +
+
+
+ The Envelope + + An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases) + +
+ + + Creates a Point using the given Coordinate. + A null coordinate creates an empty Geometry. + + a Coordinate, or null + A object + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + a CoordinateSequence (possibly empty), or null + A object + + + + Creates a LineString using the given Coordinates. + A null or empty array creates an empty LineString. + + An array without null elements, or an empty array, or null. + A object + + + + Creates a LineString using the given CoordinateSequence. + A null or empty CoordinateSequence creates an empty LineString. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a LinearRing using the given Coordinates; a null or empty array + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A object + If the ring is not closed, or has too few points + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence (possibly empty), or null. + A object + If the ring is not closed, or has too few points + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + A object + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + the created Polygon + If the boundary ring is invalid + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + A object + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + A object + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + an array of Geometries, each of which may be empty but not null, or null + A object + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned.
+ If geomList contains several Polygons, a + MultiPolygon is returned.
+ If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned.
+ If geomList is empty, an empty GeometryCollection + is returned. + Note that this method does not "flatten" Geometries in the input, and hence if + any MultiGeometries are contained in the input a GeometryCollection containing + them will be returned. +
+ The Geometry to combine. + + A of the "smallest", "most type-specific" + class that can contain the elements of geomList. + +
+ + + Creates a deep copy of the input . + The defined for this factory + is used to copy the s + of the input geometry. + + This is a convenient way to change the CoordinateSequence + used to represent a geometry, or to change the + factory used for a geometry. + + can also be used to make a deep copy, + but it does not allow changing the CoordinateSequence type. + + The geometry + A deep copy of the input geometry, using the CoordinateSequence type of this factory + + + + + Returns the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + + + + + + The SRID value defined for this factory. + + + + + Creates an instance of this class using the default + values for , + and + . + + + + + Creates an instance of this class using the default + values for , + , + but the specified . + + + + Creates an instance of this class using the default + values for , + but the + specified . + + + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. +
The are guaranteed to be orientated clockwise. +
+
+ + + Methods to map various collections + of s + via defined mapping functions. + + Martin Davis + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation delegate + A result collection or geometry of most specific type + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation + A result collection or geometry of most specific type + + + + An interface for geometry functions used for mapping. + + Martin Davis + + + + Computes a new geometry value. + + The input geometry + A result geometry + + + + Represents an (1-dimensional) closed interval on the Real number line. + + + + + Creates a new interval instance, setting ==0d; + + + + + Creates a new interval instance, setting = and =; + + The minimum value + The maximum value + + + + Creates a new interval instance, setting = and =. + + + + + + Method to initialize the interval with the given and values.
+ If < , their values are exchanged. +
+ The minimum value + The maximum value +
+ + + Method to expand this interval to contain . + + The interval to contain. + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval R[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval R[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval R[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval R[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Gets or sets a value indicating the minimum value of the closed interval. + + + + + Gets or sets a value indicating the maximum value of the closed interval. + + + + + Gets the width of the interval ( - ) + + + + + Gets the centre of the interval ( + * 0.5d) + + + + + A visitor for s in a index. + + 1.7 + + + + Visits a node. + + The node to visit + + + + A contiguous portion of 1D-space. Used internally by SIRtree. + + + + + + + + + + + + + + + + + + + + + this + + + + + + + this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writes a formatted string containing the KML representation + of a JTS . + The output is KML fragments which can be substituted + wherever the KML abstract + element can be used. + + + Output elements are indented to provide a + nicely-formatted representation. + An output line prefix and maximum + number of coordinates per line can be specified. + + + The Z ordinate value output can be forced to be a specific value. + The and modes can be set. + If set, the corresponding sub-elements will be output. + + + + + The KML standard value clampToGround for use in . + + + + + The KML standard value relativeToGround for use in . + + + + + The KML standard value absolute for use in . + + + + + Writes a Geometry as KML to a string, using + a specified Z value. + + the geometry to write + the Z value to use + a string containing the KML geometry representation + + + + Writes a Geometry as KML to a string, using + a specified Z value, precision, extrude flag, + and altitude mode code. + + the geometry to write + the Z value to use + the maximum number of decimal places to write + the extrude flag to write + the altitude model code to write + a string containing the KML geometry representation + + + + Writes a in KML format as a string. + + the geometry to write + a string containing the KML geometry representation + + + + Writes the KML representation of a to a . + + the geometry to write + the writer to write to + + + + Appends the KML representation of a to a . + + the geometry to write + the buffer to write into + + + + Takes a list of coordinates and converts it to KML. + + + 2D and 3D aware. Terminates the coordinate output with a newline. + + + + + A tag string which is prefixed to every emitted text line. + This can be used to indent the geometry text in a containing document. + + + + + The maximum number of coordinates to output per line. + + + + + The Z value to be output for all coordinates. + This overrides any Z value present in the Geometry coordinates. + + + + + The flag to be output in the extrude element. + + + + + The flag to be output in the tesselate element. + + + + + The value output in the altitudeMode element. + + + + + The maximum number of decimal places to output in ordinate values. + Useful for limiting output size. + + + negative values set the precision to , + like standard behavior. + + + + + Reads a sequence of {@link Geometry}s in WKBHex format + from a text file. + Each WKBHex geometry must be on a single line + The geometries in the file may be separated by any amount + of whitespace and newlines. + + Martin Davis + + + + Creates a new given the + to use to parse the geometries. + + The geometry reader to use + + + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no filename was specified + Thrown if the filename specified does not exist + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no stream was passed + Thrown if passed stream is not readable or seekable + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The stream reader to use. + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Tests if reader has reached limit + + A collection of already read geometries + true if number of geometries has been read. + + + + Tests if reader is at EOF. + + + + + Gets or sets a value indicating the maximum number of geometries to read + + + + + Gets or sets the number of geometries to skip before storing. + + + + + Enumeration for the 3 coordinate planes + + + + + Models a plane in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the oriented distance from a point to the plane.
+ The distance is: + + positive if the point lies above the plane (relative to the plane normal) + zero if the point is on the plane + negative if the point lies below the plane (relative to the plane normal) + +
+ The point to compute the distance for + The oriented distance to the plane +
+ + + Computes the axis plane that this plane lies closest to. + + Geometries lying in this plane undergo least distortion + (and have maximum area) + when projected to the closest axis plane. + This provides optimal conditioning for + computing a Point-in-Polygon test. + + The index of the closest axis plane + + + + Represents a vector in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the dot product of the 3D vectors AB and CD. + + A coordinate + A coordinate + A coordinate + A coordinate + The dot product + + + + Creates a new vector with given , and components. + + The x component + The y component + The z component + A new vector + + + + Creates a new vector from a . + + The coordinate to copy + A new vector + + + + Computes the 3D dot-product of two s + + The 1st vector + The 2nd vector + The dot product of the (coordinate) vectors + + + + Creates a vector, that is the difference of and + + The origin coordinate + The destination coordinate + + + + Creates a vector with the ordinates , and + + The x-ordinate + The y-ordinate + The z-ordinate + + + + Computes the dot-product of this and + + The 2nd vector + The dot product of the vectors + + + + Function to compute the length of this vector + + The length of this vector + + + + Function to compute the length of vector . + + A coordinate, treated as vector + The length of + + + + Function to compute a normalized form of this vector + + A normalized form of this vector + + + + Function to devide all dimensions of this vector by . + + The divisor + A new (divided) vector + + + + Function to compute a normalized form of vector . + + A coordinate vector + A normalized form of + + + + Gets a value indicating the x-ordinate + + + + + Gets a value indicating the y-ordinate + + + + + Gets a value indicating the z-ordinate + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + + + + Processes possible intersections detected by a . + + + + The is passed to a . + + The + method is called whenever the + detects that two s might intersect. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + This class is an example of the Strategy pattern. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + + + This method is called by clients + of the interface to process + intersections for two segments of the s being intersected. + + + + + + + + + Reports whether the client of this class needs to continue testing + all intersections in an arrangement. + + if there is no need to continue testing segments + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Intersects two sets of s using + brute-force comparison. + + + + + An intersector for the red-blue intersection problem. + In this class of line arrangement problem, + two disjoint sets of linestrings are intersected. + + Implementing classes must provide a way + of supplying the base set of segment strings to + test against (e.g. in the constructor, + for straightforward thread-safety). + + In order to allow optimizing processing, + the following condition is assumed to hold for each set: + + the only intersection between any two linestrings occurs at their endpoints. + + Implementations can take advantage of this fact to optimize processing + (i.e by avoiding testing for intersections between linestrings + belonging to the same set). + + + + + Computes the intersections with a given set of s, + using the supplied . + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of base segments. + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Processes all of the segment pairs in the given segment strings + using the given SegmentIntersector. + + A segment string + A segment string + The segment intersector to use + + + + A geometry service provider class + + + + + Creates an instance of this class, using the as default and a precision model. No is specified + + + + + Creates an instance of this class, using the provided , and spatial reference Id (. + + The coordinate sequence factory to use. + The precision model. + The default spatial reference ID + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Gets or sets the current instance + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Gets a value representing the number of geometry factories that have been stored in the cache + + + + + A pair of s, whose leaf items + support a distance metric between them. + Used to compute the distance between the members, + and to expand a member relative to the other + in order to produce new branches of the + Branch-and-Bound evaluation tree. + Provides an ordering based on the distance between the members, + which allows building a priority queue by minimum distance. + + Martin Davis + + + + Creates an instance of this class with the given s and the function. + + The first boundable + The second boundable + The item distance function + + + + Gets one of the member s in the pair + (indexed by [0, 1]). + + The index of the member to return (0 or 1) + The chosen member + + + + Computes the distance between the s in this pair. + The boundables are either composites or leaves. + If either is composite, the distance is computed as the minimum distance + between the bounds. + If both are leaves, the distance is computed by . + + The distance between the s in this pair. + + + + Compares two pairs based on their minimum distances + + + + + For a pair which is not a leaf + (i.e. has at least one composite boundable) + computes a list of new pairs + from the expansion of the larger boundable. + + + + + Gets the minimum possible distance between the Boundables in + this pair. + If the members are both items, this will be the + exact distance between them. + Otherwise, this distance will be a lower bound on + the distances between the items in the members. + + The exact or lower bound distance for this pair + + + + Tests if both elements of the pair are leaf nodes + + + + + An function for + items which are using the method. + + Martin Davis + + + + A function method which computes the distance + between two s in an . + Used for Nearest Neighbour searches. + + Martin Davis + + + + Computes the distance between two items. + + The first item. + The second item. + If the metric is not applicable to the arguments + The distance between and . + + + + Computes the distance between two items, + using the method. + + An item which is a geometry. + An item which is a geometry. + if either item is not a Geometry + The distance between the two items. + + + + Implements extended-precision floating-point numbers + which maintain 106 bits (approximately 30 decimal digits) of precision. + + A DoubleDouble uses a representation containing two double-precision values. + A number x is represented as a pair of doubles, x.hi and x.lo, + such that the number represented by x is x.hi + x.lo, where +
+                |x.lo| <= 0.5*ulp(x.hi)
+            
+ and ulp(y) means "unit in the last place of y". + The basic arithmetic operations are implemented using + convenient properties of IEEE-754 floating-point arithmetic. + + The range of values which can be represented is the same as in IEEE-754. + The precision of the representable numbers + is twice as great as IEEE-754 double precision. + + The correctness of the arithmetic algorithms relies on operations + being performed with standard IEEE-754 double precision and rounding. + This is the Java standard arithmetic model, but for performance reasons + Java implementations are not + constrained to using this standard by default. + Some processors (notably the Intel Pentium architecure) perform + floating point operations in (non-IEEE-754-standard) extended-precision. + A JVM implementation may choose to use the non-standard extended-precision + as its default arithmetic mode. + To prevent this from happening, this code uses the + Java strictfp modifier, + which forces all operations to take place in the standard IEEE-754 rounding model. + + The API provides both a set of value-oriented operations + and a set of mutating operations. + Value-oriented operations treat DoubleDouble values as + immutable; operations on them return new objects carrying the result + of the operation. This provides a simple and safe semantics for + writing DoubleDouble expressions. However, there is a performance + penalty for the object allocations required. + The mutable interface updates object values in-place. + It provides optimum memory performance, but requires + care to ensure that aliasing errors are not created + and constant values are not changed. + + This implementation uses algorithms originally designed variously by + Knuth, Kahan, Dekker, and Linnainmaa. + Douglas Priest developed the first C implementation of these techniques. + Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al. +

References

+ + Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, + in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, + IEEE Computer Society Press, Los Alamitos, Calif., 1991. + Yozo Hida, Xiaoye S. Li and David H. Bailey, + Quad-Double Arithmetic: Algorithms, Implementation, and Application, + manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. + David Bailey, High Precision Software Directory; + http://crd.lbl.gov/~dhbailey/mpdist/index.html + +
+ Martin Davis +
+ + + The value to split a double-precision value on during multiplication + + + + The value nearest to the constant Pi. + + + The value nearest to the constant 2 * Pi. + + + The value nearest to the constant Pi / 2. + + + + The value nearest to the constant e (the natural logarithm base). + + + + + A value representing the result of an operation which does not return a valid number. + + + + + The smallest representable relative difference between two values + + + + + Converts the string argument to a DoubleDouble number. + + A string containing a representation of a numeric value + The extended precision version of the value + Thrown if is not a valid representation of a number + + + Converts the double argument to a DoubleDouble number. + + @param x a numeric value + @return the extended precision version of the value + + + The high-order component of the double-double precision value. + + + The low-order component of the double-double precision value. + + + + Creates a new with value x. + + The initial value + + + + Creates a new with value (hi, lo). + + The high order component + The low order component + + + + Creates a with a value equal to the argument + + The initial value + + + Creates a new DoubleDouble with value equal to the argument. + + @param str the value to initialize by + @throws NumberFormatException if str is not a valid representation of a number + + + + Creates a new with the value of the argument. + + The value to copy + A copy of + + + + Creates and returns a copy of this value. + + Acopy of this value + + + + Returns a whose value is (this + ) + + The addende"/> + (this + ) + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns a whose value is (this + y). + + The addend + (this + y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Returns a whose value is -this. + + -this + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + ** + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + ** + + + Returns a DoubleDouble whose value is 1 / this. + + @return the reciprocal of this value + + + + Computes the minimum of this and another DD number. + + A DD number + The minimum of the two numbers + + + + Computes the maximum of this and another DD number. + + A DD number + The maximum of the two numbers + + + + + + Returns an integer indicating the sign of this value. + + + if this value is > 0, returns 1 + if this value is < 0, returns -1 + if this value is = 0, returns 0 + if this value is NaN, returns 0 + + + + An integer indicating the sign of this value + + + + Rounds this value to the nearest integer. + The value is rounded to an integer by adding 1/2 and taking the floor of the result. + Special cases: + + If this value is NaN, returns NaN. + + + This value rounded to the nearest integer + + + + Returns the integer which is largest in absolute value and not further + from zero than this value. + + Special cases: + + If this value is NaN, returns NaN. + + + + The integer which is largest in absolute value and not further from zero than this value + + + + + Returns the absolute value of this value. + + Special cases: + + if this value is NaN, it is returned. + + + The absolute value of this value + + + + Computes the square of this value. + + The square of this value + + + + Computes the square of this value. + + The square of this value. + + + Computes the positive square root of this value. + If the number is NaN or negative, NaN is returned. + + @return the positive square root of this number. + If the argument is NaN or less than zero, the result is NaN. + + + + Computes the value of this number raised to an integral power. + Follows semantics of .Net Math.Pow as closely as possible. + + The integer exponent + x raised to the integral power exp + + + Converts this value to the nearest double-precision number. + + @return the nearest double-precision number to this value + + + Converts this value to the nearest integer. + + @return the nearest integer to this value + + + + Gets a value indicating whether this object is positive or not + + + + + Gets a value indicating whether this object is positive or not + + + + Tests whether this value is equal to another DoubleDouble value. + + @param y a DoubleDouble value + @return true if this value = y + + + Tests whether this value is greater than another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value > y + + + Tests whether this value is greater than or equals to another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value >= y + + + + Tests whether this value is less than another DoubleDouble value. + + A DoubleDouble value + true if this value is < + + + + Compares two DoubleDouble objects numerically. + + @return -1,0 or 1 depending on whether this value is less than, equal to + or greater than the value of o + + + + Dumps the components of this number to a string. + + A string showing the components of the number + + + + Returns a string representation of this number, in either standard or scientific notation. + If the magnitude of the number is in the range [ 10-3, 108 ] + standard notation will be used. Otherwise, scientific notation will be used. + + A string representation of this number + + + + Returns the string representation of this value in standard notation. + + The string representation in standard notation + + + + Returns the string representation of this value in scientific notation. + + The string representation in scientific notation + + + Extracts the significant digits in the decimal representation of the argument. + A decimal point may be optionally inserted in the string of digits + (as long as its position lies within the extracted digits + - if not, the caller must prepend or append the appropriate zeroes and decimal point). + + @param y the number to extract ( >= 0) + @param decimalPointPos the position in which to insert a decimal point + @return the string containing the significant digits and possibly a decimal point + + + + Returns the string for this value if it has a known representation (e.g. NaN or 0.0). + + The string for this special number
+ or null if the number is not a special number
+
+ + + Determines the decimal magnitude of a number. + The magnitude is the exponent of the greatest power of 10 which is less than + or equal to the number. + + The number to find the magnitude of + The decimal magnitude of + + + + Converts a string representation of a real number into a DoubleDouble value. + The format accepted is similar to the standard Java real number syntax. + It is defined by the following regular expression: +
+            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
+            
+
+ The string to parse + The value of the parsed number + Thrown if str is not a valid representation of a number +
+ + + Gets a value indicating whether this object is zero (0) or not + + + + + Gets a value indicating whether this object is negative or not + + + + + Various utility functions for mathematical and numerical operations. + + + + + Clamps a double value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Clamps a int value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Computes the base-10 logarithm of a double value. + + + If the argument is NaN or less than zero, then the result is NaN. + If the argument is positive infinity, then the result is positive infinity. + If the argument is positive zero or negative zero, then the result is negative infinity. + + + + A positive number + The value log a, the base-10 logarithm of the input value + + + + + Computes the average of two numbers. + + A number + A number + The average of the inputs + + + + Computes the maximum fo three values + + A number + A number + A number + The maximum value of , and + + + + Computes the maximum of four values + + A number + A number + A number + A number + The maximum value of , , and + + + + Computes the minimum of four values + + A number + A number + A number + The minimum value of , and + + + + Computes the minimum of four values + + A number + A number + A number + A number + The minimum value of , , and + + + + Implements some 2D matrix operations + (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination. + In order to avoid overhead the algorithm runs in-place + on - if should not be modified the client must supply a copy. + + An nxn matrix in row/column order )modified by this method) + A vector of length n + A vector containing the solution (if any)
or null if the system has no or no unique solution +
+ If the matrix has the wrong size +
+ + + A 2-dimensional mathematical vector represented by double-precision X and Y components. + + mbdavis + + + + Creates a new vector with given X and Y components. + + The x component + The y component + A new vector + + + + Creates a new vector from an existing one. + + The vector to copy + A new vector + + + + Creates a vector from a . + + The coordinate to copy + A new vector + + + Creates a vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + A new vector + + + The X component of this vector. + + + The Y component of this vector. + + + + Creates an new vector instance + + + + + Creates a new vector instance using the provided and ordinates + + The x-ordinate value + The y-ordinate value + + + + Creates a new vector instance based on . + + The vector + + + Creates a new vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + + + + Creates a vector from a . + + The coordinate + A new vector + + + + Adds to this vector instance. + + The vector to add + The result vector + + + + Subtracts from this vector instance + + The vector to subtract + The result vector + + + + Multiplies the vector by a scalar value. + + The value to multiply by + A new vector with the value v * d + + + + Divides the vector by a scalar value. + + The value to divide by + A new vector with the value v / d + + + + Negates this vector + + A new vector with [-_x, -_y] + + + + + + + + + + + + + + + + Normalizes the vector + + A new normalized vector + + + + + + + + + + + Computes the weighted sum of this vector + with another vector, + with this vector contributing a fraction + of frac to the total. + + In other words, +
+            sum = frac * this + (1 - frac) * v
+            
+
+ The vector to sum + The fraction of the total contributed by this vector + The weighted sum of the two vectors +
+ + + Computes the distance between this vector and another one. + + A vector + The distance between the vectors + + + + Computes the dot-product of two vectors + + A vector + The dot product of the vectors + + + + Computes the angle this vector describes to the horizontal axis + + The angle + + + + + + + + + + + + + + + + + + Rotates this vector by + + The angle + The rotated vector + + + + Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 + degrees or Pi/2 radians). A positive number rotates counter-clockwise, a + negative number rotates clockwise. Under this operation the magnitude of + the vector and the absolute values of the ordinates do not change, only + their sign and ordinate index. + + The number of quarter-circles to rotate by + The rotated vector. + + + + + + + + + + + Gets a made of this vector translated by . + + The translation coordinate + A coordinate + + + + Gets a from this vector + + A coordinate + + + + Creates a copy of this vector + + A copy of this vector + + + + Gets a string representation of this vector + + A string representing this vector + + + + Tests if a vector has the same values for the x and y components. + + A with which to do the comparison. + true if is a with the same values for the X and Y components. + + + + Gets a hashcode for this vector. + + A hashcode for this vector + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + + Functions for performing vector mathematics. + + + + + Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each + triangle coordinate must have a Z value. If this is not the case, the returned Coordinate + will have NaN values. The returned vector has unit length. + + A point + A point + A point + The normal vector to the triangle -- + + + + Normalizes the vector + + The normalized + + + + Computes the cross product of and + + A vector + A vector + The cross product of and + + + + Computes the dot product of and + + A vector + A vector + The dot product of and + + + + Computes the determinant of a 2x2 matrix + + The m[0,0] value + The m[0,1] value + The m[1,0] value + The m[1,1] value + The determinant + + + + Helper class for transforming objects. + + + + + Transforms a object. + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Densifies a geometry by inserting extra vertices along the line segments + contained in the geometry. + All segments in the created densified geometry will be no longer than + than the given distance tolerance. + + + Densified polygonal geometries are guaranteed to be topologically correct. + The coordinates created during densification respect the input geometry's . + Note: At some future point this class will offer a variety of densification strategies. + + Martin Davis + + + + Densifies a geometry using a given distance tolerance, and respecting the input geometry's . + + The geometry densify + The distance tolerance () + The densified geometry + + + + Densifies a coordinate sequence. + + The coordinate sequence to densify + The distance tolerance () + The precision model to apply on the new coordinates + The densified coordinate sequence + + + Creates a new densifier instance + The geometry to densify + + + + Gets the densified geometry. + + The densified geometry + + + + Gets or sets the distance tolerance for the densification. All line segments + in the densified geometry will be no longer than the distance tolereance. + Simplified geometry will be within this distance of the original geometry. + The distance tolerance must be positive. + + + + + A framework for processes which transform an input Geometry into + an output , possibly changing its structure and type(s). + + + + This class is a framework for implementing subclasses + which perform transformations on + various different Geometry subclasses. + + + It provides an easy way of applying specific transformations + to given point types, while allowing unhandled types to be simply copied. + Also, the framework handles ensuring that if subcomponents change type + the parent geometries types change appropriately to maintain valid structure. + Subclasses will override whichever TransformX methods + they need to to handle particular Geometry types. + + + A typically usage would be a transformation that may transform Polygons into + Polygons, LineStrings or Points, depending on the geometry of the input + (For instance, a simplification operation). + This class would likely need to override the + method to ensure that if input Polygons change type the result is a GeometryCollection, + not a MultiPolygon. + + The default behaviour of this class is simply to recursively transform + each Geometry component into an identical object by deep copying down + to the level of, but not including, coordinates. + + + Note that all TransformXXX methods may return null, + to avoid creating empty point objects. This will be handled correctly + by the transformer. TransformXXX methods should always return valid + geometry - if they cannot do this they should return null + (for instance, it may not be possible for a transformLineString implementation + to return at least two points - in this case, it should return null). + The method itself will always + return a non-null Geometry object (but this may be empty). + > + + + + + + + + + true if empty geometries should not be included in the result. + + + + + true if a homogenous collection result + from a GeometryCollection should still + be a general GeometryCollection. + + + + + true if the type of the input should be preserved. + + + + + + + + + + + + Convenience method which provides standard way of + creating a CoordinateSequence. + + The coordinate array to copy. + A coordinate sequence for the array. + + + + Convenience method which provides statndard way of copying {CoordinateSequence}s + + The sequence to copy. + A deep copy of the sequence. + + + + Transforms a . + This method should always return a valid coordinate list for + the desired result type. (E.g. a coordinate list for a LineString + must have 0 or at least 2 points). + If this is not possible, return an empty sequence - + this will be pruned out. + + The coordinates to transform + The parent geometry + The transformed coordinates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Makes the input geometry available + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections + A valid area geometry + + + + Stores all attributes associated with a single Geometry feature. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the names + + + + + + + + + + + + + + + + + + + + + + + + Returns a string array containing + all names of present attributes. + + + + + + Returns a object array containing + all values of present attributes. + + + + + + Verifies if attribute specified already exists. + + + + + + + Build a field with the given value and add it to attributes table. + + Name of the new attribute. + Value for attribute (can be null). + If attribute already exists. + + + + Delete the specified attribute from the table. + + + + + + Return the System.Type of the specified attribute, + useful for casting values retrieved with GetValue methods. + + + + + + + Get the value of the specified attribute. + + + + + + + Set the value of the specified attribute. + + + + + + + + + + + + Get / Set the value of the specified attribute. + + + + + + + Feature class + + + + + + + + + + + + + + + + + Geometry representation of the feature. + + + + + Attributes table of the feature. + + + + + Angle orientation + + + + Constant representing no orientation + + + Constant representing straight orientation + + + Constant representing counterclockwise orientation + + + Constant representing left orientation + + + Constant representing clockwise orientation + + + Constant representing right orientation + + + + Utility functions for working with angles. + Unless otherwise noted, methods in this class express angles in radians. + + + + + Converts from radians to degrees. + + An angle in radians + The angle in degrees + + + + Converts from degrees to radians. + + An angle in degrees + The angle in radians + + + + Returns the angle of the vector from p0 to p1, relative to the positive X-axis. + + The angle is normalized to be in the range [ -Pi, Pi ]. + The start-point + The end-point + The normalized angle (in radians) that p0-p1 makes with the positive X-axis + + + + Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. + + + The angle is normalized to be in the range ( -Pi, Pi ]. + + The point + The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. + + + + Tests whether the angle between p0-p1-p2 is acute. + + + An angle is acute if it is less than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Tests whether the angle between p0-p1-p2 is obtuse + + + An angle is obtuse if it is greater than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Returns the unoriented smallest angle between two vectors. + + + The computed angle will be in the range [0, Pi). + + The tip of one vector + The tail of each vector + The tip of the other vector + + + + Returns the oriented smallest angle between two vectors. + The computed angle will be in the range (-Pi, Pi]. + A positive result corresponds to a rotation (CCW) from v1 to v2; + a negative result corresponds to a (CW) rotation; + a zero result corresponds to no rotation. + + The tip of v1 + The tail of each vector + The tip of v2 + The angle between v1 and v2, relative to v1 + + + + Computes the interior angle between two segments of a ring. + The ring is assumed to be oriented in a clockwise direction. + + The computed angle will be in the range [0, 2Pi] + A point of the ring + The next point of the ring + The next point of the ring + The interior angle based at p1 + + + + Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. + + An angle (in radians) + An angle (in radians) + Whether a1 must turn , or to overlap a2. + + + + Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. + + The angle to normalize + An equivalent angle in the range (-Pi, Pi] + + + + Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). + + E.g. + + + NormalizePositive(0.0) = 0.0 + NormalizePositive(-PI) = + NormalizePositive(-2PI) = 0.0 + NormalizePositive(-3PI) = + NormalizePositive(-4PI) = 0 + NormalizePositive(PI) = + NormalizePositive(2PI) = 0.0 + NormalizePositive(3PI) = + NormalizePositive(4PI) = 0.0 + + + + + The angle to normalize, in radians. + An equivalent positive angle + + + + Computes the unoriented smallest difference between two angles. + + + + The angles are assumed to be normalized to the range [-Pi, Pi]. + The result will be in the range [0, Pi]. + + + The angle of one vector (in [-Pi, Pi] ) + The angle of the other vector (in range [-Pi, Pi] ) + The angle (in radians) between the two vectors (in range [0, Pi] ) + + + + Useful utility functions for handling Coordinate arrays. + + + + + Tests whether an array of s forms a ring, by checking length and closure. + Self-intersection is not checked. + + An array of Coordinates + true if the coordinate form a ring. + + + + Finds a in a list of s + which is not contained in another list of s. + + The s to test. + An array of s to test the input points against. + + A from + which is not in , or null. + + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + + + + Determines which orientation of the array is (overall) increasing. + In other words, determines which end of the array is "smaller" + (using the standard ordering on ). + Returns an integer indicating the increasing direction. + If the sequence is a palindrome, it is defined to be + oriented in a positive direction. + + The array of Coordinates to test. + + 1 if the array is smaller at the start or is a palindrome, + -1 if smaller at the end. + + + + + Determines whether two arrays of equal length + are equal in opposite directions. + + + + + + + + Creates a deep copy of the argument Coordinate array. + + Array of Coordinates. + Deep copy of the input. + + + + Creates a deep copy of a given section of a source array into a destination Coordinate array. + The destination array must be an appropriate size to receive the copied coordinates. + + An array of Coordinates + The index to start copying from + The array to receive the deep-copied coordinates + The destination index to start copying to + The number of items to copy + + + + Converts the given of + s into a array. + + of coordinates. + + + If contains not only s. + + + + + Converts the given of + s into a array. + + of coordinates. + + + + + Returns whether Equals returns true for any two consecutive + coordinates in the given array. + + Array of Coordinates. + true if coord has repeated points; false otherwise. + + + + Returns either the given coordinate array if its length is greater than + the given amount, or an empty coordinate array. + + Length amount. + Array of Coordinates. + New Coordinate array. + + + + If the coordinate array argument has repeated points, + constructs a new array containing no repeated points. + Otherwise, returns the argument. + + + + + + + Collapses a coordinate array to remove all null elements. + + The coordinate array to collapse + An Array containing only non-null elements + + + + Reverses the coordinates in an array in-place. + + Array of Coordinates. + + + + Returns true if the two arrays are identical, both null, or pointwise + equal (as compared using Coordinate.Equals). + + First array of Coordinates. + Second array of Coordinates. + true if two Coordinates array are equals; false otherwise + + + + Returns true if the two arrays are identical, both null, or pointwise + equal, using a user-defined + for s. + + An array of s. + Another array of s. + + A for s. + + + + + + Returns the minimum coordinate, using the usual lexicographic comparison. + + Array to search. + The minimum coordinate in the array, found using CompareTo. + + + + Shifts the positions of the coordinates until firstCoordinate is first. + + Array to rearrange. + Coordinate to make first. + + + + Returns the index of in . + The first position is 0; the second is 1; etc. + + A to search for. + A array to search. + The position of coordinate, or -1 if it is not found. + + + + Extracts a subsequence of the input array + from indices to (inclusive). + The input indices are clamped to the array size; + If the end index is less than the start index, + the extracted array will be empty. + + The input array. + The index of the start of the subsequence to extract. + The index of the end of the subsequence to extract. + A subsequence of the input array. + + + + Computes the of the coordinates. + + the array to scan. + the of the . + + + Extracts the coordinates which intersect an {@link Envelope}. + + @param coordinates the coordinates to scan + @param env the envelope to intersect with + @return an array of the coordinates which intersect the envelope + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + Compares the specified s arrays. + + + + + + + + A comparator for arrays modulo their directionality. + E.g. if two coordinate arrays are identical but reversed + they will compare as equal under this ordering. + If the arrays are not equal, the ordering returned + is the ordering in the forward direction. + + + + + A backed by an array of s. + This is the implementation that s use by default. + + Coordinates returned by , and are live -- + modifications to them are actually changing the + CoordinateSequence's underlying data. + A dimension may be specified for the coordinates in the sequence, + which may be 2 or 3. + The actual coordinates will always have 3 ordinates, + but the dimension is useful as metadata in some situations. + + + + The actual dimension of the coordinates in the sequence. + Allowable values are 2 or 3. + + + + Constructs a sequence based on the given array of s. + The coordinate dimension is 3 + + + The array is not copied. + + The coordinate array that will be referenced. + + + + Constructs a sequence based on the given array + of s. + + The Array is not copied + The coordinate array that will be referenced. + The dimension of the coordinates + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Constructs a sequence of a given , populated + with new s of the given . + + The size of the sequence to create. + the dimension of the coordinates + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Get the Coordinate with index i. + + The index of the coordinate. + The requested Coordinate instance. + + + + Get a copy of the Coordinate with index i. + + The index of the coordinate. + A copy of the requested Coordinate. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Creates a deep copy of the object. + + The deep copy. + + + + + + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + This method exposes the internal Array of Coordinate Objects. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the string representation of the coordinate array. + + + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the length of the coordinate sequence. + + + + + Creates CoordinateSequences represented as an array of Coordinates. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Returns the singleton instance of CoordinateArraySequenceFactory. + + + + + A list of Coordinates, which may + be set to prevent repeated coordinates from occuring in the list. + + + + + Constructs a new list without any coordinates + + + + + Constructs a new list from an array of Coordinates, allowing repeated points. + (I.e. this constructor produces a with exactly the same set of points + as the input array.) + + Initial coordinates + + + + Constructs a new list from a collection of Coordinates, + allows repeated points. + + Collection of coordinates to load into the list. + + + + Constructs a new list from a collection of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Collection of coordinates to load into the list. + If false, repeated points are removed. + + + + Constructs a new list from an array of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Array of coordinates to load into the list. + If false, repeated points are removed. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Adds a section of an array of coordinates to the list. + + The coordinates + If set to false, repeated coordinates are collapsed + The index to start from + The index to add up to but not including + true (as by general collection contract) + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + If false, the array is added in reverse order. + Return true. + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the list. + + Coordinate to be inserted, as object. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the end of this list. + + Coordinate to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if all ok. + + + + Inserts the specified coordinate at the specified position in this list. + + The position at which to insert + the coordinate to insert + if set to false, repeated coordinates are collapsed + + + + Add an array of coordinates. + + Coordinates collection to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if at least one element has added (IList not empty). + + + + Ensure this coordList is a ring, by adding the start point if necessary. + + + + + Returns the Coordinates in this collection. + + Coordinater as Coordinate[] array. + + + + Returns a deep copy of this collection. + + The copied object. + + + + Compares two s. + + + For sequences of the same dimension, the ordering is lexicographic. + Otherwise, lower dimensions are sorted before higher. + The dimensions compared can be limited; if this is done + ordinate dimensions above the limit will not be compared. + + + If different behaviour is required for comparing size, dimension, + or coordinate values, any or all methods can be overridden. + + + + + Compare two doubles, allowing for NaN values. + NaN is treated as being less than any valid number. + + A double + A double + -1, 0, or 1 depending on whether a is less than, equal to or greater than b + + + The number of dimensions to test + + + Creates a comparator which will test all dimensions. + + + + + @param dimensionLimit + Creates a comparator which will test only the specified number of dimensions. + The number of dimensions to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 + + + + Compares the same coordinate of two s + + A coordinate sequence + A coordinate sequence + The index of the coordinate to test + the number of dimensiosn to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 + + + + Utility functions for manipulating s. + + + + + Reverses the coordinates in a sequence in-place. + + + + + + Swaps two coordinates in a sequence. + + seq the sequence to modify + the index of a coordinate to swap + the index of a coordinate to swap + + + + Copies a section of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinates from + The starting index of the coordinates to copy + The sequence to which the coordinates should be copied to + The starting index of the coordinates in + The number of coordinates to copy + + + + Copies a coordinate of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinate from + The index of the coordinate to copy + The sequence to which the coordinate should be copied to + The index of the coordinate in + + + + Tests whether a forms a valid , + by checking the sequence length and closure + (whether the first and last points are identical in 2D). + Self-intersection is not checked. + + The sequence to test + True if the sequence is a ring + + + + + Ensures that a CoordinateSequence forms a valid ring, + returning a new closed sequence of the correct length if required. + If the input sequence is already a valid ring, it is returned + without modification. + If the input sequence is too short or is not closed, + it is extended with one or more copies of the start point. + + The CoordinateSequenceFactory to use to create the new sequence + The sequence to test + The original sequence, if it was a valid ring, or a new sequence which is valid. + + + + Tests whether two s are equal. + To be equal, the sequences must be the same length. + They do not need to be of the same dimension, + but the ordinate values for the smallest dimension of the two + must be equal. + Two NaN ordinates values are considered to be equal. + + a CoordinateSequence + a CoordinateSequence + true if the sequences are equal in the common dimensions + + + + Creates a string representation of a . + The format is: + + ( ord0,ord1.. ord0,ord1,... ... ) + + + the sequence to output + the string representation of the sequence + + + + The CoordinateSequence implementation that Geometries use by default. In + this implementation, Coordinates returned by ToArray and GetCoordinates are live -- + parties that change them are actually changing the + DefaultCoordinateSequence's underlying data. + + + + + Constructs a DefaultCoordinateSequence based on the given array (the + array is not copied). + + Coordinate array that will be assimilated. + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns a copy of the coordinate at specified index. + + Coordinate index. + The copy of the coordinate specified. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns a deep copy of the object passed. + + The copied object. + + + + This method exposes the internal Array of Coordinate Objects. + + Coordinate[] array. + + + + Returns the string Representation of the coordinate array + + A string. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns the elements number of the coordinate sequence. + + + + + + Returns the elements number of the coordinate sequence. + + The length. + + + + Creates CoordinateSequences internally represented + as an array of x's and an array of y's. + + + + + + + + + + Returns a DefaultCoordinateSequence based on the given array + (the array is not copied). + + Coordinates array, which may not be null + nor contain null elements + Singleton instance of DefaultCoordinateSequenceFactory. + + + + Returns the singleton instance of DefaultCoordinateSequenceFactory. + + Singleton instance of DefaultCoordinateSequenceFactory. + + + + A coordinate sequence that follows the dotspatial shape range + + + + + Creates an instance of this class + + The + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The number of dimensions. + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The kind of ordinates. + + + + Creates a sequence based on the given coordinate sequence. + + The coordinate sequence. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Releases the weak reference to the weak referenced coordinate array + + This is necessary if you modify the values of the , , arrays externally. + + + + Gets the vector with x- and y-ordinate values; + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with z-ordinate values + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with measure values + + If you modify the values of this vector externally, you need to call ! + + + + A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, + and can be set. + + A coordinate sequence. + + + + Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. + + + + + + Gets the Ordinate flags that sequences created by this factory can cope with. + + + + + Basic implementation of GeometryCollection. + + + + + Represents an empty GeometryCollection. + + + + + Internal representation of this GeometryCollection. + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + For create this is used a standard + with == . + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a GeometryCollectionEnumerator: + this IEnumerator returns the parent geometry as first element. + In most cases is more useful the code + geometryCollectionInstance.Geometries.GetEnumerator(): + this returns an IEnumerator over geometries composing GeometryCollection. + + + + + + Creates a with + every component reversed. + The order of the components in the collection are not reversed. + + A in the reverse order + + + + + + + + + Collects all coordinates of all subgeometries into an Array. + Note that while changes to the coordinate objects themselves + may modify the Geometries in place, the returned Array as such + is only a temporary container which is not synchronized back. + + The collected coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "GeometryCollection" + + + + Gets the OGC geometry type + + + + + + + + + + Returns the area of this GeometryCollection. + + + + + Returns the length of this GeometryCollection. + + + + + Return true if all features in collection are of the same type. + + + + + Returns the iTh element in the collection. + + + + + + + Returns the number of geometries contained by this . + + + + + Iterates over all Geometry's in a GeometryCollection. + Implements a pre-order depth-first traversal of the GeometryCollection + (which may be nested). The original GeometryCollection is + returned as well (as the first object), as are all sub-collections. It is + simple to ignore the GeometryCollection objects if they are not + needed. + + + + + The GeometryCollection being iterated over. + + + + + Indicates whether or not the first element (the GeometryCollection) + has been returned. + + + + + The number of Geometrys in the the GeometryCollection. + + + + + The index of the Geometry that will be returned when next + is called. + + + + + The iterator over a nested GeometryCollection, or null + if this GeometryCollectionIterator is not currently iterating + over a nested GeometryCollection. + + + + + Constructs an iterator over the given GeometryCollection. + + + The collection over which to iterate; also, the first + element returned by the iterator. + + + + + + + + + + + + + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + + + The parent GeometryCollection is the first object returned! + + + + Models an OGC SFS LinearRing. + + + A LinearRing is a which is both closed and simple. + In other words, + the first and last coordinate in the ring must be equal, + and the interior of the ring must not self-intersect. + Either orientation of the ring is allowed. + + A ring must have either 0 or 4 or more points. + The first and last points must be equal (in 2D). + If these conditions are not met, the constructors throw + an + + + + + Models an OGC-style LineString + + + A LineString consists of a sequence of two or more vertices, + along with all points along the linearly-interpolated curves + (line segments) between each + pair of consecutive vertices. + Consecutive vertices may be equal. + The line segments in the line may intersect each other (in other words, + the linestring may "curl back" in itself and self-intersect. + Linestrings with exactly two identical points are invalid. + A linestring must have either 0 or 2 or more points. + If these conditions are not met, the constructors throw an . + + + + + + Represents an empty LineString. + + + + + The points of this LineString. + + + + + + + + + + + + + + + + + + + Creates a whose coordinates are in the reverse order of this objects. + + A with coordinates in the reverse order. + + + + Returns true if the given point is a vertex of this LineString. + + The Coordinate to check. + true if pt is one of this LineString's vertices. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalizes a LineString. A normalized linestring + has the first point which is not equal to it's reflected point + less than the reflected point. + + + + + + + + + + + + Initializes a new instance of the class. + + + For create this is used a standard + with == . + + The coordinates used for create this . + If too few points are provided + + + + Initializes a new instance of the class. + + + The points of the linestring, or null + to create the empty point. Consecutive points may not be equal. + + + If too few points are provided + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "LineString" + + + + Returns the length of this LineString + + The length of the polygon. + + + + + + + + + + + + + + + + + Returns the value of the angle between the + and the . + + + + + The minimum number of vertices allowed in a valid non-empty ring (= 4). + Empty rings with 0 vertices are also valid. + + + + + Constructs a LinearRing with the given points. + + + Points forming a closed and simple linestring, or + null or an empty array to create the empty point. + This array must not contain null elements. + + + If the ring is not closed, or has too few points + + + + + + + + + Initializes a new instance of the class. + + The points used for create this instance. + + For create this is used a standard + with == . + + If the ring is not closed, or has too few points + + + + Returns Dimensions.False, since by definition LinearRings do not have a boundary. + + + + + Returns the name of this object's interface. + + "LinearRing" + + + + Represents a line segment defined by two Coordinates. + Provides methods to compute various geometric properties + and relationships of line segments. + This class is designed to be easily mutable (to the extent of + having its contained points public). + This supports a common pattern of reusing a single LineSegment + object as a way of computing segment properties on the + segments defined by arrays or lists of Coordinates. + + + + + Creates an instance of this class using two coordinates + + The start-point + The end-point + + + + Creates an instance of this class using another instance + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the orientation of a LineSegment relative to this segment. + The concept of orientation is specified as follows: + Given two line segments A and L, + A is to the left of a segment L if A lies wholly in the + closed half-plane lying to the left of L + A is to the right of a segment L if A lies wholly in the + closed half-plane lying to the right of L + otherwise, A has indeterminate orientation relative to L. This + happens if A is collinear with L or if A crosses the line determined by L. + + The LineSegment to compare. + + 1 if seg is to the left of this segment, + -1 if seg is to the right of this segment, + 0 if seg is collinear to or crosses this segment. + + + + + Determines the orientation index of a relative to this segment. + The orientation index is as defined in . + + + + + 1 if p is to the left of this segment + -1 if p is to the right of this segment + 0 if p is collinear with this segment + " + + + + + + Reverses the direction of the line segment. + + + + + Puts the line segment into a normalized form. + This is useful for using line segments in maps and indexes when + topological equality rather than exact equality is desired. + + + + + Computes the distance between this line segment and another one. + + + + + + + Computes the distance between this line segment and a point. + + + + + Computes the perpendicular distance between the (infinite) line defined + by this line segment and a point. + + + + + + + Computes the that lies a given + fraction along the line defined by this segment. + + + A fraction of 0.0 returns the start point of the segment; + A fraction of 1.0 returns the end point of the segment. + If the fraction is < 0.0 or > 1.0 the point returned + will lie before the start or beyond the end of the segment. + + the fraction of the segment length along the line + the point at that distance + + + + Computes the that lies a given + + + A fraction along the line defined by this segment and offset from + the segment by a given distance. + A fraction of 0.0 offsets from the start point of the segment; + A fraction of 1.0 offsets from the end point of the segment. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + + the fraction of the segment length along the line + the distance the point is offset from the segment + (positive is to the left, negative is to the right) + the point at that distance and offset + if the segment has zero length + + + Computes the Projection Factor for the projection of the point p + onto this LineSegment. The Projection Factor is the constant r + by which the vector for this segment must be multiplied to + equal the vector for the projection of p on the line + defined by this segment. + + The projection factor will lie in the range (-inf, +inf), + or be NaN if the line segment has zero length. + + The point to compute the factor for + The projection factor for the point + + + + Computes the fraction of distance (in [0.0, 1.0]) + that the projection of a point occurs along this line segment. + If the point is beyond either ends of the line segment, + the closest fractional value (0.0 or 1.0) is returned. + + + Essentially, this is the clamped to + the range [0.0, 1.0]. + + the point + the fraction along the line segment the projection of the point occurs + + + + Compute the projection of a point onto the line determined + by this line segment. + Note that the projected point may lie outside the line segment. + If this is the case, the projection factor will lie outside the range [0.0, 1.0]. + + + + + + + Project a line segment onto this line segment and return the resulting + line segment. The returned line segment will be a subset of + the target line line segment. This subset may be null, if + the segments are oriented in such a way that there is no projection. + Note that the returned line may have zero length (i.e. the same endpoints). + This can happen for instance if the lines are perpendicular to one another. + + The line segment to project. + The projected line segment, or null if there is no overlap. + + + + Computes the closest point on this line segment to another point. + + The point to find the closest point to. + + A Coordinate which is the closest point on the line segment to the point p. + + + + + Computes the closest points on a line segment. + + + + A pair of Coordinates which are the closest points on the line segments. + + + + + Computes an intersection point between two segments, if there is one. + There may be 0, 1 or many intersection points between two segments. + If there are 0, null is returned. If there is 1 or more, a single one + is returned (chosen at the discretion of the algorithm). If + more information is required about the details of the intersection, + the {RobustLineIntersector} class should be used. + + A line segment + An intersection point, or null if there is none. + + + + + Computes the intersection point of the lines defined by two segments, if there is one. + + + There may be 0, 1 or an infinite number of intersection points between two lines. + If there is a unique intersection point, it is returned. + Otherwise, null is returned. + If more information is required about the details of the intersection, + the class should be used. + + A line segment defining a straight line + An intersection point, or null if there is none or an infinite number + + + + + Creates a LineString with the same coordinates as this segment + + the geometery factory to use + A LineString with the same geometry as this segment + + + + Returns true if o has the same values for its points. + + A LineSegment with which to do the comparison. + + true if o is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + + + + + + + + + + Compares this object with the specified object for order. + Uses the standard lexicographic ordering for the points in the LineSegment. + + + The LineSegment with which this LineSegment + is being compared. + + + A negative integer, zero, or a positive integer as this LineSegment + is less than, equal to, or greater than the specified LineSegment. + + + + + Returns true if other is + topologically equal to this LineSegment (e.g. irrespective + of orientation). + + + A LineSegment with which to do the comparison. + + + true if other is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + Return HashCode. + + + + + The end-point + + + + + The start-point + + + + + Gets the minimum X ordinate + + + + + Gets the maximum X ordinate + + + + + Gets the minimum Y ordinate + + + + + Gets the maximum Y ordinate + + + + + Computes the length of the line segment. + + The length of the line segment. + + + + Tests whether the segment is horizontal. + + true if the segment is horizontal. + + + + Tests whether the segment is vertical. + + true if the segment is vertical. + + + + The angle this segment makes with the x-axis (in radians). + + + + The midpoint of the segment + + + + Basic implementation of MultiLineString. + + + + + Represents an empty MultiLineString. + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + For create this is used a standard + with == . + + + + + Creates a in the reverse order to this object. + Both the order of the component LineStrings + and the order of their coordinate sequences are reversed. + + a in the reverse order. + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiLineString" + + + + Gets the OGC geometry type + + + + + Gets a value indicating whether this instance is closed. + + true if this instance is closed; otherwise, false. + + + + Models a collection of Points. + + + + + Represents an empty MultiPoint. + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + For create this is used a standard + with == . + + + + + + + + + + + + + Returns the Coordinate at the given position. + + The index of the Coordinate to retrieve, beginning at 0. + + The nth Coordinate. + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPoint" + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + Basic implementation of MultiPolygon. + + + + + Represents an empty MultiPolygon. + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + For create this is used a standard + with == . + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + + + + + + + + + + + Creates a {@link MultiPolygon} with every component reversed. + + The order of the components in the collection are not reversed. + An in the reverse order + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPolygon" + + + + + + + + + A bounding container for a which is in the shape of a general octagon. + + + The OctagonalEnvelope of a geometric object + is a geometry which is tight bound along the (up to) four extremal rectilineal parallels + and along the (up to) four extremal diagonal parallels. + Depending on the shape of the contained + geometry, the octagon may be degenerate to any extreme + (e.g. it may be a rectangle, a line, or a point). + + + + + Gets the octagonal envelope of a geometry + + The geometry + The octagonal envelope of the geometry + + + + Creates a new null bounding octagon + + + + + Creates a new null bounding octagon bounding a + + The coordinate to bound + + + + Creates a new null bounding octagon bounding a pair of s + + A coordinate to bound + A coordinate to bound + + + + Creates a new null bounding octagon bounding an + + + + + Creates a new null bounding octagon bounding an + (the copy constructor). + + + + + Creates a new null bounding octagon bounding a + + + + + Sets the value of this object to the null value + + + + + Tests if the extremal values for this octagon are valid. + + @return true if this object has valid values + + + + + A CoordinateSequence implementation based on a packed arrays. + A CoordinateSequence implementation based on a packed arrays. + + + + + A soft reference to the Coordinate[] representation of this sequence. + Makes repeated coordinate array accesses more efficient. + + + + + The dimensions of the coordinates hold in the packed array + + + + + The ordinates + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + + A copy of the i'th coordinate in the sequence + + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. + Note that if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + + + + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the first ordinate of a coordinate in this sequence. + + + + + + + Sets the second ordinate of a coordinate in this sequence. + + + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on doubles. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on floats. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked: + if it is over dimensions you may not get an exception but a meaningless value. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Builds packed array coordinate sequences. The array data type can be either + double or float, and defaults to double. + + + + + Initializes a new instance of the class, + using double values. + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + + + + + + Returns a CoordinateSequence based on the given array; whether or not the + array is copied is implementation-dependent. + + Coordinates array, which may not be null nor contain null elements + + + + + Returns a CoordinateSequence based on the given coordinate sequence; whether or not the + array is copied is implementation-dependent. + + + + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates + + The ordinates each coordinate has. is fix, and can be set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a single point. + + A Point is topologically valid if and only if: + + The coordinate which defines it if any) is a valid coordinate + (i.e. does not have an NaN X- or Y-ordinate + + + + + + + Represents an empty Point. + + + + + The Coordinate wrapped by this Point. + + + + + Initializes a new instance of the class. + + The coordinate used for create this . + + For create this is used a standard + with == . + + + + + Constructs a Point with the given coordinate. + + + Contains the single coordinate on which to base this Point, + or null to create the empty point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + The z coordinate. + /// + For create this is used a standard + with set to . + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + /// + For create this is used a standard + with set to . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Point" + + + + Gets the OGC geometry type + + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + + + + + + Represents a polygon with linear edges, which may include holes. + The outer boundary (shell) + and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. + The boundary rings of the polygon may have any orientation. + Polygons are closed, simple geometries by definition. + + The polygon model conforms to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + A Polygon is topologically valid if and only if: + + the coordinates which define it are valid coordinates + the linear rings for the shell and holes are valid + (i.e. are closed and do not self-intersect) + holes touch the shell or another hole at at most one point + (which implies that the rings of the shell and holes must not cross) + the interior of the polygon is connected, + or equivalently no sequence of touching holes + makes the interior of the polygon disconnected + (i.e. effectively split the polygon into two pieces). + + + + + + Represents an empty Polygon. + + + + + The exterior boundary, or null if this Polygon + is the empty point. + + + + + The interior boundaries, if any. + + + + + Initializes a new instance of the class. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + For create this is used a standard + with == . + + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Polygon" + + + + Returns the area of this Polygon + + + + + + Returns the perimeter of this Polygon. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the precision model of the Coordinates in a Geometry. + In other words, specifies the grid of allowable + points for all Geometrys. + + + The MakePrecise method allows rounding a coordinate to + a "precise" value; that is, one whose + precision is known exactly. + Coordinates are assumed to be precise in geometries. + That is, the coordinates are assumed to be rounded to the + precision model given for the point. + NTS input routines automatically round coordinates to the precision model + before creating Geometries. + All internal operations + assume that coordinates are rounded to the precision model. + Constructive methods (such as bool operations) always round computed + coordinates to the appropriate precision model. + Currently three types of precision model are supported: + + Floating: represents full double precision floating point. + This is the default precision model used in NTS + FloatingSingle: represents single precision floating point. + Fixed: represents a model with a fixed number of decimal places. + + A Fixed Precision Model is specified by a scale factor. + The scale factor specifies the size of the grid which numbers are rounded to. + Input coordinates are mapped to fixed coordinates according to the following + equations: + + jtsPt.x = round( (inputPt.x * scale ) / scale + jtsPt.y = round( (inputPt.y * scale ) / scale + + + For example, to specify 3 decimal places of precision, use a scale factor + of 1000. To specify -3 decimal places of precision (i.e. rounding to + the nearest 1000), use a scale factor of 0.001. + + Coordinates are represented internally as Java double-precision values. + Since .NET uses the IEEE-394 floating point standard, this + provides 53 bits of precision. (Thus the maximum precisely representable + integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). + + NTS binary methods currently do not handle inputs which have different precision models. + The precision model of any constructed geometric value is undefined. + + + + + The maximum precise value representable in a double. Since IEE754 + double-precision numbers allow 53 bits of mantissa, the value is equal to + 2^53 - 1. This provides almost 16 decimal digits of precision. + + + + + Determines which of two s is the most precise + + A precision model + A precision model + The PrecisionModel which is most precise + + + + The type of PrecisionModel this represents. + + + + + The scale factor which determines the number of decimal places in fixed precision. + + + + + Creates a PrecisionModel with a default precision + of Floating. + + + + + Creates a PrecisionModel that specifies + an explicit precision model type. + If the model type is Fixed the scale factor will default to 1. + + + The type of the precision model. + + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate + + Not used. + Not used. + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate. + + + + + Copy constructor to create a new PrecisionModel + from an existing one. + + + + + + Return HashCode. + + + + + Sets internal to the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the + precise representation of external. + + + + + Returns the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the precise + representation of external + + + + + Returns the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Sets external to the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Rounds a numeric value to the PrecisionModel grid. + Symmetric Arithmetic Rounding is used, to provide + uniform rounding behaviour no matter where the number is + on the number line. + + + This method has no effect on NaN values + + + + + + Rounds a Coordinate to the PrecisionModel grid. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compares this PrecisionModel object with the specified object for order. + A PrecisionModel is greater than another if it provides greater precision. + The comparison is based on the value returned by the + {getMaximumSignificantDigits) method. + This comparison is not strictly accurate when comparing floating precision models + to fixed models; however, it is correct when both models are either floating or fixed. + + + The PrecisionModel with which this PrecisionModel + is being compared. + + + A negative integer, zero, or a positive integer as this PrecisionModel + is less than, equal to, or greater than the specified PrecisionModel. + + + + + + + + + + + + Tests whether the precision model supports floating point. + + true if the precision model supports floating point. + + + + Returns the maximum number of significant digits provided by this + precision model. + Intended for use by routines which need to print out precise values. + + + The maximum number of decimal places provided by this precision model. + + + + + Returns the scale factor used to specify a fixed precision model. + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + The scale factor for the fixed precision model + + + + + Gets the type of this PrecisionModel. + + + + + + Returns the x-offset used to obtain a precise coordinate. + + + The amount by which to subtract the x-coordinate before + multiplying by the scale. + + + + + Returns the y-offset used to obtain a precise coordinate. + + + The amount by which to subtract the y-coordinate before + multiplying by the scale + + + + + A base class containing the logic for computes the contains + and covers spatial relationship predicates + for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + Contains and covers are very similar, and differ only in how certain + cases along the boundary are handled. These cases require + full topological evaluation to handle, so all the code in + this class is common to both predicates. + + + It is not possible to short-circuit in all cases, in particular + in the case where line segments of the test geometry touches the polygon linework. + In this case full topology must be computed. + (However, if the test geometry consists of only points, this + can be evaluated in an optimized fashion. + + + Martin Davis + + + + A base class for predicate operations on s. + + mbdavis + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether all components of the test Geometry are contained in the target geometry. + + Handles both linear and point components. + A geometry to test + + true if all componenta of the argument are contained in the target geometry + + + + + Tests whether all components of the test Geometry are contained in the interior of the target geometry. + + Handles both linear and point components. + A geometry to test + true if all componenta of the argument are contained in the target geometry interior + + + + Tests whether any component of the test Geometry intersects the area of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry + + + + Tests whether any component of the test Geometry intersects the interior of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry interior + + + + Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) + + The test geometry + The representative points of the target geometry + true if any component intersects the areal test geometry + + + This flag controls a difference between contains and covers. + + For contains the value is true. + For covers the value is false. + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Evaluate the contains or covers relationship + for the given geometry. + + the test geometry + true if the test geometry is contained + + + + Tests whether a geometry consists of a single polygon with no holes. + + True if the geometry is a single polygon with no holes + + + + Computes the full topological predicate. + Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon has the relationship with the test geometry + + + + A base class for subclasses. + + + Contains default implementations for methods, which simply delegate to the equivalent methods. + This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. + + Martin Davis + + + + Tests whether any representative of the target geometry intersects the test geometry. + This is useful in A/A, A/L, A/P, L/P, and P/P cases. + + The test geometry + true if any component intersects the areal test geometry + + + + Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. + + A geometry + true if the envelopes intersect + + + + Determines whether the envelope of this geometry covers the Geometry g. + + A geometry + true if g is contained in this envelope + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + Default implementation. + + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + Default implementation. + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + Default implementation. + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + Default implementation. + + + + Tests whether the base is disjoint from given geometry. + + The geometry to test + true if this geometry is disjoint from the given geometry + + Default implementation. + + + + Tests whether the base intersects a given geometry. + + The geometry to test + true if this geometry intersects the given geometry + + Default implementation. + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + Default implementation. + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + Default implementation. + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + Default implementation. + + + + Gets the list of representative points for this geometry. + One vertex is included for every component of the geometry + (i.e. including one for every ring of polygonal geometries). + + Do not modify the returned list! + + + + + A factory for creating s. It chooses an appropriate implementation of PreparedGeometry + based on the geoemtric type of the input geometry. + + + In the future, the factory may accept hints that indicate + special optimizations which can be performed. + + Martin Davis + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + mbdavis + + + + Computes the intersects spatial relationship predicate + for a target relative to other classes. + + + Uses short-circuit tests and indexing to improve performance. + + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared linestring + A test geometry + true if the linestring intersects the geometry + + + + Creates an instance of this operation. + + The target PreparedLineString + + + + Tests whether this geometry intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Tests whether any representative point of the test Geometry intersects + the target geometry. + + + Only handles test geometries which are Puntal (dimension 0) + + A Puntal geometry to test + true if any point of the argument intersects the prepared geometry + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + Martin Davis + + + + Tests whether this point intersects a . + + + The optimization here is that computing topology for the test geometry + is avoided. This can be significant for large geometries. + + + + + A prepared version for geometries. + This class supports both s and s. + This class does not support MultiPolygons which are non-valid + (e.g. with overlapping elements). + + + Instances of this class are thread-safe and immutable. + + mbdavis + + + + Computes the contains spatial relationship predicate for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + It is not possible to short-circuit in all cases, in particular + in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + + Martin Davis + + + + Computes the contains spatial relationship predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon contains the geometry + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon contains a given geometry. + + The test geometry + true if the test geometry is contained + + + + Computes the full topological contains predicate.
+ Used when short-circuit tests are not conclusive. +
+ The test geometry + true if this prepared polygon contains the test geometry +
+ + + Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
+ Uses short-circuit tests and indexing to improve performance. +
+ + + A Geometry A containsProperly another Geometry B iff + all points of B are contained in the Interior of A. + Equivalently, B is contained in A AND B does not intersect + the Boundary of A. + + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + In a situation with many geometries intersecting the boundary + of the target geometry, this can make a performance difference. + + + Martin Davis +
+ + Computes the containsProperly predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon properly contains the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon containsProperly a given geometry. + + The test geometry + true if the polygon properly contains the geometry + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + + Uses short-circuit tests and indexing to improve performance. + + It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + Martin Davis + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + The prepared polygon + A test geometry + true if the polygon covers the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon covers a given geometry. + + The test geometry + true if the test geometry is covered + + + + Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon covers the test geometry + + + + Computes the intersects spatial relationship predicate + for s relative to all other classes. + + Uses short-circuit tests and indexing to improve performance. + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared polygon + A test geometry + true if the polygon intersects the geometry + + + + Creates an instance of this operation. + + The prepared polygon + + + + Tests whether this PreparedPolygon intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Indicates an invalid or inconsistent topological situation encountered during processing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a planar triangle, and provides methods for calculating various + properties of triangles. + + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + + Tests whether a triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 degrees. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + True if the triangle is acute. + + + + Computes the line which is the perpendicular bisector of the + + A point + Another point + The perpendicular bisector, as an HCoordinate line segment a-b. + + + Computes the circumcentre of a triangle. + + The circumcentre is the centre of the circumcircle, + the smallest circle which encloses the triangle. + It is also the common intersection point of the + perpendicular bisectors of the sides of the triangle, + and is the only point which has equal distance to all three + vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. For example, + the circumcentre of an obtuse isoceles triangle lies outside the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The circumcentre of the triangle + + + + Computes the determinant of a 2x2 matrix. Uses standard double-precision + arithmetic, so is susceptible to round-off error. + + the [0,0] entry of the matrix + the [0,1] entry of the matrix + the [1,0] entry of the matrix + the [1,1] entry of the matrix + The determinant + + + + Computes the incentre of a triangle. + + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + It is also the point at which the bisectors of the triangle's angles meet. + It is the centre of the triangle's InCircle, which is the unique circle + that is tangent to each of the triangle's three sides. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point which is the incentre of the triangle + + + Computes the centroid (centre of mass) of a triangle. + + This is also the point at which the triangle's three + medians intersect (a triangle median is the segment from a vertex of the triangle to the + midpoint of the opposite side). + The centroid divides each median in a ratio of 2:1. + The centroid always lies within the triangle. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The centroid of the triangle + + + Computes the length of the longest side of a triangle + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The length of the longest side of the triangle + + + Computes the point at which the bisector of the angle ABC cuts the segment AC. + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The angle bisector cut point + + + + Computes the 2D area of a triangle. + The area value is always non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + Computes the signed 2D area of a triangle. + + + + The area value is positive if the triangle is oriented CW, + and negative if it is oriented CCW. + + + The signed area value can be used to determine point orientation, but + the implementation in this method is susceptible to round-off errors. + Use for robust orientation + calculation. + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + + Computes the 3D area of a triangle. + The value computed is alway non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The 3D area of the triangle + + + + Computes the Z-value (elevation) of an XY point + on a three-dimensional plane defined by a triangle + whose vertices have Z-values. + The defining triangle must not be degenerate + (in other words, the triangle must enclose a + non-zero area), + and must not be parallel to the Z-axis. + + This method can be used to interpolate + the Z-value of a point inside a triangle + (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + The computed Z-value (elevation) of the point + + + + Creates a new triangle with the given vertices. + + A vertex + A vertex + A vertex + + + + Computes the InCentre of this triangle + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + This is also the point at which the bisectors of the angles meet. + It is the centre of the triangle's InCircle, + which is the unique circle that is tangent to each of the triangle's three sides. + + + The point which is the InCentre of the triangle. + + + + + Tests whether this triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 + degrees. + + true if this triangle is acute + + + + Computes the circumcentre of this triangle. The circumcentre is the centre + of the circumcircle, the smallest circle which encloses the triangle. It is + also the common intersection point of the perpendicular bisectors of the + sides of the triangle, and is the only point which has equal distance to + all three vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + The circumcentre of this triangle + + + + Computes the centroid (centre of mass) of this triangle. This is also the + point at which the triangle's three medians intersect (a triangle median is + the segment from a vertex of the triangle to the midpoint of the opposite + side). The centroid divides each median in a ratio of 2:1. + + The centroid always lies within the triangle. + + The centroid of this triangle + + + + Computes the length of the longest side of this triangle + + The length of the longest side of this triangle + + + + Computes the 2D area of this triangle. The area value is always + non-negative. + + The area of this triangle + + + + + Computes the signed 2D area of this triangle. The area value is positive if + the triangle is oriented CW, and negative if it is oriented CCW. + + The signed area value can be used to determine point orientation, but the + implementation in this method is susceptible to round-off errors. Use + + for robust orientation calculation. + + The signed 2D area of this triangle + + + + + Computes the 3D area of this triangle. The value computed is alway + non-negative. + + The 3D area of this triangle + + + + Computes the Z-value (elevation) of an XY point on a three-dimensional + plane defined by this triangle (whose vertices must have Z-values). This + triangle must not be degenerate (in other words, the triangle must enclose + a non-zero area), and must not be parallel to the Z-axis. + + This method can be used to interpolate the Z-value of a point inside this + triangle (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + The computed Z-value (elevation) of the point + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + Represents an affine transformation on the 2D Cartesian plane. + + + + It can be used to transform a or . + An affine transformation is a mapping of the 2D plane into itself + via a series of transformations of the following basic types: +
    +
  • reflection (through a line)
  • +
  • rotation (around the origin)
  • +
  • scaling (relative to the origin)
  • +
  • shearing (in both the X and Y directions)
  • +
  • translation
  • +
+
+ + In general, affine transformations preserve straightness and parallel lines, + but do not preserve distance or shape. + + + An affine transformation can be represented by a 3x3 + matrix in the following form: +
+            T = | m00 m01 m02 |
+                | m10 m11 m12 |
+                |  0   0   1  |
+            
+ A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') + by representing it as a 3x1 matrix and using matrix multiplication to compute: +
+            | x' |  = T x | x |
+            | y' |        | y |
+            | 1  |        | 1 |
+            
+
+

Transformation Composition

+ + Affine transformations can be composed using the method. + Composition is computed via multiplication of the + transformation matrices, and is defined as: +
+            A.compose(B) = TB x TA
+            
+
+ + This produces a transformation whose effect is that of A followed by B. + The methods , , + , , and + have the effect of composing a transformation of that type with + the transformation they are invoked on. + The composition of transformations is in general not commutative. + +

Transformation Inversion

+ + Affine transformations may be invertible or non-invertible. + If a transformation is invertible, then there exists + an inverse transformation which when composed produces + the identity transformation. + The method + computes the inverse of a transformation, if one exists. + + + @author Martin Davis + +
+
+ + + Creates a transformation for a reflection about the + line (x0,y0) - (x1,y1). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + the x-ordinate of a another point on the reflection line + the y-ordinate of a another point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a reflection about the + line (0,0) - (x,y). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a rotation + about the origin + by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + a transformation for the rotation + + + + Creates a transformation for a rotation + by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a scaling relative to the origin. + + the value to scale by in the x direction + the value to scale by in the y direction + a transformation for the scaling + + + + Creates a transformation for a scaling relative to the point (x,y). + + The value to scale by in the x direction + The value to scale by in the y direction + The x-ordinate of the point to scale around + The y-ordinate of the point to scale around + A transformation for the scaling + + + + Creates a transformation for a shear. + + the value to shear by in the x direction + the value to shear by in the y direction + a tranformation for the shear + + + + Creates a transformation for a translation. + + the value to translate by in the x direction + the value to translate by in the y direction + a tranformation for the translation + + + + Constructs a new identity transformation + + + + + Constructs a new transformation whose + matrix has the specified values. + + an array containing the 6 values { m00, m01, m02, m10, m11, m12 } + if matrix is null + if matrix is too small + + + + Constructs a new transformation whose + matrix has the specified values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + + + + Constructs a transformation which is + a copy of the given one. + + the transformation to copy + + + + Constructs a transformation + which maps the given source + points into the given destination points. + + source point 0 + source point 1 + source point 2 + the mapped point for source point 0 + the mapped point for source point 1 + the mapped point for source point 2 + + + + Sets this transformation to be the identity transformation. + + + The identity transformation has the matrix: +
+            | 1 0 0 |
+            | 0 1 0 |
+            | 0 0 1 |
+            
+
+ this transformation, with an updated matrix +
+ + + Sets this transformation's matrix to have the given values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + this transformation, with an updated matrix + + + + Sets this transformation to be a copy of the given one + + a transformation to copy + this transformation, with an updated matrix + + + + Computes the inverse of this transformation, if one + exists. + + + + * The inverse is the transformation which when + * composed with this one produces the identity + * transformation. + * A transformation has an inverse if and only if it + * is not singular (i.e. its + * determinant is non-zero). + * Geometrically, an transformation is non-invertible + * if it maps the plane to a line or a point. + * If no inverse exists this method + * will throw a . + + + * The matrix of the inverse is equal to the + * inverse of the matrix for the transformation. + * It is computed as follows: + *
+            *                 1
+            * inverse(A)  =  ---   x  adjoint(A)
+            *                det
+            *
+            *
+            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
+            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
+            *                det      |  0     0     m00*m11-m10*m01  |
+            *
+            *
+            *
+            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
+            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
+            *               |   0           0          1               |
+            *
+            * 
+
+
+ A new inverse transformation + + +
+ + + Explicitly computes the math for a reflection. May not work. + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection + about the line defined by vector (x,y). + + + The transformation for a reflection + is computed by: +
+            d = sqrt(x2 + y2)
+            sin = x / d;
+            cos = x / d;
+            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
+            
+
+ the x-component of the reflection line vector + the y-component of the reflection line vector + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the orign. + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle theta + has the value: +
+            |  cos(theta)  -sin(theta)   0 |
+            |  sin(theta)   cos(theta)   0 |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the origin + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   0 |
+            |  sinTheta   cosTheta   0 |
+            |         0          0   1 |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y). + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y) + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |         0          0         1       |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a scaling. + + + The transformation matrix for a scale + has the value: +
+            |  xScale      0  dx |
+            |  1      yScale  dy |
+            |  0           0   1 |
+            
+
+ the amount to scale x-ordinates by + the amount to scale y-ordinates by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a shear. + + + The transformation matrix for a shear + has the value: +
+            |  1      xShear  0 |
+            |  yShear      1  0 |
+            |  0           0  1 |
+            
+ Note that a shear of (1, 1) is not + equal to shear(1, 0) composed with shear(0, 1). + Instead, shear(1, 1) corresponds to a mapping onto the + line x = y. +
+ the x component to shear by + the y component to shear by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a translation. + + + For a translation by the vector (x, y) + the transformation matrix has the value: +
+            |  1  0  dx |
+            |  1  0  dy |
+            |  0  0   1 |
+            
+
+ the x component to translate by + the y component to translate by + this transformation, with an updated matrix +
+ + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of the line to reflect around + the y-ordinate of the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation transformation composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by in radians + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around the origin composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a scale transformation composed + with the current value. + + the value to scale by in the x direction + the value to scale by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a shear transformation composed + with the current value. + + the value to shear by in the x direction + the value to shear by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a translation transformation composed + with the current value. + + the value to translate by in the x direction + the value to translate by in the y direction + this transformation, with an updated matrix + + + + Updates this transformation to be + the composition of this transformation with the given . + + + This produces a transformation whose effect + is equal to applying this transformation + followed by the argument transformation. + Mathematically, +
+            A.compose(B) = TB x TA
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Updates this transformation to be the composition + of a given with this transformation. + + + This produces a transformation whose effect + is equal to applying the argument transformation + followed by this transformation. + Mathematically, +
+            A.composeBefore(B) = TA x TB
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Applies this transformation to the coordinate + and places the results in the coordinate + (which may be the same as the source). + + the coordinate to transform + the coordinate to accept the results + the dest coordinate + + + + + Cretaes a new which is the result of this transformation applied to the input Geometry. + + A Geometry + The transformed Geometry + + + + Applies this transformation to the i'th coordinate + in the given CoordinateSequence. + + a CoordinateSequence + the index of the coordinate to transform + + + + Transforms the i'th coordinate in the input sequence + + A CoordinateSequence + The index of the coordinate to transform + + + + Tests if an object is an AffineTransformation and has the same matrix as this transformation. + + An object to test + true if the given object is equal to this object + + + + Gets a text representation of this transformation. + The string is of the form: + + AffineTransformation[[m00, m01, m02], [m10, m11, m12]] + + + A string representing this transformation + + + + Clones this transformation + + A copy of this transformation + + + + Gets an array containing the entries + of the transformation matrix. + + + Only the 6 non-trivial entries are returned, + in the sequence: +
+            m00, m01, m02, m10, m11, m12
+            
+
+ an array of length 6 +
+ + + Computes the determinant of the transformation matrix. + + + + The determinant is computed as: +
+             | m00 m01 m02 |
+             | m10 m11 m12 | = m00 * m11 - m01 * m10
+             |  0   0   1  |
+             
+
+ + If the determinant is zero, + the transform is singular (not invertible), + and operations which attempt to compute + an inverse will throw a . + +
+ the determinant of the transformation + + + The determinant of the transformation + +
+ + + Reports that this filter should continue to be executed until + all coordinates have been transformed. + + false + + + Tests if this transformation is the identity transformation. + + + + Builds an defined by a set of control vectors. + + + + A control vector consists of a source point and a destination point, + which is the image of the source point under the desired transformation. + + + A transformation is well-defined + by a set of three control vectors + if and only if the source points are not collinear. + (In particular, the degenerate situation + where two or more source points are identical will not produce a well-defined transformation). + A well-defined transformation exists and is unique. + If the control vectors are not well-defined, the system of equations + defining the transformation matrix entries is not solvable, + and no transformation can be determined. + + No such restriction applies to the destination points. + However, if the destination points are collinear or non-unique, + a non-invertible transformations will be generated. + + + This technique of recovering a transformation + from its effect on known points is used in the Bilinear Interpolated Triangulation + algorithm for warping planar surfaces. + + + Martin Davis + + + + Constructs a new builder for the transformation defined by the given set of control point mappings. + + A control point + A control point + A control point + The image of under the required transformation + The image of under the required transformation + The image of under the required transformation + + + + Computes the + determined by the control point mappings, + or null if the control vectors do not determine a well-defined transformation. + + + + An affine transformation + null if the control vectors do not determine a well-defined transformation. + + + + + + Computes the transformation matrix by + solving the two systems of linear equations + defined by the control point mappings, + if this is possible. + + True if the transformation matrix is solvable + + + + Solves the transformation matrix system of linear equations + for the given right-hand side vector. + + The vector for the right-hand side of the system + The solution vector, if it can be determinated, otherwise null + + + + Supports creating s defined by various kinds of inputs and transformation mapping rules. + + Martin Davis + + + + Creates a tranformation from a set of three control vectors. A control + vector consists of a source point and a destination point, which is the + image of the source point under the desired transformation. Three control + vectors allows defining a fully general affine transformation. + + + + + + + + The computed transformation + + + + Creates an AffineTransformation defined by a pair of control vectors. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. The + computed transformation is a combination of one or more of a uniform scale, + a rotation, and a translation (i.e. there is no shear component and no + reflection) + + + + + + The computed transformation + null if the control vectors do not determine a well-defined transformation + + + + Creates an AffineTransformation defined by a single control vector. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. This + produces a translation. + + The start point of the control vector + The end point of the control vector + The computed transformation + + + + Creates an AffineTransformation defined by a set of control vectors. + Between one and three vectors must be supplied. + + The source points of the vectors + The destination points of the vectors + The computed transformation + if the control vector arrays are too short, long or of different lengths + + + + Creates an AffineTransformation defined by a maping between two baselines. + The computed transformation consists of: + + a translation from the start point of the source baseline to the start point of the destination baseline, + a rotation through the angle between the baselines about the destination start point, + and a scaling equal to the ratio of the baseline lengths. + + If the source baseline has zero length, an identity transformation is returned. + + The start point of the source baseline + The end point of the source baseline + The start point of the destination baseline + The end point of the destination baseline + + + + + Extracts a single representative from each connected component of a . + + 1.9 + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The Geometry from which to extract + A list of Coordinates + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + Maps the members of a + into another GeometryCollection via a defined + mapping function. + + Martin Davis + + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + Combines s to produce a of the most appropriate type. + + + Input geometries which are already collections will have their elements extracted first. + No validation of the result geometry is performed. + (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). + + mbdavis + + + + Combines a collection of geometries. + The geometries to combine + The combined geometry + + + + Combines two geometries. + + A geometry to combine + A geometry to combine + The combined geometry + + + + Combines three geometries. + + A geometry to combine + A geometry to combine + A geometry to combine + The combined geometry + + + + Creates a list from two items + + + + A list from two geometries + + + + Creates a list from three items + + + + + A list from three geometries + + + + Creates a new combiner for a collection of geometries + + The geometries to combine + + + + Extracts the GeometryFactory used by the geometries in a collection + + + a GeometryFactory + + + + Computes the combination of the input geometries to produce the most appropriate or + + A Geometry which is the combination of the inputs + + + + + Value indicating whether empty geometries should be skipped + + + + + A class which supports creating new s + which are modifications of existing ones, + maintaining the same type structure. + + + Geometry objects are intended to be treated as immutable. + This class allows you to "modifies" a Geometrys + by traversing them, applying a user-defined + , or + and creating a new Geometrys with the same structure but + (possibly) modified components. + + Examples of the kinds of modifications which can be made are: + + + The values of the coordinates may be changed. + The editor does not check whether changing coordinate values makes the result Geometry invalid + + + The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). + The modifed coordinate lists must be consistent with their original parent component + (e.g. a LinearRing must always have at least 4 coordinates, and the first and last + coordinate must be equal). + + + Components of the original point may be deleted + (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). + Deletions will be propagated up the component tree appropriately. + + + + All changes must be consistent with the original Geometry's structure + (e.g. a Polygon cannot be collapsed into a LineString). + If changing the structure is required, use a . + + + This class supports creating an edited Geometry + using a different via the + constructor. + Examples of situations where this is required is if the geometry is + transformed to a new SRID and/or a new PrecisionModel. + + Usage notes + + The resulting Geometry is not checked for validity. + If validity needs to be enforced, the new Geometry's + method should be called. + By default the UserData of the input geometry is not copied to the result. + + + + + + + + + The factory used to create the modified Geometry. + + + If null the GeometryFactory of the input is used. + + + + + Creates a new GeometryEditor object which will create + edited with the same as the input Geometry. + + + + + Creates a new GeometryEditor object which will create + edited s with the given . + + The GeometryFactory to create the edited Geometry with. + + + + Edit the input Geometry with the given edit operation. + Clients can create subclasses of GeometryEditorOperation or + CoordinateOperation to perform required modifications. + + The Geometry to edit. + The edit operation to carry out. + A new Geometry which is the result of the editing (which may be empty). + + + + Gets or sets a value indicating if the User Data is copied to the edit result. + If so, only the object reference is copied. + + + + + A interface which specifies an edit operation for Geometries. + + + + + Edits a Geometry by returning a new Geometry with a modification. + The returned Geometry may be the input geometry itself. + It may be null if the geometry is to be deleted. + + The Geometry to modify. + + The factory with which to construct the modified Geometry + (may be different to the factory of the input point). + + A new Geometry which is a modification of the input Geometry. + null if the Geometry is to be deleted completely + + + + A GeometryEditorOperation which does not modify + the input geometry. + This can be used for simple changes of + (including PrecisionModel and SRID). + + mbdavis + + + + A GeometryEditorOperation which edits the coordinate list of a Geometry. + Operates on Geometry subclasses which contains a single coordinate list. + + + + + + + + + + + + + Edits the array of Coordinates from a Geometry. + + The coordinate array to operate on. + The point containing the coordinate list. + An edited coordinate array (which may be the same as the input). + + + + A which edits the + of a . + + Operates on Geometry subclasses which contains a single coordinate list. + + + + An edited coordinate sequence (which may be the same as the input) + + + + Extracts the components of a given type from a . + + + + + Extracts the T components from an and adds them to the provided . + + the geometry from which to extract + the list to add the extracted elements to + The geometry type to extract + + + + Extracts the T elements from a single and returns them in a . + + the geometry from which to extract + + + + Extracts the components of type T from a . + + + + + Constructs a filter with a list in which to store the elements found. + + The list to extract into + + + + Extracts all the 1-dimensional () components from a . + For polygonal geometries, this will extract all the component s. + If desired, s can be forced to be returned as s. + + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single point. + If more than one point is to be processed, it is more + efficient to create a single LineExtracterFilter instance + and pass it to multiple geometries. + + The point from which to extract linear components. + The list of linear components. + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The geometry from which to extract linear components + true if s should be converted to s + The list of linear components + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + true if s should be converted to s + A linear geometry + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single + and adds them to the. + + The geometry from which to extract + The list to add the extracted elements to + The list argument + + + + Extracts the elements from a single + and returns them in a . + + The geometry from which to extract + A list containing the linear elements + + + + Extracts the elements from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Constructs a filter with a list in which to store the elements found. + + + + + Implements some 2D matrix operations (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination.
+ In order to avoid overhead the algorithm runs in-place + on A - if A should not be modified the client must supply a copy. +
+ A an nxn matrix in row/column order )modified by this method) + A vector of length n + if the matrix is the wrong size + + + A vector containing the solution (if any) + null if the system has no or no unique solution + + +
+ + + Indicates that an is non-invertible. + + Martin Davis + + + + Extracts all the 0-dimensional (Point) components from a Geometry. + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + the geometry from which to extract + + + + Constructs a PointExtracterFilter with a list in which to store Points found. + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + The geometry from which to extract + + + + Constructs a PolygonExtracterFilter with a list in which to store Polygons found. + + + + + + + + + + + + A visitor to elements which componets, which + allows short-circuiting when a defined condition holds. + + + + + + + + + + + + + + + + + + + + + + + A Depth object records the topological depth of the sides + of an Edge for up to two Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Depth object is null (has never been initialized) if all depths are null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalize the depths for each point, if they are non-null. + A normalized depth + has depth values in the set { 0, 1 }. + Normalizing the depths + involves reducing the depths by the same amount so that at least + one of them is 0. If the remaining value is > 0, it is set to 1. + + + + + + + + + + + Calls GetDepth and SetDepth. + + + + + + + + + + + + + Models the end of an edge incident on a node. + + + + EdgeEnds have a direction determined by the direction of the ray from the initial + point to the next point. + + + EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". + This ordering is used to sort EdgeEnds around a node. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the total order relation: + a has a greater angle with the positive x-axis than b. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is obviously susceptible to roundoff. + A robust algorithm is: + - first compare the quadrant. If the quadrants + are different, it it trivial to determine which vector is "greater". + - if the vectors lie in the same quadrant, the computeOrientation function + can be used to decide the relative orientation of the vectors. + + + + + + Subclasses should override this if they are using labels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes the factor for the change in depth when moving from one location to another. + E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. + + + + + + + + + + The depth of each side (position) of this edge. + The 0 element of the array is never used. + + + + + + + + + + + + + + + + + + + + + + + + + + Compute the label in the appropriate orientation for this DirEdge. + + + + + Set both edge depths. + One depth for a given side is provided. + The other is computed depending on the Location + transition and the depthDelta of the edge. + + + + + + + Set both edge depths. One depth for a given side is provided. The other is + computed depending on the Location transition and the depthDelta of the edge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VisitedEdge get property returns true if bot Visited + and Sym.Visited are true. + VisitedEdge set property marks both DirectedEdges attached to a given Edge. + This is used for edges corresponding to lines, which will only + appear oriented in a single direction in the result. + + + + + + + + + + + + + + + + + + + + + + + + + This edge is a line edge if + at least one of the labels is a line label + any labels which are not line labels have all Location = Exterior. + + + + + This is an interior Area edge if + its label is an Area label for both Geometries + and for each Geometry both sides are in the interior. + + true if this is an interior Area edge. + + + + A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. + It supports labelling the edges as well as linking the edges to form both + MaximalEdgeRings and MinimalEdgeRings. + + + + + A EdgeEndStar is an ordered list of EdgeEnds around a node. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + A map which maintains the edges in sorted order around the node. + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + The location of the point for this star in Geometry i Areas. + + + + + Insert a EdgeEnd into this EdgeEndStar. + + + + + + Insert an EdgeEnd into the map, and clear the edgeList cache, + since the list of edges has now changed. + + + + + + + Iterator access to the ordered list of edges is optimized by + copying the map collection to a list. (This assumes that + once an iterator is requested, it is likely that insertion into + the map is complete). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate for the node this star is based at. + + + + + + + + + + + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + Insert a directed edge in the list. + + + + + + + + + + + + + + + + + + + + + + + + + Compute the labelling for all dirEdges in this star, as well + as the overall labelling. + + + + + + For each dirEdge in the star, merge the label . + + + + + Update incomplete dirEdge labels from the labelling for the node. + + + + + + + + + + + + Traverse the star of DirectedEdges, linking the included edges together. + To link two dirEdges, the next pointer for an incoming dirEdge + is set to the next outgoing edge. + DirEdges are only linked if: + they belong to an area (i.e. they have sides) + they are marked as being in the result + Edges are linked in CCW order (the order they are stored). + This means that rings have their face on the Right + (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). + PRECONDITION: No pair of dirEdges are both marked as being in the result. + + + + + + + + + + + + + + + + Traverse the star of edges, maintaing the current location in the result + area at this node (if any). + If any L edges are found in the interior of the result, mark them as covered. + + + + + + + + + + + Compute the DirectedEdge depths for a subsequence of the edge array. + + The last depth assigned (from the R side of the last edge visited). + + + + + + + + + + + + + + + + + + + + A GraphComponent is the parent class for the objects' + that form a graph. Each GraphComponent can carry a + Label. + + + + + + + + + + + + + + + + + + + + + Compute the contribution to an IM for this component. + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + + + + + + + + + + + IsInResult indicates if this component has already been included in the result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A coordinate in this component (or null, if there are none). + + + + + An isolated component is one that does not intersect or touch any other + component. This is the case if the label has valid locations for + only a single Geometry. + + true if this component is isolated. + + + + Updates an IM from the label for an edge. + Handles edges from both L and A geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an EdgeIntersection for intersection intIndex. + An intersection that falls exactly on a vertex of the edge is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if the coordinate sequences of the Edges are identical. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The depthDelta is the change in depth as an edge is crossed from R to L. + + The change in depth as the edge is crossed from R to L. + + + + + + + + + + + + + + + + + + + + + + + + An Edge is collapsed if it is an Area edge and it consists of + two segments which are equal and opposite (eg a zero-width V). + + + + + + + + + + + + + + + + + + + + An EdgeIntersection represents a point on an + edge which intersects with another edge. + The intersection may either be a single point, or a line segment + (in which case this point is the start of the line segment) + The label attached to this intersection point applies to + the edge from this point forwards, until the next + intersection or the end of the edge. + The intersection point must be precise. + + + + + + + + + + + + + + + + + + + + + + + + + -1 this EdgeIntersection is located before the argument location, + 0 this EdgeIntersection is at the argument location, + 1 this EdgeIntersection is located after the argument location. + + + + + + + + + + + + + + + + + + The point of intersection. + + + + + The index of the containing line segment in the parent edge. + + + + + The edge distance of this point along the containing line segment. + + + + + A list of edge intersections along an Edge. + + + + + + + + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + + The EdgeIntersection found or added. + + + + Returns an iterator of EdgeIntersections. + + + + + + + + + + + + Adds entries for the first and last points of the edge to the list. + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the input list (this is so a single list + can be used to accumulate all split edges for a Geometry). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + + + + + + + + + + + + A EdgeList is a list of Edges. It supports locating edges + that are pointwise equals to a target edge. + + + + + + Remove the selected Edge element from the list if present. + + Edge element to remove from list + + + + Insert an edge unless it is already in the list. + + + + + + + + + + + + If there is an edge equal to e already in the list, return it. + Otherwise return null. + + + + equal edge, if there is one already in the list, + null otherwise. + + + + + + + + + + + + + + + + + + If the edge e is already in the list, return its index. + + + + Index, if e is already in the list, + -1 otherwise. + + + + + + + + + + + + + + + + + + + + + + + Validates that a collection of is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Checks whether the supplied s are correctly noded. + + an enumeration of Edges. + If the SegmentStrings are not correctly noded + + + + Creates a new validator for the given collection of s. + + + + + Checks whether the supplied edges are correctly noded. + + If the SegmentStrings are not correctly noded + + + + + + + + + The directed edge which starts the list of edges for this EdgeRing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compute a LinearRing from the point list previously collected. + Test if the ring is a hole (i.e. if it is CCW) and set the hole flag + accordingly. + + + + + + + + + + + + + + + + + + + Collect all the points from the DirectedEdges of this ring into a contiguous list. + + + + + + + + + + + + + + + + + + + + + + Merge the RHS label from a DirectedEdge into the label for this EdgeRing. + The DirectedEdge label may be null. This is acceptable - it results + from a node which is NOT an intersection node between the Geometries + (e.g. the end node of a LinearRing). In this case the DirectedEdge label + does not contribute any information to the overall labelling, and is simply skipped. + + + + + + + + + + + + + + + This method will cause the ring to be computed. + It will also check any holes, if they have been assigned. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the list of DirectedEdges that make up this EdgeRing. + + + + + + + + + + A GeometryGraph is a graph that models a given Geometry. + + + + + The computation of the IntersectionMatrix relies on the use of a structure + called a "topology graph". The topology graph contains nodes and edges + corresponding to the nodes and line segments of a Geometry. Each + node and edge in the graph is labeled with its topological location relative to + the source point. + Note that there is no requirement that points of self-intersection be a vertex. + Thus to obtain a correct topology graph, Geometrys must be + self-noded before constructing their graphs. + Two fundamental operations are supported by topology graphs: + Computing the intersections between all the edges and nodes of a single graph + Computing the intersections between the edges and nodes of two different graphs + + + + + For nodes in the Collection, link the DirectedEdges at the node that are in the result. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The node if found; null otherwise + + + + + + Add a set of edges to the graph. For each edge two DirectedEdges + will be created. DirectedEdges are NOT linked by this method. + + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Returns the EdgeEnd which has edge e as its base edge + (MD 18 Feb 2002 - this should return a pair of edges). + + + The edge, if found null if the edge was not found. + + + + Returns the edge whose first two coordinates are p0 and p1. + + + + The edge, if found null if the edge was not found. + + + + Returns the edge which starts at p0 and whose first segment is + parallel to p1. + + + + The edge, if found null if the edge was not found. + + + + The coordinate pairs match if they define line segments lying in the same direction. + E.g. the segments are parallel and in the same quadrant + (as opposed to parallel and opposite!). + + + + + + + + + + + + + + + + + + + + + + + + + This method implements the Boundary Determination Rule + for determining whether + a component (node or edge) that appears multiple times in elements + of a MultiGeometry is in the boundary or the interior of the Geometry. + The SFS uses the "Mod-2 Rule", which this function implements. + An alternative (and possibly more intuitive) rule would be + the "At Most One Rule": + isInBoundary = (componentCount == 1) + + + + + The lineEdgeMap is a map of the linestring components of the + parentGeometry to the edges which are derived from them. + This is used to efficiently perform findEdge queries + + + + + If this flag is true, the Boundary Determination Rule will used when deciding + whether nodes are in the boundary or not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + Adds a polygon ring to the graph. Empty rings are ignored. + The left and right topological location arguments assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged. + + + + + + + + + + + + + + + + + + + + Add an Edge computed externally. The label on the Edge is assumed + to be correct. + + + + + + Add a point computed externally. The point is assumed to be a + Point Geometry part, which has a location of INTERIOR. + + + + + + Compute self-nodes, taking advantage of the Geometry type to + minimize the number of intersection tests. (E.g. rings are + not tested for self-intersection, since they are assumed to be valid). + + The LineIntersector to use. + If false, intersection checks are optimized to not test rings for self-intersection. + The SegmentIntersector used, containing information about the intersections found. + + + + + + + + + + + + + + + + + + + + + Adds candidate boundary points using the current . + This is used to add the boundary + points of dim-1 geometries (Curves/MultiCurves). + + + + + + + + + + + + + Add a node for a self-intersection. + If the node is a potential boundary node (e.g. came from an edge which + is a boundary) then insert it as a potential boundary node. + Otherwise, just add it as a regular node. + + + + + + + + Determines the of the given in this geometry. + + The point to test + + The location of the point in the geometry + + + + + + + + + + + + + + + + + + + + Gets the used with this geometry graph. + + + + + + + + + + An EdgeSetIntersector computes all the intersections between the + edges in the set. It adds the computed intersections to each edge + they are found on. It may be used in two scenarios: + determining the internal intersections between a single set of edges + determining the mutual intersections between two different sets of edges + It uses a SegmentIntersector to compute the intersections between + segments and to record statistics about what kinds of intersections were found. + + + + + Computes all self-intersections between edges in a set of edges, + allowing client to choose whether self-intersections are computed. + + A list of edges to test for intersections. + The SegmentIntersector to use. + true if self-intersections are to be tested as well. + + + + Computes all mutual intersections between two sets of edges. + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + They have the following properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + + Specifically, a sequence of contiguous line segments + is a monotone chain iff all the vectors defined by the oriented segments + lies in the same quadrant. + + Monotone Chains have the following useful properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + Note that due to the efficient intersection test, there is no need to limit the size + of chains to obtain fast performance. + + + + + + + + + + + + + + + + + + + + The index of the last point in the monotone chain. + + + + + + Computes the intersection of line segments, + and adds the intersection to the edges containing the segments. + + + + + + + + + + + + + Testing only. + + + + + + + + + + + + + + + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning + and end segments. + + + + + + + + + This method is called by clients of the EdgeIntersector class to test for and add + intersections for two segments of the edges being intersected. + Note that clients (such as MonotoneChainEdges) may choose not to intersect + certain pairs of segments for efficiency reasons. + + + + + + + + + + + + + + + + + + + + + + + + + The proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire Geometry, since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the Geometry. + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this SegmentIntersector. + + + + + Finds all intersections in one or two sets of edges, + using the straightforward method of + comparing all segments. + This algorithm is too slow for production use, but is useful for testing purposes. + + + + + + + + + + + + + + + + + + + + + Performs a brute-force comparison of every segment in each Edge. + This has n^2 performance, and is about 100 times slower than using + monotone chains. + + + + + + + + Finds all intersections in one or two sets of edges, + using an x-axis sweepline algorithm in conjunction with Monotone Chains. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + The use of MonotoneChains as the items in the index + seems to offer an improvement in performance over a sweep-line alone. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + Finds all intersections in one or two sets of edges, + using a simple x-axis sweepline algorithm. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because DELETE events have a link to their corresponding INSERT event, + it is possible to compute exactly the range of events which must be + compared to a given INSERT event object. + + + + + + + + + + + + + + + + + + + + + + + + + Creates an INSERT event. + + The edge set label for this object. + The event location + the object being inserted + + + + Creates a DELETE event. + + The event location + The corresponding INSERT event + + + + Events are ordered first by their x-value, and then by their eventType. + Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Label indicates the topological relationship of a component + of a topology graph to a given Geometry. + This class supports labels for relationships to two Geometrys, + which is sufficient for algorithms for binary operations. + Topology graphs support the concept of labeling nodes and edges in the graph. + The label of a node or edge specifies its topological relationship to one or + more geometries. (In fact, since NTS operations have only two arguments labels + are required for only two geometries). A label for a node or edge has one or + two elements, depending on whether the node or edge occurs in one or both of the + input Geometrys. Elements contain attributes which categorize the + topological location of the node or edge relative to the parent + Geometry; that is, whether the node or edge is in the interior, + boundary or exterior of the Geometry. Attributes have a value + from the set {Interior, Boundary, Exterior}. In a node each + element has a single attribute On. For an edge each element has a + triplet of attributes Left, On, Right. + It is up to the client code to associate the 0 and 1 TopologyLocations + with specific geometries. + + + + + Converts a Label to a Line label (that is, one with no side Location). + + Label to convert. + Label as Line label. + + + + Construct a Label with a single location for both Geometries. + Initialize the locations to Null. + + + + + + Construct a Label with a single location for both Geometries. + Initialize the location for the Geometry index. + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for both Geometries to the given values. + + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for the given Geometry index. + + + + + + + + + Construct a Label with the same values as the argument Label. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge this label with another one. + Merging updates any null attributes of this label with the attributes from lbl. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts one GeometryLocation to a Line location. + + + + + + + + + + + + + + + + + + + + + + Only non-null if this node is precise. + + + + + + + + + + + + + + + + + Basic nodes do not compute IMs. + + + + + + Add the edge to the list of edges at this node. + + + + + + + + + + + + To merge labels for two nodes, + the merged location for each LabelElement is computed. + The location for the corresponding node LabelElement is set to the result, + as long as the location is non-null. + + + + + + + + + + + + + Updates the label of a node to BOUNDARY, + obeying the mod-2 boundaryDetermination rule. + + + + + + The location for a given eltIndex for a node will be one + of { Null, Interior, Boundary }. + A node may be on both the boundary and the interior of a point; + in this case, the rule is that the node is considered to be in the boundary. + The merged location is the maximum of the two input values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The basic node constructor does not allow for incident edges. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + + + + + + + This method expects that a node has a coordinate value. + + + + + + + + + + + + + Adds a node for the start point of this EdgeEnd + (if one does not already exist in this map). + Adds the EdgeEnd to the (possibly new) node. + + + + + + The node if found; null otherwise. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An indicator that a Location is on a GraphComponent (0) + + + + + An indicator that a Location is to the left of a GraphComponent (1) + + + + + An indicator that a Location is to the right of a GraphComponent (2) + + + + + An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) + /// + + + + A Position indicates the position of a Location relative to a graph component + (Node, Edge, or Area). + + + + + Returns Positions.Left if the position is Positions.Right, + Positions.Right if the position is Left, or the position + otherwise. + + + + + + Utility functions for working with quadrants, which are numbered as follows: + + 1 | 0 + --+-- + 2 | 3 + + + + + + North-East + + + + + North-West + + + + + South-West + + + + + South-East + + + + + Only static methods! + + + + + Returns the quadrant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + If the displacements are both 0 + + + + Returns the quadrant of a directed line segment from p0 to p1. + + + + if the points are equal + + + + Returns true if the quadrants are 1 and 3, or 2 and 4. + + + + + + + Returns the right-hand quadrant of the halfplane defined by the two quadrants, + or -1 if the quadrants are opposite, or the quadrant if they are identical. + + + + + + + Returns whether the given quadrant lies within the given halfplane (specified + by its right-hand quadrant). + + + + + + + Returns true if the given quadrant is 0 or 1. + + + + + + A TopologyLocation is the labelling of a + GraphComponent's topological relationship to a single Geometry. + + + If the parent component is an area edge, each side and the edge itself + have a topological location. These locations are named: + + Onon the edge + Leftleft-hand side of the edge + Rightright-hand side + + + If the parent component is a line edge or node, there is a single + topological relationship attribute, On. + + The possible values of a topological location are + { , , , } + + The labelling is stored in an array _location[j] where + where j has the values On, Left, Right. + + + + + + + + + + + + Constructs a TopologyLocation specifying how points on, to the left of, and to the + right of some GraphComponent relate to some Geometry. Possible values for the + parameters are Location.Null, Location.Exterior, Location.Boundary, + and Location.Interior. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge updates only the Null attributes of this object + with the attributes of another. + + + + + + + + + + + Get calls Get(Positions posIndex), + Set calls SetLocation(Positions locIndex, Location locValue) + + + + + + + true if all locations are Null. + + + + + true if any locations are Null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An BinTree (or "Binary Interval Tree") + is a 1-dimensional version of a quadtree. + It indexes 1-dimensional intervals (which may + be the projection of 2-D objects on an axis). + It supports range searching + (where the range may be a single point). + + + + This structure is dynamic - + new items can be added at any time, + and it will support deletion of items + (although this is not currently implemented). + + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + This index is different to the Interval Tree of Edelsbrunner + or the Segment Tree of Bentley. + + + + + Ensure that the Interval for the inserted item has non-zero extents. + Use the current minExtent to pad it, if necessary. + + + + + + + + + + + + + + + + + Removes a single item from the tree. + + itemEnv the Envelope of the item to be removed + the item to remove + true if the item was found (and thus removed) + + + + + + + + + + + + + + + + + Queries the tree to find all candidate items which + may overlap the query interval. + If the query interval is null, all items in the tree are found. + min and max may be the same value. + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + + + + + + + + + + + + + + + + + Compute the total number of nodes in the tree. + + The number of nodes in the tree. + + + + A Key is a unique identifier for a node in a tree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node of a Bintree. + + + + + The base class for nodes in a Bintree. + + + + + Returns the index of the subnode that wholely contains the given interval. + If none does, returns -1. + + + + + + + + + + + + Subnodes are numbered as follows: + 0 | 1 + . + + + + + + + + + + + + + + + + + + + + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + Removes a single item from this subtree. + + The envelope containing the item + The item to remove + true if the item was found and removed + + + + + + + + + Gets whether this node is prunable + + + + + Gets whether this node has any children + + + + + + + + + + Gets whether this node has any subnodes + + + + + + + + + + + + + + + Creates a node + + The interval of the node item + A new node + + + + Creates a larger node, that contains both and + If is null, a node for is created. + + The original node + The additional interval + A new node + + + + Creates a new node instance + + The node's interval + The node's level + + + + + + + + + + + Returns the subnode containing the envelope. + Creates the node if + it does not already exist. + + + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subnode for the index. + If it doesn't exist, create it. + + + + + + + + + + + + Gets the node's + + + + + The root node of a single Bintree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the tree this is the root of. + + + + + + + Insert an item which is known to be contained in the tree rooted at + the given Node. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + The root node matches all searches. + + + + + + MonotoneChains are a way of partitioning the segments of a linestring to + allow for fast searching of intersections. + + + + They have the following properties: + + the segments within a monotone chain never intersect each other + the envelope of any contiguous subset of the segments in a monotone chain + is equal to the envelope of the endpoints of the subset. + + + + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows an efficient + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + One of the goals of this implementation of MonotoneChains is to be + as space and time efficient as possible. One design choice that aids this + is that a MonotoneChain is based on a subarray of a list of points. + This means that new arrays of points (potentially very large) do not + have to be allocated. + + MonotoneChains support the following kinds of queries: + + Envelope selectdetermine all the segments in the chain which + intersect a given envelope. + Overlapdetermine all the pairs of segments in two chains whose + envelopes overlap. + + + + This implementation of MonotoneChains uses the concept of internal iterators + ( and ) + to return the resultsets for the above queries. + This has time and space advantages, since it + is not necessary to build lists of instantiated objects to represent the segments + returned by the query. + Queries made in this manner are thread-safe. + + + + + + + + + + + + + + + Gets the line segment starting at + + The index of the segment + The line segment to extract to + + + + Determine all the line segments in the chain whose envelopes overlap + the searchEnvelope, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the select action on chain segments + which it can determine are not in the search envelope. + However, it *may* call the select action on segments + which do not intersect the search envelope. + This saves on the overhead of checking envelope intersection + each time, since clients may be able to do this more efficiently. + + The search envelope + The select action to execute on selected segments + + + + + + + + + + + + + Determine all the line segments in two chains which may overlap, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the overlap action on chain segments + which it can determine do not overlap. + However, it *may* call the overlap action on segments + which do not actually interact. + This saves on the overhead of checking intersection + each time, since clients may be able to do this more efficiently. + + The monotone chain + The overlap action to execute on selected segments + + + + + + + + + + + + + + + Gets or sets the Id + + + + + Gets the chain's context + + + + + Gets the chain's envelope + + + + + Gets the start index + + + + + Gets the end index of the underlying linestring + + + + + Return the subsequence of coordinates forming this chain. + Allocates a new array to hold the Coordinates. + + + + + Constructs s + for sequences of s. + + + + + Only static methods! + + + + + + + + + + + + + + + + + + + Return a list of the MonotoneChains + for the given list of coordinates. + + + + + + + Return an array containing lists of start/end indexes of the monotone chains + for the given list of coordinates. + The last entry in the array points to the end point of the point array, + for use as a sentinel. + + + + + + Finds the index of the last point in a monotone chain + starting at a given point. + Any repeated points (0-length segments) will be included + in the monotone chain returned. + + The coordinates + The start index + + The index of the last point in the monotone chain starting at start. + + + + + The action for the internal iterator for performing + overlap queries on a MonotoneChain. + + + + + This envelope is used during the MonotoneChain search process. + + + + + This envelope is used during the MonotoneChain search process. + + + + + + + + + + + + + + + This function can be overridden if the original chains are needed. + + + The index of the start of the overlapping segment from mc1. + + The index of the start of the overlapping segment from mc2. + + + + This is a convenience function which can be overridden to obtain the actual + line segments which overlap. + + + + + + + A visitor for nodes and items in an index. + + + + + + + + + + + A static index on a set of 1-dimensional intervals, + using an R-Tree packed based on the order of the interval midpoints. + + + It supports range searching, + where the range is an interval of the real line (which may be a single point). + A common use is to index 1-dimensional intervals which + are the projection of 2-D objects onto an axis of the coordinate system. + + This index structure is static + - items cannot be added or removed once the first query has been made. + The advantage of this characteristic is that the index performance + can be optimized based on a fixed set of items. + + Martin Davis + + + + + Adds an item to the index which is associated with the given interval + + The lower bound of the item interval + The upper bound of the item interval + The item to insert + if the index has already been queried + + + + Search for intervals in the index which intersect the given closed interval + and apply the visitor to them. + + The lower bound of the query interval + The upper bound of the query interval + The visitor to pass any matched items to + + + + The basic insertion and query operations supported by classes + implementing spatial index algorithms. + A spatial index typically provides a primary filter for range rectangle queries. A + secondary filter is required to test for exact intersection. Of course, this + secondary filter may consist of other tests besides intersection, such as + testing other kinds of spatial relationships. + + + + + Adds a spatial item with an extent specified by the given Envelope to the index. + + + + + Queries the index for all items whose extents intersect the given search Envelope + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A list of the items found by the query. + + + + Queries the index for all items whose extents intersect the given search , + and applies an to them. + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A visitor object to apply to the items found. + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + A node of a , which represents one or more points in the same location. + + The type of the object + dskea + + + + Creates a new KdNode. + + coordinate of point + coordinate of point + A data objects to associate with this node + + + + Creates a new KdNode. + + The point location of new node + A data objects to associate with this node + + + + Gets x-ordinate of this node + + + + + Gets y-ordinate of this node + + + + + Gets the location of this node + + + + + Gets the user data object associated with this node. + + + + + Gets or sets the left node of the tree + + + + + Gets or sets the right node of the tree + + + + + Gets the number of inserted points that are coincident at this location. + + + + + Gets whether more than one point with this value have been inserted (up to the tolerance) + + + + + + An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. + + + This implementation supports detecting and snapping points which are closer + than a given distance tolerance. + If the same point (up to tolerance) is inserted + more than once , it is snapped to the existing node. + In other words, if a point is inserted which lies within the tolerance of a node already in the index, + it is snapped to that node. + When a point is snapped to a node then a new node is not created but the count of the existing node + is incremented. + If more than one node in the tree is within tolerance of an inserted point, + the closest and then lowest node is snapped to. + + The type of the user data object + David Skea + Martin Davis + + + + Converts a collection of s to an array of s. + + A collection of nodes + An array of the coordinates represented by the nodes + + + + Converts a collection of {@link KdNode}s + to an array of s, + specifying whether repeated nodes should be represented + by multiple coordinates. + + a collection of nodes + true if repeated nodes should + be included multiple times + An array of the coordinates represented by the nodes + + + + Creates a new instance of a KdTree with a snapping tolerance of 0.0. + (I.e. distinct points will not be snapped) + + + + + Creates a new instance of a KdTree with a snapping distance + tolerance. Points which lie closer than the tolerance to a point already + in the tree will be treated as identical to the existing point. + + The tolerance distance for considering two points equal + + + + Inserts a new point in the kd-tree, with no data. + + The point to insert + The kdnode containing the point + + + + Inserts a new point into the kd-tree. + + The point to insert + A data item for the point + + A new KdNode if a new point is inserted, else an existing + node is returned with its counter incremented. This can be checked + by testing returnedNode.getCount() > 1. + + + + + Finds the node in the tree which is the best match for a point + being inserted. + The match is made deterministic by returning the lowest of any nodes which + lie the same distance from the point. + There may be no match if the point is not within the distance tolerance of any + existing node. + + The point being inserted + + + the best matching node + null if no match was found + + + + + + Inserts a point known to be beyond the distance tolerance of any existing node. + The point is inserted at the bottom of the exact splitting path, + so that tree shape is deterministic. + + The point to insert + + + The data for the point + The created node + + + + + + Performs a range search of the points in the index. + + The range rectangle to query + + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection of the KdNodes found + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection to accumulate the result nodes into + + + + Performs a nearest neighbor search of the points in the index. + + The point to search the nearset neighbor for + + + + Tests whether the index contains any items. + + + + + DoubleBits manipulates Double numbers + by using bit manipulation and bit-field extraction. + For some operations (such as determining the exponent) + this is more accurate than using mathematical operations + (which suffer from round-off error). + The algorithms and constants in this class + apply only to IEEE-754 double-precision floating point format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This computes the number of common most-significant bits in the mantissa. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + The number of common most-significant mantissa bits. + + + + A representation of the Double bits formatted for easy readability. + + + + + + + + + + Determines the exponent for the number. + + + + + Determines the exponent for the number. + + + + + Provides a test for whether an interval is + so small it should be considered as zero for the purposes of + inserting it into a binary tree. + The reason this check is necessary is that round-off error can + cause the algorithm used to subdivide an interval to fail, by + computing a midpoint value which does not lie strictly between the + endpoints. + + + + + This value is chosen to be a few powers of 2 less than the + number of bits available in the double representation (i.e. 53). + This should allow enough extra precision for simple computations to be correct, + at least for comparison purposes. + + + + + Only static methods! + + + + + Computes whether the interval [min, max] is effectively zero width. + I.e. the width of the interval is so much less than the + location of the interval that the midpoint of the interval cannot be + represented precisely. + + + + + A Key is a unique identifier for a node in a quadtree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a node of a Quadtree. Nodes contain + items which have a spatial extent corresponding to the node's position + in the quadtree. + + + + + The base class for nodes in a Quadtree. + + + + + Gets the index of the subquad that wholly contains the given envelope. + If none does, returns -1. + + The index of the subquad that wholly contains the given envelope
+ or -1 if no subquad wholly contains the envelope
+
+ + + + + + + + subquads are numbered as follows: + 2 | 3 + --+-- + 0 | 1 + + + + + + + + + + + Removes a single item from this subtree. + + The envelope containing the item. + The item to remove. + true if the item was found and removed. + + + + Insert items in this into the parameter! + + IList for adding items. + Parameter IList with this items. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the subquad containing the envelope . + Creates the subquad if + it does not already exist. + + The envelope to search for + The subquad containing the search envelope. + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subquad for the index. + If it doesn't exist, create it. + + + + + + + + + + + + + + + + + + A Quadtree is a spatial index structure for efficient range querying + of items bounded by 2D rectangles.
+ s can be indexed by using their s.
+ Any type of object can also be indexed, as long as it has an extent that can be + represented by an . + + This Quadtree index provides a primary filter + for range rectangle queries. The various query methods return a list of + all items which may intersect the query rectangle. Note that + it may thus return items which do not in fact intersect the query rectangle. + A secondary filter is required to test for actual intersection + between the query rectangle and the envelope of each candidate item. + The secondary filter may be performed explicitly, + or it may be provided implicitly by subsequent operations executed on the items + (for instance, if the index query is followed by computing a spatial predicate + between the query geometry and tree items, + the envelope intersection check is performed automatically. + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + + This data structure is also known as an MX-CIF quadtree + following the terminology usage of Samet and others. +
+
+ + + Ensure that the envelope for the inserted item has non-zero extents. + Use the current minExtent to pad the envelope, if necessary. + + + + + + + minExtent is the minimum envelope extent of all items + inserted into the tree so far. It is used as a heuristic value + to construct non-zero envelopes for features with zero X and/or Y extent. + Start with a non-zero extent, in case the first feature inserted has + a zero extent in both directions. This value may be non-optimal, but + only one feature will be inserted with this value. + + + + + Constructs a Quadtree with zero items. + + + + + + + + + + + + Removes a single item from the tree. + + The Envelope of the item to be removed. + The item to remove. + true if the item was found (and thus removed). + + + + Queries the tree and returns items which may lie in the given search envelope. + + + Precisely, the items that are returned are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be returned as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not returned - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A List of items which may intersect the search envelope + + + + Queries the tree and visits items which may lie in the given search envelope. + + + Precisely, the items that are visited are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be visited as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not visited - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A visitor object which is passed the visited items + + + + Return a list of all items in the Quadtree. + + + + + + + + + + + Returns the number of levels in the tree. + + + + + Tests whether the index contains any items. + + + + + Returns the number of items in the tree. + + + + + QuadRoot is the root of a single Quadtree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the quadtree this is the root of. + + + + + Insert an item which is known to be contained in the tree rooted at + the given QuadNode root. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + + + + + A node of an . A node is one of: + + empty + an interior node containing child s + a leaf node containing data items (s). + + A node stores the bounds of its children, and its level within the index tree. + + + + + Constructs an AbstractNode at the given level in the tree + + + 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Returns a representation of space that encloses this Boundable, + preferably not much bigger than this Boundable's boundary yet fast to + test for intersection with the bounds of other Boundables. The class of + object returned depends on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other + object (for other subclasses of AbstractSTRtree). + + + + + Adds either an AbstractNode, or if this is a leaf node, a data object + (wrapped in an ItemBoundable). + + + + + + Returns either child s, or if this is a leaf node, real data (wrapped + in s). + + + + + Gets the bounds of this node + + + + + Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Gets the count of the s at this node. + + + + + Tests whether there are any s at this node. + + + + + Base class for STRtree and SIRtree. STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + This implementation is based on s rather than just s, + because the STR algorithm operates on both nodes and + data, both of which are treated as s. + + + + + Set to null when index is built, to avoid retaining memory. + + + + Constructs an AbstractSTRtree with the specified maximum number of child + nodes that a node may have. + + + + + + Creates parent nodes, grandparent nodes, and so forth up to the root + node, for the data that has been inserted into the tree. Can only be + called once, and thus can be called only after all of the data has been + inserted into the tree. + + + + + + + + + + + + Sorts the childBoundables then divides them into groups of size M, where + M is the node capacity. + + + + + + + Creates the levels higher than the given level. + + The level to build on. + the level of the Boundables, or -1 if the boundables are item + boundables (that is, below level 0). + The root, which may be a ParentNode or a LeafNode. + + + + Also builds the tree, if necessary. + + + + + + Gets a tree structure (as a nested list) + corresponding to the structure of the items and nodes in this tree. + The returned Lists contain either Object items, + or Lists which correspond to subtrees of the tree + Subtrees which do not contain any items are not included. + Builds the tree if necessary. + + a List of items and/or Lists + + + + Removes an item from the tree. + (Builds the tree, if necessary.) + + + + + Returns the maximum number of child nodes that a node may have. + + + + + Tests whether the index contains any items. + This method does not build the index, + so items can still be inserted after it has been called. + + + + + Gets the number of elements in the tree + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + For STRtrees, the bounds will be Envelopes; + for SIRtrees, Intervals; + for other subclasses of AbstractSTRtree, some other class. + + The bounds of one spatial object. + The bounds of another spatial object. + Whether the two bounds intersect. + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Boundable wrapper for a non-Boundable spatial object. Used internally by + AbstractSTRtree. + + + + + + + + + + + + The bounds + + + + + The item + + + + + One-dimensional version of an STR-packed R-tree. SIR stands for + "Sort-Interval-Recursive". STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an SIRtree with the default (10) node capacity. + + + + + Constructs an SIRtree with the given maximum number of child nodes that + a node may have. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + + Returns items whose bounds intersect the given value. + + + + + + Returns items whose bounds intersect the given bounds. + + Possibly equal to x2. + Possibly equal to x1. + + + + + + + + + + + + + + + + + + + + + + + + + + + A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. + For two-dimensional spatial data. + The STR packed R-tree is simple to implement and maximizes space + utilization; that is, as many leaves as possible are filled to capacity. + Overlap between nodes is far less than in a basic R-tree. However, once the + tree has been built (explicitly or on the first call to #query), items may + not be added or removed. + Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an STRtree with the default (10) node capacity. + + + + + Constructs an STRtree with the given maximum number of child nodes that + a node may have. + + The minimum recommended capacity setting is 4. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates the parent level for the given child level. First, orders the items + by the x-values of the midpoints, and groups them into vertical slices. + For each slice, orders the items by the y-values of the midpoints, and + group them into runs of size M (the node capacity). For each run, creates + a new (parent) node. + + + + + + + + + + + + + + + + + + + + + + + + + Must be sorted by the x-value of the envelope midpoints. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + + + + + + + Finds the two nearest items in the tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + A distance metric applicable to the items in this tree + The pair of the nearest items + + + + Finds the item in this tree which is nearest to the given , + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + The query does not have to be + contained in the tree, but it does + have to be compatible with the + distance metric. + + The envelope of the query item + The item to find the nearest neighbour of + A distance metric applicable to the items in this tree and the query item + The nearest item in this tree + + + + Finds the two nearest items from this tree + and another tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + The result value is a pair of items, + the first from this tree and the second + from the argument tree. + + Another tree + A distance metric applicable to the items in the trees + The pair of the nearest items, one from each tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ProjectionEvents are ordered first by their x-value, and then by their eventType. + It is important that Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sweepline implements a sorted index on a set of intervals. + It is used to compute all overlaps between the interval in the index. + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a sequence of s in WKT format from a text file. + + The geometries in the file may be separated by any amount of whitespace and newlines. + + Martin Davis + + + + + Creates a new given the to read from and a to use to parse the geometries. + + the to read from + the geometry reader to use + + + + Creates a new , given the name of the file to read from. + + The name of the file to read from + The geometry reader to use + + + + Creates a new , given a to read with. + + The stream reader of the file to read from + The geometry reader to use + + + + Reads a sequence of geometries. + + + + If an offset is specified, geometries read up to the offset count are skipped. + If a limit is specified, no more than geometries are read. + + The list of geometries read + + + + Tests if reader is at EOF. + + + + + Gets/Sets the maximum number of geometries to read. + + + + + Gets/Sets the number of geometries to skip before reading. + + + + + Finds if two sets of s intersect. + + + Uses indexing for fast performance and to optimize repeated tests + against a target set of lines. + Short-circuited to return as soon an intersection is found. + + Immutable and thread-safe. + + + + + Creates an intersection finder against a given set of segment strings. + + The segment strings to search for intersections + + + + Tests for intersections with a given set of target {@link SegmentString}s. + + The SegmentStrings to test + true if an intersection was found + + + + Tests for intersections with a given set of target s. + using a given SegmentIntersectionDetector. + + The SegmentStrings to test + The intersection detector to use + true if the detector reports intersections + + + Gets the segment set intersector used by this class. + This allows other uses of the same underlying indexed structure. + + + + Intersects two sets of s using a index based + on s and a . + + Thread-safe and immutable. + + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of indexed segments. + + + + + + + Gets the index constructed over the base segment strings + + NOTE: To retain thread-safety, treat returned value as immutable + + + + Segment overlap action class + + + + + Creates an instance of this class using the provided + + The segment intersector to use + + + + Detects and records an intersection between two s, + if one exists. Only a single intersection is recorded. + + + This strategy can be configured to search for proper intersections. + In this case, the presence of any intersection will still be recorded, + but searching will continue until either a proper intersection has been found + or no intersections are detected. + + + + + Creates an intersection finder using a + + + + + Creates an intersection finder using a given + + The LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected. + + + Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). + + + + + Gets or sets whether processing must continue until a proper intersection is found + + + + + Gets or sets whether processing can terminate once any intersection is found. + + + + + Tests whether an intersection was found. + + + + + Tests whether a proper intersection was found. + + + + + Tests whether a non-proper intersection was found. + + + + + Gets the computed location of the intersection. Due to round-off, the location may not be exact. + + + + Gets the endpoints of the intersecting segments. + + An array of the segment endpoints (p00, p01, p10, p11) + + + + Tests whether processing can terminate, + because all required information has been obtained + (e.g. an intersection of the desired type has been detected). + + + + + Utility methods for processing s + + Martin Davis + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Converts a collection of s into a . + The geometry will be either a + or a (possibly empty). + + A collection of . + A geometry factory + A or a . + + + + Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. + These kinds of geometries are useful as a more complex geometry for testing algorithms. + + + Martin Davis + + + + + Computes various kinds of common geometric shapes. + Allows various ways of specifying the location and extent of the shapes, + as well as number of line segments used to form them. + + + + + Create a shape factory which will create shapes using the default GeometryFactory. + + + + + Create a shape factory which will create shapes using the given GeometryFactory. + + The factory to use. + + + + Creates a rectangular Polygon. + + A rectangular polygon. + + + + Creates a circular Polygon. + + A circular polygon. + + + + Creates an elliptical Polygon. + If the supplied envelope is square the + result will be a circle. + + An an ellipse or circle. + + + + Creates a squircular . + + a squircle + + + + Creates a supercircular + of a given positive power. + + a supercircle + + + + Creates a elliptical arc, as a LineString. + + The arc is always created in a counter-clockwise direction. + + Start angle in radians + Size of angle in radians + + + + + Creates an elliptical arc polygon. + + + The polygon is formed from the specified arc of an ellipse + and the two radii connecting the endpoints to the centre of the ellipse. + + Start angle in radians + Size of angle in radians + An elliptical arc polygon + + + + Gets/Sets the location of the shape by specifying the base coordinate + (which in most cases is the + lower left point of the envelope containing the shape). + + + + + Gets/Sets the location of the shape by specifying the centre of + the shape's bounding box. + + + + + Gets or sets the envelope of the shape + + + + + Gets/Sets the total number of points in the created Geometry. + + + + + Gets/Sets the size of the extent of the shape in both x and y directions. + + + + + Gets/Sets the width of the shape. + + + + + Gets/Sets the height of the shape. + + + + + Gets/Sets the rotation angle, in radians, to use for the shape. + The rotation is applied relative to the centre of the shape. + + + + + Creates a factory which will create sine stars using the default + + + + + Creates a factory which will create sine stars using the given + + The factory to use + + + + Generates the geometry for the sine star + + The geometry representing the sine star + + + Gets/Sets the number of arms in the star + + + + Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. + + Value should be between 0.0 and 1.0 + + + + Extends the class to allow reading values in the BigEndian format. + + + While extends + adding methods for reading integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for reading values in the BigEndian format. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + encoding is null. + The stream does not support reading, the stream is null, or the stream is already closed. + + + + Reads a 2-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by two bytes. + + + A 2-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 2-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by two bytes. + + + A 2-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by four bytes. + + + A 4-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by eight bytes. + + + An 8-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a string from the current stream. + The string is prefixed with the length, encoded as an integer seven bits at a time. + + The string being read. + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a decimal value from the current stream + and advances the current position of the stream by sixteen bytes. + + + A decimal value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Extends the class to allow writing values in the BigEndian format. + + + While extends + adding methods for writing integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for writing values in the BigEndian format. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The supplied stream. + output is null. + + The stream does not support writing, or the stream is already closed. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + output or encoding is null. + + The stream does not support writing, or the stream is already closed. + + + + Writes a two-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a two-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes a length-prefixed string to this stream in the current encoding + of the , + and advances the current position of the stream in accordance + with the encoding used and the specific characters being written to the stream. + + The value to write. + The stream is closed. + An I/O error occurs. + value is null. + + + + Writes a decimal value to the current stream and advances the stream position by sixteen bytes. + + The decimal value to write. + The stream is closed. + An I/O error occurs. + + + + Reads a GML document and creates a representation of the features based on NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + + + + Initialize reader with a standard . + + + + + Initialize reader with the given . + + + + + Read a GML document and returns relative . + + + + + + + Reads the coordinate. + + The reader. + + + + + Extract a from a x,y string value. + + + + + + + Extract a from a pos entity string value. + + + + + + + Extract a from a x,y string value. + + + + + builder. + + + + + Writes the GML representation of the features of NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + Thanks to rstuven for improvements :) + + + + + + Returns an XmlReader with feature informations. + Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. + + + + + + + Writes a GML feature into a generic Stream, such a FileStream or other streams. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formatter for double values of coordinates + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Converts a Well-Known Binary byte data to a Geometry. + + + The reader repairs structurally-invalid input + (specifically, LineStrings and LinearRings which contain + too few points have vertices added, + and non-closed rings are closed). + s + + + + Converts a hexadecimal string to a byte array. + The hexadecimal digit symbols are case-insensitive. + + A string containing hex digits + An array of bytes with the value of the hex string + + + true if structurally invalid input should be reported rather than repaired. + At some point this could be made client-controllable. + + + + Initialize reader with a standard . + + + + + Initialize reader with the given GeometryFactory. + + + + + + Reads a in binary WKB format from an array of s. + + The byte array to read from + The geometry read + if the WKB data is ill-formed. + + + + Reads a in binary WKB format from an . + + The stream to read from + The geometry read + if the WKB data is ill-formed. + + + + + + + + + + + + + + + + + Function to read a coordinate sequence. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to form a ring. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to serve a line string. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to convert from to + + The coordinate system + The corresponding + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Function to determine whether an ordinate should be handled or not. + + + + + + + The builder. + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + WKB Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + Point with Z coordinate. + + + + + LineString with Z coordinate. + + + + + Polygon with Z coordinate. + + + + + MultiPoint with Z coordinate. + + + + + MultiLineString with Z coordinate. + + + + + MultiPolygon with Z coordinate. + + + + + GeometryCollection with Z coordinate. + + + + + Point with M ordinate value. + + + + + LineString with M ordinate value. + + + + + Polygon with M ordinate value. + + + + + MultiPoint with M ordinate value. + + + + + MultiLineString with M ordinate value. + + + + + MultiPolygon with M ordinate value. + + + + + GeometryCollection with M ordinate value. + + + + + Point with Z coordinate and M ordinate value. + + + + + LineString with Z coordinate and M ordinate value. + + + + + Polygon with Z coordinate and M ordinate value. + + + + + MultiPoint with Z coordinate and M ordinate value. + + + + + MultiLineString with Z coordinate and M ordinate value. + + + + + MultiPolygon with Z coordinate and M ordinate value. + + + + + GeometryCollection with Z coordinate and M ordinate value. + + + + + Writes a Well-Known Binary byte data representation of a Geometry. + + + WKBWriter stores X,Y,Z values if is not , + otherwise value is discarded and only X,Y are stored. + + + + Converts a byte array to a hexadecimal string. + A byte array + + + Converts a byte array to a hexadecimal string. + A byte array + + + + Initializes writer with LittleIndian byte order. + + + + + Initializes writer with the specified byte order. + + Encoding type + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + M values, present or not, should be emitted + + + + Writes a WKB representation of a given point. + + + + + + + Writes a WKB representation of a given point. + + + + + + + + + + + + + + + Writes LittleIndian ByteOrder. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets or sets whether the value should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Standard byte size for each complex point. + Each complex point (LineString, Polygon, ...) contains: + 1 byte for ByteOrder and + 4 bytes for WKBType. + 4 bytes for SRID value + + + + + Gets a value whether or not EWKB featues may be used. + EWKB features are + 0x80000000 flag if geometry's z-ordinate values are written + 0x40000000 flag if geometry's m-ordinate values are written + 0x20000000 flag if geometry's SRID value is written + + + + + Converts a Well-Known Text string to a Geometry. + + The WKTReader allows + extracting Geometry objects from either input streams or + internal strings. This allows it to function as a parser to read Geometry + objects from text blocks embedded in other data formats (e.g. XML). + + The Well-known + Text format is defined in the + OpenGIS Simple Features Specification for SQL . + + NOTE: There is an inconsistency in the SFS. + The WKT grammar states that MultiPoints are represented by + MULTIPOINT ( ( x y), (x y) ), + but the examples show MultiPoints as MULTIPOINT ( x y, x y ). + Other implementations follow the latter syntax, so NTS will adopt it as well. + A WKTReader is parameterized by a GeometryFactory, + to allow it to create Geometry objects of the appropriate + implementation. In particular, the GeometryFactory will + determine the PrecisionModel and SRID that is used. + The WKTReader will convert the input numbers to the precise + internal representation. + + reads also non-standard "LINEARRING" tags. + + + + + + Creates a WKTReader that creates objects using a basic GeometryFactory. + + + + + Creates a WKTReader that creates objects using the given + GeometryFactory. + + The factory used to create Geometrys. + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + A Reader which will return a "Geometry Tagged Text" + string (see the OpenGIS Simple Features Specification). + + A Geometry read from reader. + + + + + Returns the next array of Coordinates in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next element returned by the stream should be "(" (the + beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". + + + if set to true skip extra parenthesis around coordinates. + + + The next array of Coordinates in the + stream, or an empty array if "EMPTY" is the next element returned by + the stream. + + + + + + + + + + + + + + + + + + + + Returns the next number in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a number. + + The next number in the stream. + if the next token is not a valid number + + + + Returns the next "EMPTY" or "(" in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be "EMPTY" or "(". + + + The next "EMPTY" or "(" in the stream as uppercase text. + + + + Returns the next ")" or "," in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")" or ",". + + + The next ")" or "," in the stream. + + + + Returns the next ")" in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")". + + + The next ")" in the stream. + + + + Returns the next word in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a word. + + The next word in the stream as uppercase text. + + + + Creates a Geometry using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Geometry Tagged Text. + + A Geometry specified by the next token + in the stream. + + + + Creates a Point using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Point Text. + + + A Point specified by the next token in + the stream. + + + + Creates a LineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + + A LineString specified by the next + token in the stream. + + + + Creates a LinearRing using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + A LinearRing specified by the next + token in the stream. + + + + Creates a MultiPoint using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <MultiPoint Text. + + + + A MultiPoint specified by the next + token in the stream. + + + + Creates an array of Points having the given Coordinates. + + + The Coordinates with which to create the Points + + The factory to create the points + + Points created using this WKTReader + s GeometryFactory. + + + + + Creates a Polygon using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a Polygon Text. + + + + A Polygon specified by the next token + in the stream. + + + + + Creates a MultiLineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiLineString Text. + + + + A MultiLineString specified by the + next token in the stream. + + + + Creates a MultiPolygon using the next token in the stream. + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiPolygon Text. + + + + A MultiPolygon specified by the next + token in the stream, or if if the coordinates used to create the + Polygon shells and holes do not form closed linestrings. + + + + Creates a GeometryCollection using the next token in the + stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <GeometryCollection Text. + + + + A GeometryCollection specified by the + next token in the stream. + + + + Gets or sets the factory to create geometries + + + + + Gets or sets the default SRID + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Outputs the textual representation of a . + The outputs coordinates rounded to the precision + model. No more than the maximum number of necessary decimal places will be + output. + The Well-known Text format is defined in the OpenGIS Simple Features + Specification for SQL. + A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does + not define a special tag for LinearRings. The standard tag to use is + "LINESTRING". + + + + + Generates the WKT for a Point specified by a . + + The point coordinate. + The WKT + + + + Generates the WKT for a N-point LineString specified by a . + + The sequence to write. + The WKT + + + Generates the WKT for a LINESTRING + specified by a {@link CoordinateSequence}. + + @param seq the sequence to write + + @return the WKT string + + + + Generates the WKT for a LineString specified by two s. + + The first coordinate. + The second coordinate. + The WKT + + + + Creates the NumberFormatInfo used to write doubles + with a sufficient number of decimal places. + + + The PrecisionModel used to determine + the number of decimal places to write. + + + A NumberFormatInfo that write doubles + without scientific notation. + + + + + Returns a String of repeated characters. + + The character to repeat. + The number of times to repeat the character. + A string of characters. + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Stream to write into + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + + A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + + A Geometry Tagged Text string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process + + + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification). + + + + + Converts a Geometry to <Geometry Tagged Text format, + then appends it to the writer. + + /he Geometry to process. + + /he output writer to append to. + + + + Converts a Coordinate to Point Tagged Text format, + then appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a LineString to <LineString Tagged Text + format, then appends it to the writer. + + The LineString to process. + + The output writer to append to. + + + + Converts a LinearRing to <LinearRing Tagged Text + format, then appends it to the writer. + + The LinearRing to process. + + The output writer to append to. + + + + Converts a Polygon to Polygon Tagged Text format, + then appends it to the writer. + + The Polygon to process. + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Tagged Text + format, then appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to MultiLineString Tagged + Text format, then appends it to the writer. + + The MultiLineString to process. + + The output writer to append to. + + + + Converts a MultiPolygon to MultiPolygon Tagged Text + format, then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollection + Tagged Text format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + Converts a Coordinate to Point Text format, then + appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + Appends the i'th coordinate from the sequence to the writer + the to process + the index of the coordinate to write + writer the output writer to append to + + + + + Converts a Coordinate to Point format, then appends + it to the writer. + + The Coordinate to process. + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a to a . + + The to convert. + + The as a . + + + + Converts a to <LineString Text> format, then appends it to the writer + + + + + Converts a LineString to <LineString Text format, then + appends it to the writer. + + The LineString to process. + + + The output writer to append to. + + + + Converts a Polygon to Polygon Text format, then + appends it to the writer. + + The Polygon to process. + + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Text format, then + appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to <MultiLineString Text + format, then appends it to the writer. + + The MultiLineString to process. + + + The output writer to append to. + + + + Converts a MultiPolygon to <MultiPolygon Text format, + then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollectionText + format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + + + + + + + + + + + + + + + + + Gets/sets whther the output woll be formatted + + + + + Gets/sets the maximum number of coordinates per line written in formatted output. + + If the provided coordinate number is < 0, coordinates will be written all on one line. + + + Gets/sets the tab size to use for indenting. + If the size is non-positive + + + + Extracts the subline of a linear between + two s on the line. + + + + + Computes the subline of a between + two s on the line. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The line to use as the baseline. + The start location. + The end location. + The extracted subline. + + + + Initializes a new instance of the class. + + + + + + Extracts a subline of the input. + If is minor that , + the linear geometry computed will be reversed. + + The start location. + The end location. + A linear geometry. + + + + + + + + + + + Assumes input is valid + (e.g. minor or equals to ). + + + + + + + + Supports linear referencing along a linear + using the length along the line as the index. + Negative length values are taken as measured in the reverse direction + from the end of the geometry. + Out-of-range index values are handled by clamping + them to the valid range of values. + Non-simple lines (i.e. which loop back to cross or touch + themselves) are supported. + + + + + Constructs an object which allows a linear + to be linearly referenced using length as an index. + + The linear geometry to reference along. + + + + Computes the for the point + on the line at the given index. + If the index is out of range the first or last point on the + line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the lies before the , + the computed geometry is reversed. + + + + + + + + + + + + + + + Computes the minimum index for a point on the line. + If the line is not simple (i.e. loops back on itself) + a single point may have more than one possible index. + In this case, the smallest index is returned. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The minimum index of the point. + + + + + Finds the index for a point on the line + which is greater than the given index. + If no such index exists, returns . + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The value the returned index must be greater than. + The index of the point greater than the given minimum index. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline.. + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + + + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line + by clamping the given index to the valid range of index values + + A valid index value + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Finds the nearest index along the linear + to a given after the specified minimum index. + If possible the location returned will be strictly + greater than the . + If this is not possible, the value returned + will equal . + (An example where this is not possible is when + = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + + + + + + + + + + + + + + + + + + Computes the for a given length + along a linear + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + + + + + Computes the for a + given length along a linear . + + The linear geometry to use. + The length index of the location. + The for the length. + + + + Computes the for a + given length along a linear , + with control over how the location + is resolved at component endpoints. + + The linear geometry to use + The length index of the location + If true lengths are resolved to the lowest possible index + + + + Computes the length for a given + on a linear . + + The linear geometry to use. + The index of the location. + The length for the . + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest possible location value. + + The length index. + The corresponding . + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest or highest possible location value, + depending on the value of resolveLower + + The length index + + The corresponding . + + + + + + + + + + + + + + + + + + Builds a linear geometry ( or ) + incrementally (point-by-point). + + + + + Creates an instance of this class. + + The geometry factory to use. + + + + Adds a point to the current line. + + The to add. + + + + Adds a point to the current line. + + The to add. + If true, allows the insertions of repeated points. + + + + Terminate the current . + + + + + + + + + + + + Builds and returns the . + + + + + + Allows invalid lines to be fixed rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + Allows invalid lines to be ignored rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + + + + + + An iterator over the components and coordinates of a linear geometry + (s and s. + + + + + + + + + + + + Invariant: currentLine <> null if the iterator is pointing at a valid coordinate + + + + + Creates an iterator initialized to the start of a linear . + + The linear geometry to iterate over. + if is not + + + + Creates an iterator starting at a on a linear . + + The linear geometry to iterate over. + The location to start at. + if is not + + + + Creates an iterator starting at + a component and vertex in a linear . + + The linear geometry to iterate over. + The component to start at. + The vertex to start at. + if is not + + + + + + + + + Tests whether there are any vertices left to iterator over. + Specifically, HasNext() returns true if the + current state of the iterator represents a valid location + on the linear geometry. + + true if there are more vertices to scan. + + + + Jump to the next element of the iteration. + + + + + Checks whether the iterator cursor is pointing to the + endpoint of a component . + + + + + The component index of the vertex the iterator is currently at. + + + + + The vertex index of the vertex the iterator is currently at. + + + + + Gets the component the iterator is current at. + + + + + Gets the first of the current segment + (the coordinate of the current vertex). + + + + + Gets the second of the current segment + (the coordinate of the next vertex). + If the iterator is at the end of a line, null is returned. + + + + + Represents a location along a or .
+ The referenced geometry is not maintained within this location, + but must be provided for operations which require it. + Various methods are provided to manipulate the location value + and query the geometry it references. +
+
+ + + Gets a location which refers to the end of a linear . + + The linear geometry. + A new LinearLocation. + + + + Computes the of a point a given fraction + along the line segment (p0, p1). + + + + If the fraction is greater than 1.0 the last + point of the segment is returned. + If the fraction is less than or equal to 0.0 the first point + of the segment is returned. + + The Z ordinate is interpolated from the Z-ordinates of the given points, + if they are specified. + + The first point of the line segment. + The last point of the line segment. + The length to the desired point. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + If true, ensures the individual values are locally valid. + + + + Creates a new location equal to a given one. + + A linear location + + + + Ensures the individual values are locally valid. + Does not ensure that the indexes are valid for + a particular linear geometry. + + + + + Ensures the indexes are valid for a given linear . + + A linear geometry. + + + + Snaps the value of this location to + the nearest vertex on the given linear , + if the vertex is closer than . + + A linear geometry. + The minimum allowable distance to a vertex. + + + + Gets the length of the segment in the given + Geometry containing this location. + + A linear geometry. + The length of the segment. + + + + Sets the value of this location to + refer to the end of a linear geometry. + + The linear geometry to use to set the end. + + + + Gets the along the + given linear which is + referenced by this location. + + A linear geometry. + The at the location. + + + + Gets a representing the segment of the given linear which contains this location. + + A linear geometry + the LineSegment containing the location + + + + Tests whether this location refers to a valid + location on the given linear . + + A linear geometry. + true if this location is valid. + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + is not the same type as this instance. + + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + + + Compares this object with the specified index values for order. + + The component index. + The segment index. + The segment fraction. + + A negative integer, zero, or a positive integer as this LineStringLocation + is less than, equal to, or greater than the specified locationValues. + + + + + Compares two sets of location values for order. + + The first component index. + The first segment index. + The first segment fraction. + The second component index. + The second segment index. + The second segment fraction. + + A negative integer, zero, or a positive integer + as the first set of location values is less than, equal to, + or greater than the second set of locationValues. + + + + + Tests whether two locations are on the same segment in the parent . + + A location on the same geometry + true if the locations are on the same segment of the parent geometry + + + + Tests whether this location is an endpoint of + the linear component it refers to. + + The linear geometry referenced by this location + True if the location is a component endpoint + + + + Converts a linear location to the lowest equivalent location index. + The lowest index has the lowest possible component and segment indices. + Specifically: + * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) + * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned + If the location index is already the lowest possible value, the original location is returned. + + The linear geometry referenced by this location. + The lowest equivalent location. + + + + Copies this location. + + A copy of this location. + + + + Gets the component index for this location. + + + + + Gets the segment index for this location. + + + + + Gets the segment fraction for this location. + + + + + Tests whether this location refers to a vertex: + returns true if the location is a vertex. + + + + + Supports linear referencing along a linear + using s as the index. + + + + + Constructs an object which allows linear referencing along + a given linear . + + The linear geometry to reference alo + + + + Computes the for the point on the line at the given index. + If the is out of range, + the first or last point on the line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point + on the line at the given index, offset by the given distance. + If the index is out of range the first or last point on the + line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment + (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The index of the start of the interval. + The index of the end of the interval. + The linear interval between the indices. + + + + Computes the index for a given point on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The index of the point. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline. + + + + Finds the index for a point on the line which is greater than the given index. + If no such index exists, returns . + + + + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + + + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + + A point on the line + The value the returned index must be greater than + The index of the point greater than the given minimum index + + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + A point on the line. + The index of the point. + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line by clamping + the given index to the valid range of index values. + + + A valid index value. + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + Determines the location of a subline along a linear . + The location is reported as a pair of s. + NOTE: Currently this algorithm is not guaranteed to + return the correct substring in some situations where + an endpoint of the test line occurs more than once in the input line. + (However, the common case of a ring is always handled correctly). + + + + + + + + + + + + + Initializes a new instance of the class. + + The linear geom. + + + + + + + + + + + Computes the of the point + on a linear nearest a given . + The nearest point is not necessarily unique; this class + always computes the nearest point closest + to the start of the geometry. + + + + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Find the nearest along the linear + to a given after the specified minimum . + If possible the location returned will be strictly greater than the . + If this is not possible, the value returned will equal . + (An example where this is not possible is when = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + Represents a list of contiguous line segments, + and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + An interface for classes which represent a sequence of contiguous line segments. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + + + + + Gets/Sets the user-defined data for this segment string. + + + + + Points that make up ISegmentString + + + + + Size of Coordinate Sequence + + + + + States whether ISegmentString is closed + + + + + Creates a new segment string from a list of vertices. + + the vertices of the segment string + the user-defined data of this segment string (may be null) + + + + Gets the octant of the segment starting at vertex index + + the index of the vertex starting the segment. Must not be the last index in the vertex list + octant of the segment at the vertex + + + Gets the user-defined data for this segment string. + + + + + Validates that a collection of s is correctly noded. + Indexing is used to improve performance. + + + + In the most common use case, validation stops after a single + non-noded intersection is detected, + but the class can be requested to detect all intersections + by using the property. + + The validator does not check for a-b-a topology collapse situations. + + The validator does not check for endpoint-interior vertex intersections. + This should not be a problem, since the JTS noders should be + able to compute intersections between vertices correctly. + + + The client may either test the condition, + or request that a suitable be thrown. + + + + + + Creates a new noding validator for a given set of linework. + + A collection of s + + + + Returns an error message indicating the segments containing the intersection. + + an error message documenting the intersection location + + + + Checks for an intersection and throws + a TopologyException if one is found. + + if an intersection is found + + + + Gets or sets whether all intersections should be found. + + + + + Gets a list of all intersections found. + + Intersections are represented as s. + List is empty if none were found. + + + + + + Checks for an intersection and reports if one is found. + + + + + An interface for classes which support adding nodes to a segment string. + + + + Adds an intersection node for a given point and segment to this segment string. + + the location of the intersection + the index of the segment containing the intersection + + + + + + + + Creates an intersection finder which tests if there is at least one interior intersection. + Uses short-circuiting for efficient performance. + The intersection found is recorded. + + A line intersector. + A intersection finder which tests if there is at least one interior intersection. + + + + Creates an intersection finder which finds all interior intersections. + The intersections are recorded for later inspection. + + A line intersector. + a intersection finder which finds all interior intersections. + + + + Creates an intersection finder which counts all interior intersections. + The intersections are note recorded to reduce memory usage. + + A line intersector. + a intersection finder which counts all interior intersections. + + + + Creates an intersection finder which finds an interior intersection if one exists + + the LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + Tests whether a segment in a is an end segment. + (either the first or last). + + a segment string + the index of a segment in the segment string + true if the segment is an end segment + + + + Gets/Sets whether all intersections should be computed. + + When this is false (the default value), the value of + is true after the first intersection is found. + Default is false. + + + + + + Gets/Sets whether intersection points are recorded. + + If the only need is to count intersection points, this can be set to false. + Default is true. + + + + + + Gets/Sets whether only end segments should be tested for interior intersection. + This is a performance optimization that may be used if + the segments have been previously noded by an appropriate algorithm. + It may be known that any potential noding failures will occur only in + end segments. + + + + + Tests whether an intersection was found. + + + + + Gets the intersections found. + + A list of . + + + + Gets the count of intersections found. + + The intersection count. + + + + Gets the computed location of the intersection. + Due to round-off, the location may not be exact. + + + + + Gets the endpoints of the intersecting segments. + + + + + Computes the possible intersections between two line segments in s + and adds them to each string + using . + + + + + + + + + + + + These variables keep track of what types of intersections were + found during ALL edges that have been intersected. + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning and end segments. + + + + + + + + + + This method is called by clients + of the class to process + intersections for two segments of the being intersected.
+ Note that some clients (such as MonotoneChain") may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Returns the proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire , since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the . + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this . + + + + + An interior intersection is an intersection which is + in the interior of some segment. + + + + + Always process all intersections + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + This class is obsolete. + Use instead. + + + + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Nodes a set of s completely. + The set of s is fully noded; + i.e. noding is repeated until no further intersections are detected. + + Iterated noding using a precision model is not guaranteed to converge, + due to roundoff error. This problem is detected and an exception is thrown. + Clients can choose to rerun the noding using a lower precision model. + + + + + + Computes all intersections between segments in a set of s. + Intersections found are represented as s and added to the + s in which they occur. + As a final step in the noding a new set of segment strings split at the nodes may be returned. + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Fully nodes a list of s, i.e. peforms noding iteratively + until no intersections are found between segments. + Maintains labelling of edges correctly through the noding. + + A collection of SegmentStrings to be noded. + If the iterated noding fails to converge. + + + + Node the input segment strings once + and create the split edges between the nodes. + + + + + + + Gets/Sets the maximum number of noding iterations performed before + the noding is aborted. Experience suggests that this should rarely need to be changed + from the default. The default is . + + + + + Nodes a set of s using a index based + on s and a . + The used should be something that supports + envelope (range) queries efficiently (such as a Quadtree" + or . + + + + + Base class for s which make a single pass to find intersections. + This allows using a custom + (which for instance may simply identify intersections, rather than insert them). + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Gets/sets the to use with this noder. + A will normally add intersection nodes + to the input segment strings, but it may not - it may + simply record the presence of intersections. + However, some s may require that intersections be added. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The + + + + + + + + + + + + + Validates that a collection of s is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Creates a new validator for the given collection + of s. + + The seg strings. + + + + Checks whether the supplied segment strings + are correctly noded. Throws an exception if they are not. + + + + + Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). + + + + + Checks all pairs of segments for intersections at an interior point of a segment. + + + + + Checks for intersections between an endpoint of a segment string + and an interior vertex of another segment string + + + + + Octants in the Cartesian plane. + Octants are numbered as follows: + + \2|1/ + 3 \|/ 0 + ---+-- + 4 /|\ 7 + /5|6\ + + If line segments lie along a coordinate axis, the octant is the lower of the two possible values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Methods for computing and working with of the Cartesian plane. + + + + + Returns the octant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + + + + + Returns the octant of a directed line segment from p0 to p1. + + + + + + + + Allows comparing arrays in an orientation-independent way. + + + + + Creates a new } + for the given array. + + + + + + Computes the canonical orientation for a coordinate array. + + + + true if the points are oriented forwards
+ or falseif the points are oriented in reverse. +
+
+ + + Compares two s for their relative order. + + + + -1 this one is smaller;
+ 0 the two objects are equal;
+ 1 this one is greater. +
+
+ + + + + + + + + + + + + Wraps a and transforms its input into the integer domain. + This is intended for use with Snap-Rounding noders, + which typically are only intended to work in the integer domain. + Offsets can be provided to increase the number of digits of available precision. + + Clients should be aware that rescaling can involve loss of precision, + which can cause zero-length line segments to be created. + These in turn can cause problems when used to build a planar graph. + This situation should be checked for and collapsed segments removed if necessary. + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an intersection point between two s. + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + -1 this SegmentNode is located before the argument location;
+ 0 this SegmentNode is at the argument location;
+ 1 this SegmentNode is located after the argument location. +
+
+ + + + + + + + + Gets the giving the location of this node. + + + + + + + + + + + A list of the s present along a noded . + + + + + Initializes a new instance of the class. + + The edge. + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + The SegmentIntersection found or added. + + + + Returns an iterator of SegmentNodes. + + An iterator of SegmentNodes. + + + + Adds nodes for the first and last points of the edge. + + + + + Adds nodes for any collapsed edge pairs. + Collapsed edge pairs can be caused by inserted nodes, or they can be + pre-existing in the edge vertex list. + In order to provide the correct fully noded semantics, + the vertex at the base of a collapsed pair must also be added as a node. + + + + + Adds nodes for any collapsed edge pairs + which are pre-existing in the vertex list. + + + + + + Adds nodes for any collapsed edge pairs caused by inserted nodes + Collapsed edge pairs occur when the same coordinate is inserted as a node + both before and after an existing edge vertex. + To provide the correct fully noded semantics, + the vertex must be added as a node as well. + + + + + + + + + + + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the provided argument list + (this is so a single list can be used to accumulate all split edges + for a set of s). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + Gets the list of coordinates for the fully noded segment string, + including all original segment string vertices and vertices + introduced by nodes in this list. + Repeated coordinates are collapsed. + + An array of s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not implemented. + + This method is not implemented. + + + + + + + + + + + + + + + + + + + + Implements a robust method of comparing the relative position of two points along the same segment. + The coordinates are assumed to lie "near" the segment. + This means that this algorithm will only return correct results + if the input coordinates have the same precision and correspond to rounded values + of exact coordinates lying on the segment. + + + + + Compares two s for their relative position along a segment + lying in the specified . + + + + + + -1 if node0 occurs first, or
+ 0 if the two nodes are equal, or
+ 1 if node1 occurs first. +
+
+ + + + + + + + + + + + + + + + + + + Represents a list of contiguous line segments, and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + s can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + Gets the s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A collection of NodedSegmentStrings representing the substrings + + + + Adds the noded s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A list which will collect the NodedSegmentStrings representing the substrings + + + + Creates a new segment string from a list of vertices. + + The vertices of the segment string. + The user-defined data of this segment string (may be null). + + + + + + + + + + + Gets the octant of the segment starting at vertex index. + + + The index of the vertex starting the segment. + Must not be the last index in the vertex list + + The octant of the segment at the vertex + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an for intersection intIndex. + An intersection that falls exactly on a vertex + of the is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + + + + + + + + Gets/Sets the user-defined data for this segment string. + + + + + + + + + + + + + + + + + + + + + + + + + + Dissolves a noded collection of s to produce + a set of merged linework with unique segments. + + + A custom merging strategy + can be supplied. + This strategy will be called when two identical (up to orientation) + strings are dissolved together. + The default merging strategy is simply to discard one of the merged strings. + + A common use for this class is to merge noded edges + while preserving topological labelling. + This requires a custom merging strategy to be supplied + to merge the topology labels appropriately. + + + + + + Creates a dissolver with a user-defined merge strategy. + + + + + + Creates a dissolver with the default merging strategy. + + + + + Dissolve all s in the input . + + + + + + + + + + + + + Dissolve the given . + + + + + + + + + Gets the collection of dissolved (i.e. unique) s + + + + + A merging strategy which can be used to update the context data of s + which are merged during the dissolve process. + + mbdavis + + + + Updates the context data of a + when an identical (up to orientation) one is found during dissolving. + + The segment string to update. + The segment string being dissolved. + + true if the strings are in the same direction, + false if they are opposite. + + + + + Nodes a set of s by + performing a brute-force comparison of every segment to every other one. + This has n^2 performance, so is too slow for use on large numbers of segments. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Nodes the linework in a list of s using Snap-Rounding + to a given . + + The input coordinates are expected to be rounded + to the given precision model. + This class does not perform that function. + GeometryPrecisionReducer" may be used to do this. + + This class does not dissolve the output linework, + so there may be duplicate linestrings in the output. + Subsequent processing (e.g. polygonization) may require + the linework to be unique. Using UnaryUnion is one way + to do this (although this is an inefficient approach). + + + + + Creates a new noder which snap-rounds to a grid specified by the given + + The precision model for the grid to snap-round to. + + + + Nodes the linework of a set of Geometrys using SnapRounding. + + A collection of Geometrys of any type + A list of LineStrings representing the noded linework of the input + + + + Gets or sets whether noding validity is checked after noding is performed. + + + + + Implements a "hot pixel" as used in the Snap Rounding algorithm. + A hot pixel contains the interior of the tolerance square and the boundary + minus the top and right segments. + The hot pixel operations are all computed in the integer domain + to avoid rounding problems. + + + + + Initializes a new instance of the class. + + The coordinate at the center of the hot pixel + The scale factor determining the pixel size + THe intersector to use for testing intersection with line segments + + + + Returns a "safe" envelope that is guaranteed to contain the hot pixel. + The envelope returned will be larger than the exact envelope of the pixel. + + An envelope which contains the pixel + + + + + + + + + + + + + + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + The first coordinate of the line segment to test + The second coordinate of the line segment to test + true if the line segment intersects this hot pixel. + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + + + + + + + + + + + + + + Tests whether the segment p0-p1 intersects the hot pixel tolerance square. + Because the tolerance square point set is partially open (along the + top and right) the test needs to be more sophisticated than + simply checking for any intersection. + However, it can take advantage of the fact that the hot pixel edges + do not lie on the coordinate grid. + It is sufficient to check if any of the following occur: + - a proper intersection between the segment and any hot pixel edge. + - an intersection between the segment and BOTH the left and bottom hot pixel edges + (which detects the case where the segment intersects the bottom left hot pixel corner). + - an intersection between a segment endpoint and the hot pixel coordinate. + + + + + + + + Test whether the given segment intersects + the closure of this hot pixel. + This is NOT the test used in the standard snap-rounding + algorithm, which uses the partially closed tolerance square instead. + This routine is provided for testing purposes only. + + + + + + + + Adds a new node (equal to the snap pt) to the specified segment + if the segment passes through the hot pixel + + + + true if a node was added to the segment + + + + Gets the coordinate this hot pixel is based at. + + + + + "Snaps" all s in a containing + s to a given . + + + + + Initializes a new instance of the class. + + + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + The edge containing the vertex, if applicable, or null. + + true if a node was added for this pixel. + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + true if a node was added for this pixel. + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + Uses Snap Rounding to compute a rounded, + fully noded arrangement from a set of s. + Implements the Snap Rounding technique described in + papers by Hobby, Guibas and Marimont, and Goodrich et al. + Snap Rounding assumes that all vertices lie on a uniform grid; + hence the precision model of the input must be fixed precision, + and all the input vertices must be rounded to that precision. + + This implementation uses a monotone chains and a spatial index to + speed up the intersection tests. + This implementation appears to be fully robust using an integer precision model. + It will function with non-integer precision models, but the + results are not 100% guaranteed to be correctly noded. + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + + Does NOT node the segStrings. + + + + A list of Coordinates for the intersections. + + + + Snaps segments to nodes created by segment intersections. + + + + + + Snaps segments to all vertices + + The list of segment strings to snap together + + + + Snaps segments to the vertices of a Segment String. + + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + A Collection of NodedSegmentStrings representing the substrings + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + A collection of NodedSegmentStrings + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + Does NOT node the segStrings. + + + + A list of s for the intersections. + + + + Computes nodes introduced as a result of snapping segments to snap points (hot pixels). + + + + + + + + + + + + + + Computes nodes introduced as a result of + snapping segments to vertices of other segments. + + The list of segment strings to snap together + + + + Performs a brute-force comparison of every segment in each . + This has n^2 performance. + + + + + + + Computes the boundary of a . + Allows specifying the to be used. + This operation will always return a of the appropriate + dimension for the boundary (even if the input geometry is empty). + The boundary of zero-dimensional geometries (Points) is + always the empty . + + Martin Davis + + + + A map which maintains the edges in sorted order around the node. + + + + + Stores an integer count, for use as a Map entry. + + Martin Davis + + + + Builds the buffer geometry for a given input geometry and precision model. + Allows setting the level of approximation for circular arcs, + and the precision model in which to carry out the computation. + + + When computing buffers in floating point double-precision + it can happen that the process of iterated noding can fail to converge (terminate). + In this case a will be thrown. + Retrying the computation in a fixed precision + can produce more robust results. + + + + Compute the change in depth as an edge is crossed from R to L + + + Creates a new BufferBuilder + + + + Inserted edges are checked to see if an identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + + + + Completes the building of the input subgraphs by depth-labelling them, + and adds them to the PolygonBuilder. + + + The subgraph list must be sorted in rightmost-coordinate order. + + the subgraphs to build + the PolygonBuilder which will build the final polygons + + + + Gets the standard result for an empty buffer. + Since buffer always returns a polygonal result, this is chosen to be an empty polygon. + + The empty result geometry + + + + Sets the precision model to use during the curve computation and noding, + if it is different to the precision model of the Geometry. + + + If the precision model is less than the precision of the Geometry precision model, + the Geometry must have previously been rounded to that precision. + + + + + Sets the to use during noding. + This allows choosing fast but non-robust noding, or slower + but robust noding. + + + + + Simplifies a buffer input line to remove concavities with shallow depth. + + + + The most important benefit of doing this + is to reduce the number of points and the complexity of + shape which will be buffered. + It also reduces the risk of gores created by + the quantized fillet arcs (although this issue + should be eliminated in any case by the + offset curve generation logic). + + + A key aspect of the simplification is that it + affects inside (concave or inward) corners only. + Convex (outward) corners are preserved, since they + are required to ensure that the generated buffer curve + lies at the correct distance from the input geometry. + + + Another important heuristic used is that the end segments + of the input are never simplified. This ensures that + the client buffer code is able to generate end caps faithfully. + + + No attempt is made to avoid self-intersections in the output. + This is acceptable for use for generating a buffer offset curve, + since the buffer algorithm is insensitive to invalid polygonal + geometry. However, + this means that this algorithm + cannot be used as a general-purpose polygon simplification technique. + + + Martin Davis + + + + Simplify the input coordinate list. + If the distance tolerance is positive, + concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, + concavities on the RIGHT side of the line are simplified. + + The coordinate list to simplify + simplification distance tolerance to use + The simplified coordinate list + + + + Simplify the input coordinate list. + + + If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. + + Simplification distance tolerance to use + + The simplified coordinates list + + + + + Uses a sliding window containing 3 vertices to detect shallow angles + in which the middle vertex can be deleted, since it does not + affect the shape of the resulting buffer in a significant way. + + + + + + Finds the next non-deleted index, or the end of the point array if none + + The start index to search from + The next non-deleted index, if any
+ or _inputLine.Length if there are no more non-deleted indices +
+
+ + + Checks for shallowness over a sample of points in the given section. + This helps to prevent the siplification from incrementally + "skipping" over points which are in fact non-shallow. + + A coordinate of section + A coordinate of section + The start index of section + The end index of section + The tolerated distance + + + + Computes the buffer of a geometry, for both positive and negative buffer distances. + + + + In GIS, the positive (or negative) buffer of a geometry is defined as + the Minkowski sum (or difference) of the geometry + with a circle of radius equal to the absolute value of the buffer distance. + In the CAD/CAM world buffers are known as offset curves. + In morphological analysis the + operation of positive and negative buffering + is referred to as erosion and dilation + + + The buffer operation always returns a polygonal result. + The negative or zero-distance buffer of lines and points is always an empty . + + + Since true buffer curves may contain circular arcs, + computed buffer polygons are only approximations to the true geometry. + The user can control the accuracy of the approximation by specifying + the number of linear segments used to approximate arcs. + This is specified via + or . + + + The of a linear buffer may be specified. + The following end cap styles are supported: +
    +
  • - the usual round end caps
  • +
  • - end caps are truncated flat at the line ends
  • +
  • - end caps are squared off at the buffer distance beyond the line ends
  • +
+
+ + The of the corners in a buffer may be specified. + The following join styles are supported: +
    +
  • - the usual round join
  • +
  • - corners are "sharp" (up to a distance limit})
  • +
  • - corners are beveled (clipped off)
  • +
+
+ + The buffer algorithm can perform simplification on the input to increase performance. + The simplification is performed a way that always increases the buffer area + (so that the simplified input covers the original input). + The degree of simplification can be specified with , + with a used otherwise. + Note that if the buffer distance is zero then so is the computed simplify tolerance, + no matter what the simplify factor. + +
+
+ + + A number of digits of precision which leaves some computational "headroom" + for floating point operations. + + + This value should be less than the decimal precision of double-precision values (16). + + + + + Compute a scale factor to limit the precision of + a given combination of Geometry and buffer distance. + The scale factor is determined by + the number of digits of precision in the (geometry + buffer distance), + limited by the supplied value. + + The scale factor is based on the absolute magnitude of the (geometry + buffer distance). + since this determines the number of digits of precision which must be handled. + + the Geometry being buffered + the buffer distance + the max # of digits that should be allowed by + the precision determined by the computed scale factor + + a scale factor for the buffer computation + + + + Computes the buffer of a geometry for a given buffer distance. + + the geometry to buffer + the buffer distance + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the buffer parameters to use + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the end cap style to use + the buffer of the input geometry + + + + Initializes a buffer computation for the given geometry + + the geometry to buffer + + + + Initializes a buffer computation for the given geometry + with the given set of parameters + + the geometry to buffer + the buffer parameters to use + + + + Returns the buffer computed for a geometry for a given buffer distance. + + the buffer distance + the buffer of the input geometry + + + + Specifies the end cap style of the generated buffer. + The styles supported are , , and . + The default is . + + + + + Sets the number of segments used to approximate a angle fillet + + + + + A value class containing the parameters which + specify how a buffer should be constructed. + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + Martin Davis + + + + The default number of facets into which to divide a fillet of 90 degrees. + A value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + + + + + The default mitre limit + Allows fairly pointy mitres. + + + + + The default simplify factor. + Provides an accuracy of about 1%, which matches + the accuracy of the parameter. + + + + + Creates a default set of parameters + + + + + Creates a set of parameters with the given quadrantSegments value. + + The number of quadrant segments to use + + + + Creates a set of parameters with the + given quadrantSegments and endCapStyle values. + + the number of quadrant segments to use + the end cap style to use + + + + Creates a set of parameters with the + given parameter values. + + the number of quadrant segments to use + the end cap style to use + the join style to use + the mitre limit to use + + + + Computes the maximum distance error due to a given level of approximation to a true arc. + + The number of segments used to approximate a quarter-circle + The error of approximation + + + + Gets/sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. + QuadrantSegments = 0joins are beveled + QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| + + For round joins, QuadrantSegments determines the maximum + error in the approximation to the true buffer curve. + The default value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + The error is always less than the buffer distance + (in other words, the computed buffer curve is always inside the true + curve). + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , + , and + . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), + and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + A connected subset of the graph of + DirectedEdges and Nodes. + Its edges will generate either + a single polygon in the complete buffer, with zero or more holes, or + one or more connected holes. + + + + + + + + + + Creates the subgraph consisting of all edges reachable from this node. + Finds the edges in the graph and the rightmost coordinate. + + A node to start the graph traversal from. + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + A node known to be in the subgraph. + + + + Adds the argument node and all its out edges to the subgraph + + The node to add. + The current set of nodes being traversed. + + + + + + + + + + + + + + + Compute depths for all dirEdges via breadth-first traversal of nodes in graph. + + Edge to start processing with. + + + + + + + + + + + + + + + + Find all edges whose depths indicates that they are in the result area(s). + Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + BufferSubgraphs are compared on the x-value of their rightmost Coordinate. + This defines a partial ordering on the graphs such that: + g1 >= g2 - Ring(g2) does not contain Ring(g1) + where Polygon(g) is the buffer polygon that is built from g. + This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to + be built before holes. + + + + + + + + + + + + + + + Gets the rightmost coordinate in the edges of the subgraph. + + + + + Computes the raw offset curve for a + single component (ring, line or point). + A raw offset curve line is not noded - + it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded + to a given . + + + + + This method handles single points as well as LineStrings. + LineStrings are assumed not to be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + The vertices of the line to offset + The offset distance + A Coordinate array representing the curve
+ or null if the curve is empty +
+
+ + + This method handles the degenerate cases of single points and lines, + as well as rings. + + A Coordinate array representing the curve
+ or null if the curve is empty
+
+ + + Computes the distance tolerance to use during input + line simplification. + + The buffer distance + The simplification tolerance + + + + Gets the buffer parameters being used to generate the curve. + + + + + Generates segments which form an offset curve. + Supports all end cap and join options + provided for buffering. + This algorithm implements various heuristics to + produce smoother, simpler curves which are + still within a reasonable tolerance of the + true curve. + + Martin Davis + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + The Closing Segment Length Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + Add last offset point + + + + + Adds the offset points for an outside (convex) turn + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point , terminating a line segment coming from + + + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments + around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. + Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc + between two specified angles. + The start and end point for the fillet are not added - + the caller must add them if required. + + Is -1 for a angle, 1 for a angle + The radius of the fillet + + + + Creates a circle around a point + + + + + Creates a square around a point + + + + + Gets whether the input has a narrow concave angle + (relative to the offset distance). + In this case the generated offset curve will contain self-intersections + and heuristic closing segments. + This is expected behaviour in the case of buffer curves. + For pure offset curves, + the output needs to be further treated + before it can be used. + + + + + A dynamic list of the vertices in a constructed offset curve. + Automatically removes adjacent vertices + which are closer than a given tolerance. + + Martin Davis + + + The distance below which two adjacent points on the curve + are considered to be coincident. + This is chosen to be a small fraction of the offset distance. + + + + Tests whether the given point is redundant + relative to the previous + point in the list (up to tolerance). + + + true if the point is redundant + + + + Computes the raw offset curve for a single component (ring, line or point). + + + A raw offset curve line is not noded - it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded to the required precision model. + + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + Use a value which results in a potential distance error which is + significantly less than the error due to + the quadrant segment discretization. + For QS = 8 a value of 100 is reasonable. + This should produce a maximum of 1% distance error. + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The Closing Segment Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + + This method handles single points as well as lines. + Lines are assumed to not be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + a List of Coordinate[] + + + + This method handles the degenerate cases of single points and lines, as well as rings. + + a List of Coordinate[] + + + Computes the distance tolerance to use during input + line simplification. + + @param distance the buffer distance + @return the simplification tolerance + + + + Adds the offset points for an outside (convex) turn + + + + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Add last offset point + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment () the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point p1, terminating a line segment coming from p0 + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + The base point + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + + + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc between two specified angles. + + + The start and end point for the fillet are not added - the caller must add them if required. + + The point around which to add the fillet points + The start angle (in radians) + The end angle (in radians) + Is -1 for a CW angle, 1 for a CCW angle + The radius of the fillet + + + + Adds a CW circle around a point + + + + + Adds a CW square around a point + + + + + Creates all the raw offset curves for a buffer of a Geometry. + Raw curves need to be noded together and polygonized to form the final buffer area. + + + + + + + + + + + + + Computes the set of raw offset curves for the buffer. + Each offset curve has an attached {Label} indicating + its left and right location. + + A Collection of SegmentStrings representing the raw buffer curves. + + + + Creates a {SegmentString} for a coordinate list which is a raw offset curve, + and adds it to the list of buffer curves. + The SegmentString is tagged with a Label giving the topology of the curve. + The curve may be oriented in either direction. + If the curve is oriented CW, the locations will be: + Left: Location.Exterior. + Right: Location.Interior. + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + + + + + + + + + + + + + Adds an offset curve for a polygon ring. + The side and left and right topological location arguments + assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged and the side flipped. + + The coordinates of the ring (must not contain repeated points). + The distance at which to create the buffer. + The side of the ring on which to construct the buffer line. + The location on the L side of the ring (if it is CW). + The location on the R side of the ring (if it is CW). + + + + The ringCoord is assumed to contain no repeated points. + It may be degenerate (i.e. contain only 1, 2, or 3 points). + In this case it has no area, and hence has a minimum diameter of 0. + + + + + + + + Tests whether a triangular ring would be eroded completely by the given + buffer distance. + This is a precise test. It uses the fact that the inner buffer of a + triangle converges on the inCentre of the triangle (the point + equidistant from all sides). If the buffer distance is greater than the + distance of the inCentre from a side, the triangle will be eroded completely. + This test is important, since it removes a problematic case where + the buffer distance is slightly larger than the inCentre distance. + In this case the triangle buffer curve "inverts" with incorrect topology, + producing an incorrect hole in the buffer. + + + + + + + + A list of the vertices in a constructed offset curve. + + Automatically removes close adjacent vertices. + Martin Davis + + + + Function to add a point + + + The point is only added if evaluates to false. + + The point to add. + + + + Tests whether the given point duplicates the previous point in the list (up to tolerance) + + The point to test + true if the point duplicates the previous point + + + + Automatically closes the ring (if it not alread is). + + + + + Gets/Sets the precision model to use when adding new points. + + + + + The distance below which two adjacent points on the curve are considered to be coincident. + + This is chosen to be a small fraction of the offset distance. + + + + Gets the Coordinates for the curve. + + + + + A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, + and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Locates a subgraph inside a set of subgraphs, + in order to determine the outside depth of the subgraph. + The input subgraphs are assumed to have had depths + already calculated for their edges. + + + + + + + + + + + + + + + + + + Finds all non-horizontal segments intersecting the stabbing line. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + A List of {DepthSegments} intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the list of dirEdges. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the input dirEdge. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + A segment from a directed edge which has been assigned a depth value + for its sides. + + + + + + + + + + + + Defines a comparison operation on DepthSegments + which orders them left to right. + Assumes the segments are normalized. + + The definition of ordering is: + + -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). + 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). + 0 : if the segments are identical + + + + Known Bugs: + + The logic does not obey the contract. + This is acceptable for the intended usage, but may cause problems if used with some + utilities in the .Net standard library (e.g. . + + + A DepthSegment + The comparison value + + + + Compare two collinear segments for left-most ordering. + If segs are vertical, use vertical ordering for comparison. + If segs are equal, return 0. + Segments are assumed to be directed so that the second coordinate is >= to the first + (e.g. up and to the right). + + A segment to compare. + A segment to compare. + + + + + + + + + + Finds the approximate maximum distance from a buffer curve to + the originating geometry. + + The approximate maximum distance is determined by testing + all vertices in the buffer curve, as well + as midpoints of the curve segments. + Due to the way buffer curves are constructed, this + should be a very close approximation. + This is similar to the Discrete Oriented Hausdorff distance + from the buffer curve to the input. + + mbdavis + + + + Validates that a given buffer curve lies an appropriate distance + from the input generating it. + + + Useful only for round buffers (cap and join). + Can be used for either positive or negative distances. + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + mbdavis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + + Checks that two geometries are at least a minumum distance apart. + + A geometry + A geometry + The minimum distance the geometries should be separated by + + + + Checks that the furthest distance from the buffer curve to the input + is less than the given maximum distance. + + + This uses the Oriented Hausdorff distance metric. It corresponds to finding + the point on the buffer curve which is furthest from some point on the input. + + A geometry + A geometry + The maximum distance that a buffer result can be from the input + + + + Gets a geometry which indicates the location and nature of a validation failure. + + The indicator is a line segment showing the location and size + of the distance discrepancy. + + + A geometric error indicator + or null, if no error was found + + + + Validates that the result of a buffer operation + is geometrically correct, within a computed tolerance. + + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + This test may be (much) more expensive than the original buffer computation. + + Martin Davis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + Checks whether the geometry buffer is valid, and returns an error message if not. + + + + + An appropriate error message
+ or nullif the buffer is valid
+ +
+ + + Gets the error message + + + + + Gets the error location + + + + + Gets a geometry which indicates the location and nature of a validation failure. + + If the failure is due to the buffer curve being too far or too close + to the input, the indicator is a line segment showing the location and size + of the discrepancy. + + + A geometric error indicator
+ or null, if no error was found
+
+ + + Computes the Euclidean distance (L2 metric) from a Point to a Geometry. + Also computes two points which are separated by the distance. + + + + + Contains a pair of points and the distance between them. + Provides methods to update with a new point pair with + either maximum or minimum distance. + + + + + Initializes the points, avoiding recomputing the distance. + + The first point + The second point + The distance between and + + + + A wrapper which + projects 3D coordinates into one of the + three Cartesian axis planes, + using the standard orthonormal projection + (i.e. simply selecting the appropriate ordinates into the XY ordinates). + The projected data is represented as 2D coordinates. + + Martin Davis + + + + Creates a wrapper projecting to the XY plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the XZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the YZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Find two points on two 3D s which lie within a given distance, + or else are the nearest points on the geometries (in which case this also + provides the distance between the geometries). + + 3D geometries have vertex Z ordinates defined. + 3D s are assumed to lie in a single plane (which is enforced if not actually the case). + 3D s and s may have any configuration. + + The distance computation also finds a pair of points in the input geometries + which have the minimum distance between them. If a point lies in the interior + of a line segment, the coordinate computed is a close approximation to the + exact point. + + The algorithms used are straightforward O(n^2) comparisons. This worst-case + performance could be improved on by using Voronoi techniques or spatial + indexes. + + 1.13 + + + + Compute the distance between the nearest points of two geometries. + + A geometry + A geometry + The distance between the geometries + + + + Test whether two geometries lie within a given distance of each other. + + A geometry + A geometry + The distance to test + true if g0.distance(g1) <= + + + + Compute the the nearest points of two geometries. The points are + presented in the same order as the input Geometries. + + A geometry + A geometry + The nearest points in the geometries + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + The distance on which to terminate the search + + + + Report the distance between the nearest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty
+ Thrown if either input geometry is null. +
+ + + Report the coordinates of the nearest points in the input geometries. The + points are presented in the same order as the input Geometries. + + A pair of s of the nearest points + + + + Gets the locations of the nearest points in the input geometries. The + locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points + + + + Finds the index of the "most polygonal" input geometry. + This optimizes the computation of the best-fit plane, + since it is cached only for the left-hand geometry. + + The index of the most polygonal geometry + + + + Convenience method to create a Plane3DPolygon + + + + + Computes distance between two polygons. + + + To compute the distance, compute the distance + between the rings of one polygon and the other polygon, + and vice-versa. + If the polygons intersect, then at least one ring must + intersect the other polygon. + Note that it is NOT sufficient to test only the shell rings. + A counter-example is a "figure-8" polygon A + and a simple polygon B at right angles to A, with the ring of B + passing through the holes of A. + The polygons intersect, + but A's shell does not intersect B, and B's shell does not intersect A. + + + Compute distance between a polygon and the rings of another. + + + Computes a point at a distance along a segment + specified by two relatively proportional values. + The fractional distance along the segment is d0/(d0+d1). + + @param p0 + start point of the segment + @param p1 + end point of the segment + @param d0 + proportional distance from start point to computed point + @param d1 + proportional distance from computed point to end point + @return the computed point + + + + Models a polygon lying in a plane in 3-dimensional Cartesian space. + The polygon representation is supplied + by a , + containing coordinates with XYZ ordinates. + 3D polygons are assumed to lie in a single plane. + The plane best fitting the polygon coordinates is + computed and is represented by a . + + Martin Davis + + + + Computes an average normal vector from a list of polygon coordinates. + Uses Newell's method, which is based + on the fact that the vector with components + equal to the areas of the projection of the polygon onto + the Cartesian axis planes is normal. + + @param seq the sequence of coordinates for the polygon + @return a normal vector + + + Computes a point which is the average of all coordinates + in a sequence. + If the sequence lies in a single plane, + the computed point also lies in the plane. + + @param seq a coordinate sequence + @return a Coordinate with averaged ordinates + + + + A ConnectedElementPointFilter extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list. The elements of the list are + com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + Returns a list containing a point from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. The elements of the list + are com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + + + + + + + + + + + + + Extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list + + + + + Returns a list containing a Coordinate from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. + + + + + + + + + + + + + + + + + Computes the distance and + closest points between two Geometrys. + The distance computation finds a pair of points in the input geometries + which have minimum distance between them. These points may + not be vertices of the geometries, but may lie in the interior of + a line segment. In this case the coordinate computed is a close + approximation to the exact point. + The algorithms used are straightforward O(n^2) + comparisons. This worst-case performance could be improved on + by using Voronoi techniques. + + + + + Compute the distance between the closest points of two geometries. + + A Geometry. + Another Geometry. + The distance between the geometries. + + + + Test whether two geometries lie within a given distance of each other. + + + + + + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + The distance on which to terminate the search. + + + + Report the distance between the closest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty.
+ if either input geometry is null +
+ + + Report the coordinates of the closest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the closest points. + + + + Report the locations of the closest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the closest points. + + + + Report the coordinates of the nearest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the nearest points. + + + + Report the locations of the nearest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points. + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes distance between facets (lines and points) of input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a sequence of facets (points or line segments) of a + specified by a subsequence of a . + + Martin Davis + + + + Creates a new section based on a CoordinateSequence. + + The sequence holding the points in the section + The index of the start point + The index of the end point + 1 + + + + Creates a new sequence for a single point from a CoordinateSequence. + + The sequence holding the points in the facet sequence + the index of the point + + + + Gets the coordinate at the given index + + The index + The coordinate at the given index + + + + Computes the distance to another facet sequence + + The other facet sequence + The distance between this and . + + + + Gets the envelope of this facet sequence + + + + + Gets the number of coordinates in this facet sequence + + + + + Tests if this facet sequence consists of only one point + + + + + Utility class to build facet sequencs STRtrees- + + + + + + + + + + + + Creates facet sequences from a given geometry + + The geometry + A list of s + + + + Represents the location of a point on a Geometry. + Maintains both the actual point location + (which may not be exact, if the point is not a vertex) + as well as information about the component + and segment index where the point occurs. + Locations inside area Geometrys will not have an associated segment index, + so in this case the segment index will have the sentinel value of . + + + + + A special value of segmentIndex used for locations inside area geometries. + These locations are not located on a segment, + and thus do not have an associated segment index. + + + + + Constructs a GeometryLocation specifying a point on a point, as well as the + segment that the point is on (or if the point is not on a segment). + + The component of the geometry containing the point + The segment index of the location, or + The coordinate of the location + + + + Constructs a GeometryLocation specifying a point inside an area point. + + The component of the geometry containing the point + The coordinate of the location + + + + Returns the geometry component on (or in) which this location occurs. + + + + + Returns the segment index for this location. If the location is inside an + area, the index will have the value . + + + + + Returns the of this location. + + + + + Tests whether this location represents a point inside an area geometry. + + + + + Computes the distance between the facets (segments and vertices) + of two s + using a Branch-and-Bound algorithm. + The Branch-and-Bound algorithm operates over a + traversal of R-trees built + on the target and possibly also the query geometries. + + This approach provides the following benefits: + + + Performance is improved due to the effects of the R-tree index + and the pruning due to the Branch-and-Bound approach + + The spatial index on the target geometry can be cached + to allow reuse in an incremental query situation. + + Using this technique can be much more performant + than using + when one or both input geometries are large, + or when evaluating many distance computations against + a single geometry. + + + This class is not thread-safe. + + Martin Davis + + + + + Computes the distance between two geometries using the indexed approach. + + + For geometries with many segments or points, + this can be faster than using a simple distance + algorithm. + + A geometry + A geometry + The distance between the two geometries + + + + Creates a new distance-finding instance for a given target . + + + + Distances will be computed to all facets of the input geometry. + The facets of the geometry are the discrete segments and points + contained in its components. + + In the case of and inputs, + this is equivalent to computing the conventional distance. + + In the case of inputs, this is equivalent + to computing the distance to the polygons boundaries. + + + A Geometry, which may be of any type. + + + + Computes the distance from the base geometry to the given geometry. + + The geometry to compute the distance to. + The computed distance + + + * Tests whether the base geometry lies within + * a specified distance of the given geometry. + * + //* @param g the geomtry to test + //* @param maximumDistance the maximum distance to test + //* @return true if the geometry lies with the specified distance + + + + The base class for operations that require s. + + + + + + + + + + The operation args into an array so they can be accessed by index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether a is simple. + In general, the SFS specification of simplicity + follows the rule: + + + A Geometry is simple if and only if the only self-intersections are at boundary points. + + + + + Simplicity is defined for each } subclass as follows: + + Valid geometries are simple by definition, so + IsSimple trivially returns true.
+ (Note: this means that IsSimple cannot be used to test + for (invalid) self-intersections in Polygons. + In order to check if a Polygonal geometry has self-intersections, + use ).
+ geometries are simple if and only if they do not self-intersect at interior points + (i.e. points other than boundary points). + This is equivalent to saying that no two linear components satisfy the SFS + predicate. + Zero-dimensional () geometries are simple if and only if they have no + repeated points. + Empty s are always simple by definition. +
+ For geometries the evaluation of simplicity + can be customized by supplying a + to define how boundary points are determined. + The default is the SFS-standard . + Note that under the Mod-2 rule, closed LineStrings (rings) + will never satisfy the touches predicate at their endpoints, since these are + interior points, not boundary points. + If it is required to test whether a set of LineStrings touch + only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. + For example, this can be used to validate that a set of lines form a topologically valid + linear network. +
+
+ + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + + + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + The geometry to test + + + + Creates a simplicity checker using a given + + The geometry to test + The rule to use + + + + Tests whether the geometry is simple. + + true if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + A MultiPoint is simple if it has no repeated points. + + + + + Computes simplicity for polygonal geometries. + Polygonal geometries are simple if and only if + all of their component rings are simple. + + A Polygonal geometry + true if the geometry is simple + + + Semantics for GeometryCollection is + simple iff all components are simple. + A GeometryCollection + true if the geometry is simple + + + + For all edges, check if there are any intersections which are NOT at an endpoint. + The Geometry is not simple if there are intersections not at endpoints. + + + + + + Tests that no edge intersection is the endpoint of a closed line. + This ensures that closed lines are not touched at their endpoint, + which is an interior point according to the Mod-2 rule + To check this we compute the degree of each endpoint. + The degree of endpoints of closed lines + must be exactly 2. + + + + + Add an endpoint to the map, creating an entry for it if none exists. + + + + + + + + Gets a coordinate for the location where the geometry fails to be simple. + (i.e. where it has a non-boundary self-intersection). + must be called before this location is accessed + + a coordinate for the location of the non-boundary self-intersection + or null if the geometry is simple + + + + + + + + + Creates an instance of this class + + The endpoint + + + + A sequence of LineMergeDirectedEdges forming one of the lines that will + be output by the line-merging process. + + + + + Constructs an EdgeString with the given factory used to convert this EdgeString + to a LineString. + + + + + + Adds a directed edge which is known to form part of this line. + + + + + + Converts this EdgeString into a LineString. + + + + + + + + + + A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. + + + + + Represents a directed edge in a PlanarGraph. A DirectedEdge may or + may not have a reference to a parent Edge (some applications of + planar graphs may not require explicit Edge objects to be created). Usually + a client using a PlanarGraph will subclass DirectedEdge + to add its own application-specific data and methods. + + + + + The base class for all graph component classes. + Maintains flags of use in generic graph algorithms. + Provides two flags: + marked - typically this is used to indicate a state that persists + for the course of the graph's lifetime. For instance, it can be + used to indicate that a component has been logically deleted from the graph. + visited - this is used to indicate that a component has been processed + or visited by an single graph algorithm. For instance, a breadth-first traversal of the + graph might use this to indicate that a node has already been traversed. + The visited flag may be set and cleared many times during the lifetime of a graph. + + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Finds the first + in a set + which has the specified state. + + A to scan. + The state to test. + The first found, or null if none found. + + + + Tests if a component has been visited during the course of a graph algorithm. + + + + + Gets/Sets the visited flag for this component. + + + + + Tests if a component has been marked at some point during the processing + involving this graph. + + + + + Gets/Sets the marked flag for this component. + + + + + Tests whether this component has been removed from its containing graph. + + + + + Gets or sets user defined data for this component + + + + + Returns a List containing the parent Edge (possibly null) for each of the given + DirectedEdges. + + + + + + + Constructs a DirectedEdge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Writes a detailed string representation of this DirectedEdge to the given PrintStream. + + + + + + Removes this directed edge from its containing graph. + + + + + Returns this DirectedEdge's parent Edge, or null if it has none. + Associates this DirectedEdge with an Edge (possibly null, indicating no associated + Edge). + + + + + Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's + orientation lies. + + + + + Returns a point to which an imaginary line is drawn from the from-node to + specify this DirectedEdge's orientation. + + + + + Returns whether the direction of the parent Edge (if any) is the same as that + of this Directed Edge. + + + + + Returns the node from which this DirectedEdge leaves. + + + + + Returns the node to which this DirectedEdge goes. + + + + + Returns the coordinate of the from-node. + + + + + Returns the angle that the start of this DirectedEdge makes with the + positive x-axis, in radians. + + + + + Returns the symmetric DirectedEdge -- the other DirectedEdge associated with + this DirectedEdge's parent Edge. + Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite + direction. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeDirectedEdge connecting the from node to the to node. + + + + + specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the directed edge that starts at this directed edge's end point, or null + if there are zero or multiple directed edges starting there. + + + + + An edge of a LineMergeGraph. The marked field indicates + whether this Edge has been logically deleted from the graph. + + + + + Represents an undirected edge of a {PlanarGraph}. An undirected edge + in fact simply acts as a central point of reference for two opposite + DirectedEdges. + Usually a client using a PlanarGraph will subclass Edge + to add its own application-specific data and methods. + + + + + The two DirectedEdges associated with this Edge. + + + + + Constructs an Edge whose DirectedEdges are not yet set. Be sure to call + SetDirectedEdges(DirectedEdge, DirectedEdge). + + + + + Constructs an Edge initialized with the given DirectedEdges, and for each + DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds + this Edge to its from-Node. + + + + + + + Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the + Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. + + + + + + + Returns one of the DirectedEdges associated with this Edge. + + 0 or 1. + + + + + Returns the DirectedEdge that starts from the given node, or null if the + node is not one of the two nodes associated with this Edge. + + + + + + + If node is one of the two nodes associated with this Edge, + returns the other node; otherwise returns null. + + + + + + + Removes this edge from its containing graph. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeEdge with vertices given by the specified LineString. + + + + + + Returns the LineString specifying the vertices of this edge. + + + + + A planar graph of edges that is analyzed to sew the edges together. The + marked flag on com.vividsolutions.planargraph.Edges + and com.vividsolutions.planargraph.Nodes indicates whether they have been + logically deleted from the graph. + + + + + Represents a directed graph which is embeddable in a planar surface. + This class and the other classes in this package serve as a framework for + building planar graphs for specific algorithms. This class must be + subclassed to expose appropriate methods to construct the graph. This allows + controlling the types of graph components ({DirectedEdge}s, + Edges and Nodes) which can be added to the graph. An + application which uses the graph framework will almost always provide + subclasses for one or more graph components, which hold application-specific + data and graph algorithms. + + + + + + + + + + + + + + + + + + + + Returns the at the given location, or null if no was there. + + The location + The node found
+ or null if this graph contains no node at the location +
+
+ + + Adds a node to the map, replacing any that is already at that location. + Only subclasses can add Nodes, to ensure Nodes are of the right type. + + + The added node. + + + + Adds the Edge and its DirectedEdges with this PlanarGraph. + Assumes that the Edge has already been created with its associated DirectEdges. + Only subclasses can add Edges, to ensure the edges added are of the right class. + + + + + + Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, + to ensure the edges added are of the right class. + + + + + + Returns an IEnumerator over the Nodes in this PlanarGraph. + + + + + + Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they + were added. + + + + + + Returns an Iterator over the Edges in this PlanarGraph, in the order in which they + were added. + + + + + + Removes an Edge and its associated DirectedEdges from their from-Nodes and + from this PlanarGraph. Note: This method does not remove the Nodes associated + with the Edge, even if the removal of the Edge reduces the degree of a + Node to zero. + + + + + + Removes a from its from- and from this PlanarGraph. + + + This method does not remove the s associated with the DirectedEdge, + even if the removal of the DirectedEdge reduces the degree of a Node to zero. + + + + + + Removes a node from the graph, along with any associated DirectedEdges and + Edges. + + + + + + Returns all Nodes with the given number of Edges around it. + + + + + + + Returns the Nodes in this PlanarGraph. + + + + + Returns the Edges that have been added to this PlanarGraph. + + + + + Adds an Edge, DirectedEdges, and Nodes for the given LineString representation + of an edge. + + + + + + + + + + + + Sews together a set of fully noded LineStrings. + + + Sewing stops at nodes of degree 1 + or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, + in which case a node is simply chosen as a starting point. The direction of each + merged LineString will be that of the majority of the LineStrings from which it + was derived. + + Any dimension of Geometry is handled -- the constituent linework is extracted to + form the edges. The edges must be correctly noded; that is, they must only meet + at their endpoints. The LineMerger will still run on incorrectly noded input + but will not form polygons from incorrected noded edges. + + NOTE:once merging has been performed, no more + + + + + Adds a Geometry to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the LineStrings built by the merging process. + + + + + + + + + + + + + + + + + + + + + + + + Builds a sequence from a set of s, + so that they are ordered end to end. + A sequence is a complete non-repeating list of the linear + components of the input. Each linestring is oriented + so that identical endpoints are adjacent in the list. + + + The input linestrings may form one or more connected sets. + The input linestrings should be correctly noded, or the results may + not be what is expected. + The output of this method is a single , + containing the ordered linestrings in the sequence. + + + The sequencing employs the classic 'Eulerian path' graph algorithm. + Since Eulerian paths are not uniquely determined, further rules are used to + make the computed sequence preserve as much as possible of the input ordering. + Within a connected subset of lines, the ordering rules are: + - If there is degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If there is a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + + + Not all arrangements of lines can be sequenced. + For a connected set of edges in a graph, + Euler's Theorem states that there is a sequence containing each edge once + if and only if there are no more than 2 nodes of odd degree. + If it is not possible to find a sequence, the + property will return false. + + + + + + Tests whether a is sequenced correctly. + s are trivially sequenced. + s are checked for correct sequencing. + Otherwise, IsSequenced is defined + to be true for geometries that are not lineal. + + The to test. + + true if the is sequenced or is not lineal. + + + + + Adds a of s to be sequenced. + May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be extracted. + + A of geometries to add. + + + + Adds a to be sequenced. + May be called multiple times. + Any dimension of may be added; + the constituent linework will be extracted. + + + + + + Tests whether the arrangement of linestrings has a valid sequence. + + true if a valid sequence exists. + + + + Returns the or + built by the sequencing process, if one exists. + + The sequenced linestrings, + or null if a valid sequence does not exist. + + + + Tests whether a complete unique path exists in a graph + using Euler's Theorem. + + The containing the edges. + true if a sequence exists. + + + + Finds an for an unvisited edge (if any), + choosing the which preserves orientation, if possible. + + The to examine. + + The found, + or null if none were unvisited. + + + + + Computes a version of the sequence which is optimally + oriented relative to the underlying geometry. + + Heuristics used are: + - If the path has a degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If the path has a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + (NOTE: in this case could orient the sequence according to the majority of the + linestring orientations). + + + A of s. + + A of s oriented appropriately. + + + + + Reverse the sequence. + This requires reversing the order of the s, + and flipping each as well. + + + A enumeration of s, + in sequential order. + + The reversed sequence. + + + + Builds a geometry ( or ) + representing the sequence. + + + An enumeration of s of s + with s as their parent edges. + + + The sequenced geometry, or null if no sequence exists. + + + + + A private implementation for + + + + + Initializes a new instance of the class. + + The sequencer. + + + + Performs an operation with or on + + + A to which the filter is applied. + + + + + Nodes a set of edges. + Takes one or more sets of edges and constructs a + new set of edges consisting of all the split edges created by + noding the input edges together. + + + + + + + + + + + + + + + + + + + + + + Forms NTS LineStrings out of a the graph of DirectedEdges + created by an OverlayOp. + + + + + + + + + + + + + + + + + A list of the LineStrings in the result of the specified overlay operation. + + + + + Find and mark L edges which are "covered" by the result area (if any). + L edges at nodes which also have A edges can be checked by checking + their depth at that node. + L edges at nodes which do not have A edges can be checked by doing a + point-in-polygon test with the previously computed result areas. + + + + + + + + + + + + + + + + + + + Collect edges from Area inputs which should be in the result but + which have not been included in a result area. + This happens ONLY: + during an intersection when the boundaries of two + areas touch in a line segment + OR as a result of a dimensional collapse. + + + + + + + + + + + + + + + + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A ring of edges which may contain nodes of degree > 2. + A MaximalEdgeRing may represent two different spatial entities: + a single polygon possibly containing inversions (if the ring is oriented CW) + a single hole possibly containing exversions (if the ring is oriented CCW) + If the MaximalEdgeRing represents a polygon, + the interior of the polygon is strongly connected. + These are the form of rings used to define polygons under some spatial data models. + However, under the OGC SFS model, MinimalEdgeRings are required. + A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the + BuildMinimalRings() method. + + + + + + + + + + + + + + + + + + + + + + + + + + For all nodes in this EdgeRing, + link the DirectedEdges at the node to form minimalEdgeRings + + + + + + + + + + + A ring of edges with the property that no node + has degree greater than 2. These are the form of rings required + to represent polygons under the OGC SFS spatial data model. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates nodes for use in the PlanarGraphs constructed during + overlay operations. + + + + + + + + + + + + The spatial functions supported by this class. + These operations implement various bool combinations of the resultants of the overlay. + + + + + The code for the Intersection overlay operation + + + + + The code for the Union overlay operation + + + + + The code for the Difference overlay operation + + + + + The code for the Symmetric Difference overlay operation + + + + + Computes the geometric overlay of two s. The overlay + can be used to determine any bool combination of the geometries. + + + + + Computes an overlay operation + for the given geometry arguments. + + The first geometry argument + The second geometry argument + The code for the desired overlay operation + The result of the overlay operation + Thrown if a robustness problem is encountered. + + + + Tests whether a point with a given topological + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + The topological label of the point + The code for the overlay operation to test + true if the label locations correspond to the overlayOpCode + + + + Tests whether a point with given s + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + the code for the location in the first geometry + the code for the location in the second geometry + the code for the overlay operation to test + true if the locations correspond to the overlayOpCode. + + + + Constructs an instance to compute a single overlay operation + for the given geometries. + + The first geometry argument + The second geometry argument + + + + Gets the result of the overlay for a given overlay operation. + + Note: this method can be called once only. + + The code of the overlay operation to perform + The computed result geometry + Thrown if a robustness problem is encountered + + + + Insert an edge from one of the noded input graphs. + Checks edges that are inserted to see if an + identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + The edge to insert + + + + Update the labels for edges according to their depths. + For each edge, the depths are first normalized. + Then, if the depths for the edge are equal, + this edge must have collapsed into a line edge. + If the depths are not equal, update the label + with the locations corresponding to the depths + (i.e. a depth of 0 corresponds to a Location of Exterior, + a depth of 1 corresponds to Interior) + + + + + If edges which have undergone dimensional collapse are found, + replace them with a new edge which is a L edge + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a previously computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Compute initial labelling for all DirectedEdges at each node. + In this step, DirectedEdges will acquire a complete labelling + (i.e. one with labels for both Geometries) + only if they + are incident on a node which has edges for both Geometries + + + + + For nodes which have edges from only one Geometry incident on them, + the previous step will have left their dirEdges with no labelling for the other + Geometry. However, the sym dirEdge may have a labelling for the other + Geometry, so merge the two labels. + + + + + Incomplete nodes are nodes whose labels are incomplete. + (e.g. the location for one Geometry is null). + These are either isolated nodes, + or nodes which have edges from only a single Geometry incident on them. + Isolated nodes are found because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + When each node labelling is completed, the labelling of the incident + edges is updated, to complete their labelling as well. + + + + + Label an isolated node with its relationship to the target point. + + + + + Find all edges whose label indicates that they are in the result area(s), + according to the operation being performed. Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + If both a dirEdge and its sym are marked as being in the result, cancel + them out. + + + + + Tests if a point node should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Line or Area geometry. + + + + Tests if an L edge should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Area geometry. + + + + true if the coord is located in the interior or boundary of + a point in the list. + + + + + Creates an empty result geometry of the appropriate dimension, + based on the given overlay operation and the dimensions of the inputs. + The created geometry is always an atomic geometry, + not a collection. + + The empty result is constructed using the following rules: + + - result has the dimension of the lowest input dimension + - result has the dimension of the highest input dimension + - result has the dimension of the left-hand input + - result has the dimension of the highest input dimension + (since symDifference is the union of the differences). + + + The overlay operation being performed + An input geometry + An input geometry + The geometry factory being used for the operation + An empty atomic geometry of the appropriate dimension + + + + Disable + when an intersection is made (), + so performances are dramatically improved but failures are not managed. + + + Use ay your own risk! + + + + + Gets the graph constructed to compute the overlay. + + + + + Constructs Points from the nodes of an overlay graph. + + + + + + + + + + + + + + + + + A list of the Points in the result of the specified overlay operation. + + + + + + + + + + + + This method simplifies the resultant Geometry by finding and eliminating + "covered" points. + A point is covered if it is contained in another element Geometry + with higher dimension (e.g. a point might be contained in a polygon, + in which case the point can be eliminated from the resultant). + + + + + + + Forms Polygons out of a graph of {DirectedEdge}s. + The edges to use are marked as being in the result Area. + + + + + + + + + + + Add a complete graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + Add a set of edges and nodes, which form a graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + + For all DirectedEdges in result, form them into MaximalEdgeRings. + + + + + + + + + + + + + + + + This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, + and tests whether they form a Polygon. This is the case if there is a single shell + in the list. In this case the shell is returned. + The other possibility is that they are a series of connected holes, in which case + no shell is returned. + + The shell EdgeRing, if there is one
or + null, if all the rings are holes.
+
+ + + This method assigns the holes for a Polygon (formed from a list of + MinimalEdgeRings) to its shell. + Determining the holes for a MinimalEdgeRing polygon serves two purposes: + it is faster than using a point-in-polygon check later on. + it ensures correctness, since if the PIP test was used the point + chosen might lie on the shell, which might return an incorrect result from the + PIP test. + + + + + + + For all rings in the input list, + determine whether the ring is a shell or a hole + and add it to the appropriate list. + Due to the way the DirectedEdges were linked, + a ring is a shell if it is oriented CW, a hole otherwise. + + + + + + + + This method determines finds a containing shell for all holes + which have not yet been assigned to a shell. + These "free" holes should + all be properly contained in their parent shells, so it is safe to use the + findEdgeRingContaining method. + (This is the case because any holes which are NOT + properly contained (i.e. are connected to their + parent shell) would have formed part of a MaximalEdgeRing + and been handled in a previous step). + + + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
or + null if no containing EdgeRing is found.
+
+ + + + + + + + + + Checks the current set of shells (with their associated holes) to + see if any of them contain the point. + + + + + + + + + + + + Snaps the vertices and segments of a + to another Geometry's vertices. + A snap distance tolerance is used to control where snapping is performed. + Snapping one geometry to another can improve + robustness for overlay operations by eliminating + nearly-coincident edges + (which cause problems during noding and intersection calculation). + It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. + Too much snapping can result in invalid topology + beging created, so the number and location of snapped vertices + is decided using heuristics to determine when it + is safe to snap. + This can result in some potential snaps being omitted, however. + + Martin Davis + + + + Estimates the snap tolerance for a Geometry, taking into account its precision model. + + + The estimated snap tolerance + + + + + + + + + + + + + + + + + + + Snaps two geometries together with a given tolerance. + + + + + + + + + Snaps a geometry to itself. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. + + the geometry to snap + the snapping tolerance + whether the result should be made valid + a new snapped + + + + Creates a new snapper acting on the given geometry + + the geometry to snap + + + + Snaps the vertices in the component s + of the source geometry to the vertices of the given snap geometry. + + a geometry to snap the source to + + a new snapped Geometry + + + Snaps the vertices in the component s + of the source geometry to the vertices of the same geometry. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + The snapping tolerance + Whether the result should be made valid + The geometry snapped to itself + + + + + + + + + + + Computes the snap tolerance based on the input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snaps the vertices and segments of a + to a set of target snap vertices. + A snap distance tolerance is used to control where snapping is performed. + The implementation handles empty geometry and empty snap vertex sets. + + + + + Creates a new snapper using the points in the given + as target snap points. + + A LineString to snap (may be empty) + the snap tolerance to use + + + + Creates a new snapper using the given points + as source points to be snapped. + + + + + + + Snaps the vertices and segments of the source LineString + to the given set of snap points. + + the vertices to snap to + list of the snapped points + + + + Snap source vertices to vertices in the target. + + the points to snap + the points to snap to + + + + + + + + + + + + Snap segments of the source to nearby snap vertices. + Source segments are "cracked" at a snap vertex. + A single input segment may be snapped several times + to different snap vertices. + For each distinct snap vertex, at most one source segment + is snapped to. This prevents "cracking" multiple segments + at the same point, which would likely cause + topology collapse when being used on polygonal linework. + + The coordinates of the source linestring to snap + The target snap vertices + + + + Finds a src segment which snaps to (is close to) the given snap point + Only a single segment is selected for snapping. + This prevents multiple segments snapping to the same snap vertex, + which would almost certainly cause invalid geometry + to be created. + (The heuristic approach of snapping used here + is really only appropriate when + snap pts snap to a unique spot on the src geometry) + Also, if the snap vertex occurs as a vertex in the src coordinate list, + no snapping is performed. + + The point to snap to + The source segment coordinates + The index of the snapped segment
+ or -1 if no segment snaps to the snap point.
+
+ + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class only uses snapping + if an error is detected when running the standard JTS overlay code. + Errors detected include thrown exceptions + (in particular, ) + and invalid overlay computations. + + + + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class always uses snapping. + This is less performant than the standard JTS overlay code, + and may even introduce errors which were not present in the original data. + For this reason, this class should only be used + if the standard overlay code fails to produce a correct result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds the most likely of a point relative to + the polygonal components of a geometry, using a tolerance value. + + + If a point is not clearly in the Interior or Exterior, + it is considered to be on the Boundary. + In other words, if the point is within the tolerance of the Boundary, + it is considered to be on the Boundary; otherwise, + whether it is Interior or Exterior is determined directly. + + Martin Davis + + + + Extracts linework for polygonal components. + + The geometry from which to extract + A lineal geometry containing the extracted linework + + + + Extracts the LineStrings in the boundaries of all the polygonal elements in the target . + + Martin Davis + + + + Filters out all linework for polygonal elements + + + + + Gets the list of polygonal linework. + + + + + Generates points offset by a given distance from both sides of the midpoint of all segments in a . + + + + Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. + + + The input geometry may have any orientation for its rings, + but is + only meaningful if the orientation is known. + + + Martin Davis + + + Set the sides on which to generate offset points. + + @param doLeft + @param doRight + + + + Gets the computed offset points. + + + + + Generates the two points which are offset from the + midpoint of the segment (p0, p1) by the offsetDistance + + The first point of the segment to offset from. + The second point of the segment to offset from + + + + + + Validates that the result of an overlay operation is geometrically correct within a determined tolerance. + Uses fuzzy point location to find points which are + definitely in either the interior or exterior of the result + geometry, and compares these results with the expected ones. + + + This algorithm is only useful where the inputs are polygonal. + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + Martin Davis + + + + + Represents a ring of PolygonizeDirectedEdges which form + a ring of a polygon. The ring may be either an outer shell or a hole. + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
+ or null if no containing EdgeRing is found.
+
+ + + Finds a point in a list of points which is not contained in another list of points. + + The Coordinates to test. + An array of Coordinates to test the input points against. + A Coordinate from testPts which is not in pts,
+ or null.
+
+ + + Tests whether a given point is in an array of points. + Uses a value-based test. + + A Coordinate for the test point. + An array of Coordinates to test, + true if the point is in the array. + + + Traverses a ring of DirectedEdges, accumulating them into a list. + This assumes that all dangling directed edges have been removed + from the graph, so that there is always a next dirEdge. + + @param startDE the DirectedEdge to start traversing at + @return a List of DirectedEdges that form a ring + + + + + + + + + + Adds a DirectedEdge which is known to form part of this ring. + + The DirectedEdge to add. + + + + Computes whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + + + + Adds a hole to the polygon formed by this ring. + + The LinearRing forming the hole. + + + + Adds a hole to the polygon formed by this ring. + + the forming the hole. + + + + + + + + + + + + Updates the included status for currently non-included shells + based on whether they are adjacent to an included shell. + + + + + Gets a string representation of this object. + + + + + Tests whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + true if this ring is a hole. + + + + Computes and returns the Polygon formed by this ring and any contained holes. + + + + + Tests if the ring formed by this edge ring is topologically valid. + + true if the ring is valid. + + + + Computes and returns the list of coordinates which are contained in this ring. + The coordinatea are computed once only and cached. + + + + + Gets the coordinates for this ring as a LineString. + Used to return the coordinates in this ring + as a valid point, when it has been detected that the ring is topologically + invalid. + + + + + Returns this ring as a LinearRing, or null if an Exception occurs while + creating it (such as a topology problem). Details of problems are written to + standard output. + + + + + Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. + + + + + Gets a value indicating whether this ring has a shell assigned to it. + + + + + Tests whether this ring is an outer hole. + A hole is an outer hole if it is not contained by a shell. + + + + + Tests whether this ring is an outer shell. + + + + + Gets or sets a value indicating whether this ring has been processed. + + + + + Compares EdgeRings based on their envelope, + using the standard lexicographic ordering. + This ordering is sufficient to make edge ring sorting deterministic. + + mbdavis + + + + A DirectedEdge of a PolygonizeGraph, which represents + an edge of a polygon formed by the graph. + May be logically deleted from the graph by setting the marked flag. + + + + + Constructs a directed edge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the identifier attached to this directed edge. + Attaches an identifier to this directed edge. + + + + + Returns the next directed edge in the EdgeRing that this directed edge is a member of. + Sets the next directed edge in the EdgeRing that this directed edge is a member of. + + + + + Returns the ring of directed edges that this directed edge is + a member of, or null if the ring has not been set. + + + + + Gets/Sets the ring of directed edges that this directed edge is + a member of. + + + + + An edge of a polygonization graph. + + + + + + + + + + + + + + + + Represents a planar graph of edges that can be used to compute a + polygonization, and implements the algorithms to compute the + EdgeRings formed by the graph. + The marked flag on DirectedEdges is used to indicate that a directed edge + has be logically deleted from the graph. + + + + + + + + + + + + + + + + + + + + Deletes all edges at a node. + + + + + + Create a new polygonization graph. + + + + + + Add a LineString forming an edge of the polygon graph. + + The line to add. + + + + + + + + + + + + + + + + Convert the maximal edge rings found by the initial graph traversal + into the minimal edge rings required by NTS polygon topology rules. + + The list of start edges for the edgeRings to convert. + + + + Finds all nodes in a maximal edgering which are self-intersection nodes + + + + + The list of intersection nodes found, + or null if no intersection nodes were found. + + + + + Computes the minimal EdgeRings formed by the edges in this graph. + + A list of the{EdgeRings found by the polygonization process. + + + + Finds and labels all edgerings in the graph. + The edge rings are labeling with unique integers. + The labeling allows detecting cut edges. + + A List of the DirectedEdges in the graph. + A List of DirectedEdges, one for each edge ring found. + + + + Finds and removes all cut edges from the graph. + + A list of the LineStrings forming the removed cut edges. + + + + + + + + + + + + + + + + + Computes the next edge pointers going CCW around the given node, for the + given edgering label. + This algorithm has the effect of converting maximal edgerings into minimal edgerings + + + + + + + + + + + + + + Marks all edges from the graph which are "dangles". + Dangles are which are incident on a node with degree 1. + This process is recursive, since removing a dangling edge + may result in another edge becoming a dangle. + In order to handle large recursion depths efficiently, + an explicit recursion stack is used. + + A List containing the s that formed dangles. + + + + Traverses the polygonized edge rings in the graph + and computes the depth parity (odd or even) + relative to the exterior of the graph. + + If the client has requested that the output + be polygonally valid, only odd polygons will be constructed. + + + + + Traverses all connected edges, computing the depth parity of the associated polygons. + + + + + + Polygonizes a set of s which contain linework that + represents the edges of a planar graph. + + + All types of Geometry are accepted as input; + the constituent linework is extracted as the edges to be polygonized. + The processed edges must be correctly noded; that is, they must only meet + at their endpoints. Polygonization will accept incorrectly noded input + but will not form polygons from non-noded edges, + and reports them as errors. + + The Polygonizer reports the follow kinds of errors: + Dangles - edges which have one or both ends which are not incident on another edge endpoint + Cut Edges - edges which are connected at both ends but which do not form part of polygon + Invalid Ring Lines - edges which form rings which are invalid + (e.g. the component lines contain a self-intersection). + + Polygonization supports extracting only polygons which form a valid polygonal geometry. + The set of extracted polygons is guaranteed to be edge-disjoint. + This is useful for situations where it is known that the input lines form a + valid polygonal geometry. + + + + + + The default polygonizer output behavior + + + + + Default linestring adder. + + + + + Creates a polygonizer with the same + as the input Geometrys. + The output mask is + + + + + + Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. + + true if only polygons which form a valid polygonal geometry are to be extracted + + + + Adds a collection of s to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used. + + A list of Geometrys with linework to be polygonized. + + + + Adds a to the linework to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used + + A Geometry with linework to be polygonized. + + + + Adds a to the graph of polygon edges. + + The to add. + + + + Gets the list of polygons formed by the polygonization. + + + + + Gets a geometry representing the polygons formed by the polygonization. + If a valid polygonal geometry was extracted the result is a geometry. + + A geometry containing the polygons + + + + Gets the list of dangling lines found during polygonization. + + + + + Gets the list of cut edges found during polygonization. + + + + + Gets the list of lines forming invalid rings found during polygonization. + + + + + Performs the polygonization, if it has not already been carried out. + + + + + For each outer hole finds and includes a single outer shell. + This seeds the travesal algorithm for finding only polygonal shells. + + The list of shell EdgeRings + + + + Allows disabling the valid ring checking, + to optimize situations where invalid rings are not expected. + + The default is true + + + + Adds every linear element in a into the polygonizer graph. + + + + + Filters all geometry instances + + The geometry instance + + + + Optimized implementation of spatial predicate "contains" + for cases where the first Geometry is a rectangle. + As a further optimization, + this class can be used directly to test many geometries against a single rectangle. + + + + + + + + + + + + + Create a new contains computer for two geometries. + + A rectangular geometry. + + + + + + + + + + + + + + + + + + + + + + + + + Tests if a point is contained in the boundary of the target rectangle. + + the point to test + true if the point is contained in the boundary + + + + Tests if a linestring is completely contained in the boundary of the target rectangle. + + the linestring to test + true if the linestring is contained in the boundary + + + + Tests if a line segment is contained in the boundary of the target rectangle. + + an endpoint of the segment + an endpoint of the segment + true if the line segment is contained in the boundary + + + I + Implementation of the Intersects spatial predicate + optimized for the case where one is a rectangle. + + + This class works for all input geometries, including s. + + As a further optimization, this class can be used in batch style + to test many geometries against a single rectangle. + + + + + Crossover size at which brute-force intersection scanning + is slower than indexed intersection detection. + Must be determined empirically. Should err on the + safe side by making value smaller rather than larger. + + + + + Tests whether a rectangle intersects a given geometry. + + A rectangular polygon + A geometry of any kind + true if the geometries intersect. + + + + Create a new intersects computer for a rectangle. + + A rectangular polygon. + + + + Tests whether the given Geometry intersects the query rectangle. + + The Geometry to test (may be of any type) + true if an intersection must occur + or false if no conclusion about intersection can be made + + + + Tests whether it can be concluded that a rectangle intersects a geometry, + based on the relationship of the envelope(s) of the geometry. + + Martin Davis + + + + Creates an instance of this class using the provided Envelope + + The query envelope + + + + + + + + + + + + + + + + Reports whether it can be concluded that an intersection occurs, + or whether further testing is required. + + true if an intersection must occur
+ or false if no conclusion about intersection can be made
+
+ + + A visitor which tests whether it can be + concluded that a geometry contains a vertex of + a query geometry. + + Martin Davis + + + + + + + + + + + + + + + + + + + + + + Gets a value indicating whether it can be concluded that a corner point of the rectangle is + contained in the geometry, or whether further testing is required. + + true if a corner point is contained + or false if no conclusion about intersection can be made + + + + + A visitor to test for intersection between the query rectangle and the line segments of the geometry. + + Martin Davis + + + + Creates a visitor for checking rectangle intersection with segments + + the query rectangle + + + Reports whether any segment intersection exists. + true if a segment intersection exists or + false if no segment intersection exists + + + + Tests if any line segments in two sets of intersect. + Optimized for use when at least one input is of small size. + Short-circuited to return as soon an intersection is found. + + + + + + + + + + + + + + + + + + + + + An EdgeEndBuilder creates EdgeEnds for all the "split edges" + created by the intersections determined for an Edge. + Computes the EdgeEnds which arise from a noded Edge. + + + + + + + + + + + + Creates stub edges for all the intersections in this + Edge (if any) and inserts them into the graph. + + + + + + + Create a EdgeStub for the edge before the intersection eiCurr. + The previous intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the previous point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiPrev may be null. + + + + + + + + + Create a StubEdge for the edge after the intersection eiCurr. + The next intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the next point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiNext may be null. + + + + + + + + + A collection of EdgeStubs which obey the following invariant: + They originate at the same node and have the same direction. + Contains all EdgeEnds which start at the same point and are parallel. + + + + + + + + + + + + + + + + + + + + + + + + This computes the overall edge label for the set of + edges in this EdgeStubBundle. It essentially merges + the ON and side labels for each edge. + These labels must be compatible + + + + + + Compute the overall ON location for the list of EdgeStubs. + (This is essentially equivalent to computing the self-overlay of a single Geometry) + edgeStubs can be either on the boundary (eg Polygon edge) + OR in the interior (e.g. segment of a LineString) + of their parent Geometry. + In addition, GeometryCollections use the to determine + whether a segment is on the boundary or not. + Finally, in GeometryCollections it can occur that an edge is both + on the boundary and in the interior (e.g. a LineString segment lying on + top of a Polygon edge.) In this case the Boundary is given precendence. + These observations result in the following rules for computing the ON location: + if there are an odd number of Bdy edges, the attribute is Bdy + if there are an even number >= 2 of Bdy edges, the attribute is Int + if there are any Int edges, the attribute is Int + otherwise, the attribute is Null. + + + + + + + Compute the labelling for each side + + + + + + To compute the summary label for a side, the algorithm is: + FOR all edges + IF any edge's location is Interior for the side, side location = Interior + ELSE IF there is at least one Exterior attribute, side location = Exterior + ELSE side location = Null + Note that it is possible for two sides to have apparently contradictory information + i.e. one edge side may indicate that it is in the interior of a point, while + another edge side may indicate the exterior of the same point. This is + not an incompatibility - GeometryCollections may contain two Polygons that touch + along an edge. This is the reason for Interior-primacy rule above - it + results in the summary label having the Geometry interior on both sides. + + + + + + + Update the IM with the contribution for the computed label for the EdgeStubs. + + + + + + + + + + + + + + + + + An ordered list of EdgeEndBundles around a RelateNode. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + Insert a EdgeEnd in order in the list. + If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is + added to the bundle. Otherwise, a new EdgeEndBundle is created + to contain the EdgeEnd. + + + + + + Update the IM with the contribution for the EdgeStubs around the node. + + + + + + Computes the topological relationship between two Geometries. + RelateComputer does not need to build a complete graph structure to compute + the IntersectionMatrix. The relationship between the geometries can + be computed by simply examining the labelling of edges incident on each node. + RelateComputer does not currently support arbitrary GeometryCollections. + This is because GeometryCollections can contain overlapping Polygons. + In order to correct compute relate on overlapping Polygons, they + would first need to be noded and merged (if not explicitly, at least + implicitly). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + For all intersections on the edges of a Geometry, + label the corresponding node IF it doesn't already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + If the Geometries are disjoint, we need to enter their dimension and + boundary dimension in the Ext rows in the IM + + + + + + + + + + + Update the IM with the sum of the IMs for each component. + + + + + + Processes isolated edges by computing their labelling and adding them + to the isolated edges list. + Isolated edges are guaranteed not to touch the boundary of the target (since if they + did, they would have caused an intersection to be computed and hence would + not be isolated). + + + + + + + Label an isolated edge of a graph with its relationship to the target point. + If the target has dim 2 or 1, the edge can either be in the interior or the exterior. + If the target has dim 0, the edge must be in the exterior. + + + + + + + + Isolated nodes are nodes whose labels are incomplete + (e.g. the location for one Geometry is null). + This is the case because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A RelateNode is a Node that maintains a list of EdgeStubs + for the edges that are incident on it. + + + + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + Update the IM with the contribution for the EdgeEnds incident on this node. + + + + + + Used by the NodeMap in a RelateNodeGraph to create RelateNodes. + + + + + + + + + + + + Implements the simple graph of Nodes and EdgeEnd which is all that is + required to determine topological relationships between Geometries. + Also supports building a topological graph of a single Geometry, to + allow verification of valid topology. + It is not necessary to create a fully linked + PlanarGraph to determine relationships, since it is sufficient + to know how the Geometries interact locally around the nodes. + In fact, this is not even feasible, since it is not possible to compute + exact intersection points, and hence the topology around those nodes + cannot be computed robustly. + The only Nodes that are created are for improper intersections; + that is, nodes which occur at existing vertices of the Geometries. + Proper intersections (e.g. ones which occur between the interior of line segments) + have their topology determined implicitly, without creating a Node object + to represent them. + + + + + + + + + + + + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + Precondition: edge intersections have been computed. + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule). + + + + + + + + + + + + + Implements the SFS relate() generalized spatial predicate on two s. +
+ The class supports specifying a custom + to be used during the relate computation. +
+ + If named spatial predicates are used on the result + of the RelateOp, the result may or not be affected by the + choice of BoundaryNodeRule, depending on the exact nature of the pattern. + For instance, is insensitive + to the choice of BoundaryNodeRule, + whereas is affected by the rule chosen. + + Note: custom Boundary Node Rules do not (currently) + affect the results of other methods (such + as . The results of + these methods may not be consistent with the relationship computed by + a custom Boundary Node Rule. + +
+ + + Computes the for the spatial relationship + between two s, using the default (OGC SFS) Boundary Node Rule + + A geometry to test + A geometry to test + The IntersectonMatrix for the spatial relationship between the geometries + + + + Computes the for the spatial relationship + between two s, using the specified Boundary Node Rule + + A geometry to test + A geometry to test + The Boundary Node Rule to use + The IntersectonMatrix for the spatial relationship between the geometries + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + The Boundary Node Rule to use + + + + Gets the IntersectionMatrix for the spatial relationship + between the input geometries. + + + + + Provides an efficient method of unioning a collection of + geometrys. + The geometries are indexed using a spatial index, + and unioned recursively in index order. + For geometries with a high degree of overlap, + this has the effect of reducing the number of vertices + early in the process, which increases speed + and robustness. + + This algorithm is faster and more robust than + the simple iterated approach of + repeatedly unioning each polygon to a result geometry. + + The buffer(0) trick is sometimes faster, but can be less robust and + can sometimes take a long time to complete. + This is particularly the case where there is a high degree of overlap + between the polygons. In this case, buffer(0) is forced to compute + with all line segments from the outset, + whereas cascading can eliminate many segments + at each stage of processing. + The best situation for using buffer(0) is the trivial case + where there is no overlap between the input geometries. + However, this case is likely rare in practice. + + Martin Davis + + + + The effectiveness of the index is somewhat sensitive + to the node capacity. + Testing indicates that a smaller capacity is better. + For an STRtree, 4 is probably a good number (since + this produces 2x2 "squares"). + + + + Computes the union of + a collection of s. + + A collection of s. + + + + + Creates a new instance to union + the given collection of s. + + A collection of s + + + + Computes the union of the input geometries. + + + + This method discards the input geometries as they are processed. + In many input cases this reduces the memory retained + as the operation proceeds. + Optimal memory usage is achieved + by disposing of the original input collection + before calling this method. + + The union of the input geometries, + or null if no input geometries were provided + + if this method is called more than once + + + + Unions a list of geometries + by treating the list as a flattened binary tree, + and performing a cascaded union on the tree. + + The list of geometries to union + The union of the list + + + + Unions a section of a list using a recursive binary union on each half + of the section. + + The list of geometries containing the section to union + The start index of the section + The index after the end of the section + The union of the list section + + + + Gets the element at a given list index, or + null if the index is out of range. + + The list of geometries + The index + The geometry at the given index or + null if the index is out of range + + + + Reduces a tree of geometries to a list of geometries + by recursively unioning the subtrees in the list. + + A tree-structured list of geometries + A list of Geometrys + + + + Computes the union of two geometries, + either or both of which may be null. + + A Geometry + A Geometry + The union of the input(s) or + null if both inputs are null + + + + Unions two polygonal geometries, restricting computation + to the envelope intersection where possible. + The case of MultiPolygons is optimized to union only + the polygons which lie in the intersection of the two geometry's envelopes. + Polygons outside this region can simply be combined with the union result, + which is potentially much faster. + This case is likely to occur often during cascaded union, and may also + occur in real world data (such as unioning data for parcels on different street blocks). + + A polygonal geometry + A polygonal geometry + The intersection of the envelopes of the inputs + The union of the inputs + + + + Encapsulates the actual unioning of two polygonal geometries. + + + + Computes a containing only components. + Extracts the s from the input + and returns them as an appropriate geometry. + + If the input is already Polygonal, it is returned unchanged. + + A particular use case is to filter out non-polygonal components + returned from an overlay operation. + + The geometry to filter + A polygonal geometry + + + + Computes the union of a geometry with + another arbitrary . + Does not copy any component geometries. + + + + + + + + Unions a Collection of s or a single Geometry (which may be a ) together. + + + + By using this special-purpose operation over a collection of geometries + it is possible to take advantage of various optimizations to improve performance. + + + Heterogeneous s are fully supported. + + + The result obeys the following contract: + + Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). + Unioning a set of s has the effect of fully noding + and dissolving the input linework. + In this context "fully noded" means that there will be + an endpoint or node in the result + for every endpoint or line segment crossing in the input. + "Dissolved" means that any duplicate (e.g. coincident) line segments or portions + of line segments will be reduced to a single line segment in the output. + This is consistent with the semantics of the + operation. + If merged linework is required, the class can be used. + Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). + + + UnaryUnion always operates on the individual components of MultiGeometries. + So it is possible to use it to "clean" invalid self-intersecting MultiPolygons + (although the polygon components must all still be individually valid.) + + + + mbdavis + + + + + Computes the geometric union of a + + A collection of geometries + The union of the geometries, + or null if the input is empty + + + + Computes the geometric union of a + If no input geometries were provided but a was provided, + an empty is returned. + + A collection of geometries + The geometry factory to use if the collection is empty + The union of the geometries + or an empty GEOMETRYCOLLECTION + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + The union of the elements of the geometry + or an empty GEOMETRYCOLLECTION + + + + Constructs a unary union operation for an enumeration + of s, using the + of the input geometries. + + An enumeration of geometries + + + + Constructs a unary union operation for an enumeration + of s. + If no input geometries were provided but a was provided, + + An enumeration of geometries + The geometry factory to use if the enumeration is empty + + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + + + + Gets the union of the input geometries. + If no input geometries were provided but a was provided, + an empty is returned. + Otherwise, the return value is null + + + A Geometry containing the union + or an empty if no geometries were provided in the input, + or null if not GeometryFactory was provided + + + + + Computes the union of two geometries, either of both of which may be null. + + + + + The union of the input(s) + or null if both inputs are null + + + + + Computes a unary union with no extra optimization, and no short-circuiting. + + + Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. + + A geometry + The union of the input geometry + + + + Experimental code to union MultiPolygons with processing limited to the elements which actually interact. + + Not currently used, since it doesn't seem to offer much of a performance advantage. + mbdavis + + + + This class tests that the interior of an area + ( or ) + is connected. An area Geometry is invalid if the interior is disconnected. + This can happen if: + - a shell self-intersects, + - one or more holes form a connected chain touching a shell at two different points, + - one or more holes form a ring around a subset of the interior. + If a disconnected situation is found the location of the problem is recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form s in graph into Minimal EdgeRings. + (Minimal Edgerings must be used, because only they are guaranteed to provide + a correct isHole computation). + + + + + + + Mark all the edges for the edgeRings corresponding to the shells of the input polygons. + Only ONE ring gets marked for each shell - if there are others which remain unmarked + this indicates a disconnected interior. + + + + + + + + + + + + + + + + + + + + Check if any shell ring has an unvisited edge. + A shell ring is a ring which is not a hole and which has the interior + of the parent area on the RHS. + (Note that there may be non-hole rings with the interior on the LHS, + since the interior of holes will also be polygonized into CW rings + by the LinkAllDirectedEdges() step). + + + true if there is an unvisited edge in a non-hole ring. + + + + + + + + + Checks that a {GeometryGraph} representing an area + (a Polygon or MultiPolygon ) + is consistent with the SFS semantics for area geometries. + Checks include: + Testing for rings which self-intersect (both properly and at nodes). + Testing for duplicate rings. + If an inconsistency if found the location of the problem is recorded. + + + + + + + + + + + Returns the intersection point, or null if none was found. + + + + + + + + + + Check all nodes to see if their labels are consistent. + If any are not, return false. + + + + + Checks for two duplicate rings in an area. + Duplicate rings are rings that are topologically equal + (that is, which have the same sequence of points up to point order). + If the area is topologically consistent (determined by calling the + isNodeConsistentArea, + duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. + (This is because topologically consistent areas cannot have two rings sharing + the same line segment, unless the rings are equal). + The start point of one of the equal rings will be placed in invalidPoint. + Returns true if this area Geometry is topologically consistent but has two duplicate rings. + + + + Tests whether any of a set of {@link LinearRing}s are + nested inside another ring in the set, using a spatial + index to speed up the comparisons. + + @version 1.7 + + + + Implements the algorithsm required to compute the + method for s. + See the documentation for the various geometry types for a specification of validity. + + + + + Checks whether a coordinate is valid for processing. + Coordinates are valid iff their x and y ordinates are in the + range of the floating point representation. + + The coordinate to validate. + true if the coordinate is valid. + + + + Find a point from the list of testCoords + that is NOT a node in the edge for the list of searchCoords. + + + + + The point found, or null if none found. + + + If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). + + + + + + + + + + + + + + + + Checks validity of a Point. + + + + + + Checks validity of a MultiPoint. + + + + + + Checks validity of a LineString. + Almost anything goes for lineStrings! + + + + + + Checks validity of a LinearRing. + + + + + + Checks the validity of a polygon and sets the validErr flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there is no ring which self-intersects (except of course at its endpoints). + This is required by OGC topology rules (but not by other models + such as ESRI SDE, which allow inverted shells and exverted holes). + + + + + + Check that a ring does not self-intersect, except at its endpoints. + Algorithm is to count the number of times each node along edge occurs. + If any occur more than once, that must be a self-intersection. + + + + + Tests that each hole is inside the polygon shell. + This routine assumes that the holes have previously been tested + to ensure that all vertices lie on the shell or inside it. + A simple test of a single point in the hole can be used, + provide the point is chosen such that it does not lie on the + boundary of the shell. + + The polygon to be tested for hole inclusion. + A GeometryGraph incorporating the polygon. + + + + Tests that no hole is nested inside another hole. + This routine assumes that the holes are disjoint. + To ensure this, holes have previously been tested + to ensure that: + They do not partially overlap + (checked by checkRelateConsistency). + They are not identical + (checked by checkRelateConsistency). + + + + + Tests that no element polygon is wholly in the interior of another element polygon. + Preconditions: + Shells do not partially overlap. + Shells do not touch along an edge. + No duplicate rings exists. + This routine relies on the fact that while polygon shells may touch at one or + more vertices, they cannot touch at ALL vertices. + + + + + Check if a shell is incorrectly nested within a polygon. This is the case + if the shell is inside the polygon shell, but not inside a polygon hole. + (If the shell is inside a polygon hole, the nesting is valid.) + The algorithm used relies on the fact that the rings must be properly contained. + E.g. they cannot partially overlap (this has been previously checked by + CheckRelateConsistency). + + + + + This routine checks to see if a shell is properly contained in a hole. + It assumes that the edges of the shell and hole do not + properly intersect. + + + + + + null if the shell is properly contained, or + a Coordinate which is not inside the hole if it is not. + + + + + + + + + + + + Gets/Sets whether polygons using Self-Touching Rings to form + holes are reported as valid. + If this flag is set, the following Self-Touching conditions + are treated as being valid: + - The shell ring self-touches to create a hole touching the shell. + - A hole ring self-touches to create two holes touching at a point. + + + The default (following the OGC SFS standard) + is that this condition is not valid (false). + + + This does not affect whether Self-Touching Rings + disconnecting the polygon interior are considered valid + (these are considered to be invalid under the SFS, and many other + spatial models as well). + This includes "bow-tie" shells, + which self-touch at a single point causing the interior to be disconnected, + and "C-shaped" holes which self-touch at a single point causing an island to be formed. + + + States whether geometry with this condition is valid. + + + + Computes the validity of the geometry, + and returns true if it is valid. + + + + + Computes the validity of the geometry, + and if not valid returns the validation error for the geometry, + or null if the geometry is valid. + + The validation error, if the geometry is invalid
+ or null if the geometry is valid
+
+ + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a Quadtree + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the appropriate checks for repeated points + (consecutive identical coordinates) as defined in the + NTS spec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a simple O(n^2) + comparison. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a SweepLineIndex + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about the nature and location of + a validation error. + + + + + Not used. + + + + + No longer used: + repeated points are considered valid as per the SFS. + + + + + Indicates that a hole of a polygon lies partially + or completely in the exterior of the shell. + + + + + Indicates that a hole lies + in the interior of another hole in the same polygon. + + + + + Indicates that the interior of a polygon is disjoint + (often caused by set of contiguous holes splitting + the polygon into two parts). + + + + + Indicates that two rings of a polygonal geometry intersect. + + + + + Indicates that a ring self-intersects. + + + + + Indicates that a polygon component of a + lies inside another polygonal component. + + + + + Indicates that a polygonal geometry + contains two rings which are identical. + + + + + Indicates that either: + - A contains a single point. + - A contains 2 or 3 points. + + + + + Indicates that the X or Y ordinate of + a is not a valid + numeric value (e.g. ). + + + + + Indicates that a ring is not correctly closed + (the first and the last coordinate are different). + + + + + Contains information about the nature and location of a Geometry + validation error. + + + + + These messages must synch up with the indexes above + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds all connected s of a . + + + + + Initializes a new instance of the class. + + The . + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + + + + + + Adds the argument node and all its out edges to the subgraph. + + + + + + + + A sorted collection of DirectedEdges which leave a Node + in a PlanarGraph. + + + + + The underlying list of outgoing DirectedEdges. + + + + + Adds a new member to this DirectedEdgeStar. + + + + + + Drops a member of this DirectedEdgeStar. + + + + + + Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the zero-based index of the given DirectedEdge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the remainder when i is divided by the number of edges in this + DirectedEdgeStar. + + + + + + + Returns the on the left-hand + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + + + Returns the on the right-hand (CW) + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + Returns the number of edges around the Node associated with this DirectedEdgeStar. + + + + + Returns the coordinate for the node at wich this star is based. + + + + + Returns the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + A node in a PlanarGraph is a location where 0 or more Edges + meet. A node is connected to each of its incident Edges via an outgoing + DirectedEdge. Some clients using a PlanarGraph may want to + subclass Node to add their own application-specific + data and methods. + + + + + Returns all Edges that connect the two nodes (which are assumed to be different). + + + + + + + + The location of this Node. + + + + + The collection of DirectedEdges that leave this Node. + + + + + Constructs a Node with the given location. + + + + + + Constructs a Node with the given location and collection of outgoing DirectedEdges. + + + + + + + Adds an outgoing DirectedEdge to this Node. + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Removes a incident on this node. Does not change the state of the directed edge. + + + + + Removes this node from its containing graph. + + + + + + + + + + + Returns the location of this Node. + + + + + Returns the collection of DirectedEdges that leave this Node. + + + + + Returns the number of edges around this Node. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + Adds a node to the map, replacing any that is already at that location. + + + The added node. + + + + Removes the Node at the given location, and returns it (or null if no Node was there). + + + + + + + Returns the Node at the given location, or null if no Node was there. + + + + + + + Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the number of Nodes in this NodeMap. + + + + + A subgraph of a . + A subgraph may contain any subset of s + from the parent graph. + It will also automatically contain all s + and s associated with those edges. + No new objects are created when edges are added - + all associated components must already exist in the parent graph. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new subgraph of the given . + + + + + + Gets the which this subgraph is part of. + + + + + + Adds an to the subgraph. + The associated s and s are also added. + + The to add. + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph. + + + + + + Tests whether an is contained in this subgraph. + + The to test. + true if the is contained in this subgraph. + + + + Determines the maximum number of common most-significant + bits in the mantissa of one or numbers. + Can be used to compute the double-precision number which + is represented by the common bits. + If there are no common bits, the number computed is 0.0. + + + + + Computes the bit pattern for the sign and exponent of a + double-precision number. + + + The bit pattern for the sign and exponent. + + + + This computes the number of common most-significant bits in the mantissas + of two double-precision numbers. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + /// + The number of common most-significant mantissa bits. + + + + Zeroes the lower n bits of a bitstring. + + The bitstring to alter. + the number of bits to zero. + The zeroed bitstring. + + + + Extracts the i'th bit of a bitstring. + + The bitstring to extract from. + The bit to extract. + The value of the extracted bit. + + + + + + + + + + A representation of the Double bits formatted for easy readability + + + + + + + + + + + + Provides versions of Geometry spatial functions which use + common bit removal to reduce the likelihood of robustness problems. + In the current implementation no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + Client classes should check the validity of the returned result themselves. + + + + + Creates a new instance of class, which reshifts result Geometrys. + + + + + Creates a new instance of class, specifying whether + the result Geometrys should be reshifted. + + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry, to be subtracted from the first. + The Geometry representing the set-theoretic difference of the input Geometries. + + + Computes the set-theoretic symmetric difference of two geometries, + using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer a point, using enhanced precision. + + The Geometry to buffer. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + If required, returning the result to the orginal precision if required. + In this current implementation, no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + + The result Geometry to modify. + The result Geometry with the required precision. + + + + Computes a copy of the input Geometry with the calculated common bits + removed from each coordinate. + + The Geometry to remove common bits from. + A copy of the input Geometry with common bits removed. + + + + Computes a copy of each input Geometrys with the calculated common bits + removed from each coordinate. + + A Geometry to remove common bits from. + A Geometry to remove common bits from. + + An array containing copies + of the input Geometry's with common bits removed. + + + + + Removes common most-significant mantissa bits + from one or more s. + + The CommonBitsRemover "scavenges" precision + which is "wasted" by a large displacement of the geometry + from the origin. + For example, if a small geometry is displaced from the origin + by a large distance, + the displacement increases the significant figures in the coordinates, + but does not affect the relative topology of the geometry. + Thus the geometry can be translated back to the origin + without affecting its topology. + In order to compute the translation without affecting + the full precision of the coordinate values, + the translation is performed at the bit level by + removing the common leading mantissa bits. + + If the geometry envelope already contains the origin, + the translation procedure cannot be applied. + In this case, the common bits value is computed as zero. + + If the geometry crosses the Y axis but not the X axis + (and mutatis mutandum), + the common bits for Y are zero, + but the common bits for X are non-zero. + + + + + Add a point to the set of geometries whose common bits are + being computed. After this method has executed the + common coordinate reflects the common bits of all added + geometries. + + A Geometry to test for common bits. + + + + Removes the common coordinate bits from a Geometry. + The coordinates of the Geometry are changed. + + The Geometry from which to remove the common coordinate bits. + The shifted Geometry. + + + + Adds the common coordinate bits back into a Geometry. + The coordinates of the Geometry are changed. + + The Geometry to which to add the common coordinate bits. + + + + The common bits of the Coordinates in the supplied Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate sequence + + + + Reduces the precision of the s in a + to match the supplied . + + + Uses . + The input is modified in-place, so + it should be cloned beforehand if the + original should not be modified. + + mbdavis + + + + Creates a new precision reducer filter. + + The PrecisionModel to use + + + + Rounds the Coordinates in the sequence to match the PrecisionModel + + + + + Always runs over all geometry components. + + + + + Always reports that the geometry has changed + + + + + Provides versions of Geometry spatial functions which use + enhanced precision techniques to reduce the likelihood of robustness problems. + + + + + Only static methods! + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic difference of the input Geometries. + + + + Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer of a Geometry, using enhanced precision. + This method should no longer be necessary, since the buffer algorithm + now is highly robust. + + The first Geometry. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + Reduces the precision of a + according to the supplied , + ensuring that the result is topologically valid. + + + + + Convenience method for doing precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + and preserving polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Convenience method for doing pointwise precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + but NOT preserving valid polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Duplicates a geometry to one that uses a different PrecisionModel, + without changing any coordinate values. + + The geometry to duplicate + The precision model to use + The geometry value with a new precision model + + + Gets or sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + The default is to remove collapsed components. + + + + + /// Gets or sets whether the of the new reduced Geometry + will be changed to be the supplied to + specify the precision reduction. + + The default is to not change the precision model + + + + + Gets or sets whether the precision reduction will be done + in pointwise fashion only. + Pointwise precision reduction reduces the precision + of the individual coordinates only, but does + not attempt to recreate valid topology. + This is only relevant for geometries containing polygonal components. + + + + + Computes the Minimum Clearance of a . + + The Minimum Clearance is a measure of + what magnitude of perturbation of + the vertices of a geometry can be tolerated + before the geometry becomes topologically invalid. + The smaller the Minimum Clearance distance, + the less vertex pertubation the geometry can tolerate + before becoming invalid. + + + The concept was introduced by Thompson and Van Oosterom + [TV06], based on earlier work by Milenkovic [Mi88]. + + The Minimum Clearance of a geometry G + is defined to be the value r + such that "the movement of all points by a distance + of r in any direction will + guarantee to leave the geometry valid" [TV06]. + An equivalent constructive definition [Mi88] is that + r is the largest value such: + + No two distinct vertices of G are closer than r. + No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint + + The following image shows an example of the Minimum Clearance + of a simple polygon. + +
+ + If G has only a single vertex (i.e. is a + ), the value of the minimum clearance + is . + + If G is a or geometry, + then in fact no amount of perturbation + will render the geometry invalid. + In this case a Minimum Clearance is still computed + based on the vertex and segment distances + according to the constructive definition. + + It is possible for no Minimum Clearance to exist. + For instance, a with all members identical + has no Minimum Clearance + (i.e. no amount of perturbation will cause + the member points to become non-identical). + Empty geometries also have no such distance. + The lack of a meaningful MinimumClearance distance is detected + and suitable values are returned by + and . + + The computation of Minimum Clearance utilizes + the + method to provide good performance even for + large inputs. + + An interesting note is that for the case of s, + the computed Minimum Clearance line + effectively determines the Nearest Neighbours in the collection. +

References

+ + [Mi88] Milenkovic, V. J., + Verifiable implementations of geometric algorithms + using finite precision arithmetic. + in Artificial Intelligence, 377-401. 1988 + [TV06] Thompson, Rod and van Oosterom, Peter, + Interchange of Spatial Data-Inhibiting Factors, + Agile 2006, Visegrad, Hungary. 2006 + +
+ /// Martin Davis +
+ + + Computes the Minimum Clearance distance for + the given Geometry. + + The input geometry + The minimum clearance + + + + Gets a LineString containing two points + which are at the Minimum Clearance distance + for the given Geometry. + + The input geometry + The value of the minimum clearance distance
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + Creates an object to compute the Minimum Clearance for the given Geometry + + The input geometry + + + + Gets the Minimum Clearance distance. + If no distance exists + (e.g. in the case of two identical points) + is returned. + + + The value of the minimum clearance distance
+ or if no Minimum Clearance distance exists +
+
+ + + Gets a LineString containing two points + which are at the Minimum Clearance distance. + If no distance could be found + (e.g. in the case of two identical points) + LINESTRING EMPTY is returned. + + The value of the minimum clearance distance,
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + + Reduces the precision of the coordinates of a Geometry + according to the supplied {PrecisionModel}, without + attempting to preserve valid topology. + + + In case of geometries, + the topology of the resulting geometry may be invalid if + topological collapse occurs due to coordinates being shifted. + It is up to the client to check this and handle it if necessary. + Collapses may not matter for some uses. An example + is simplifying the input to the buffer algorithm. + The buffer algorithm does not depend on the validity of the input point. + + + + + Convenience method for doing precision reduction on a single geometry, + with collapses removed and keeping the geometry precision model the same. + + The reduced geometry + + + + + + + + + + + + + + + + + Sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + + + + + Gets/Sets whether the PrecisionModel of the new reduced Geometry + will be changed to be the PrecisionModel supplied to + specify the precision reduction. + The default is to not change the precision model. + + + + + + + + + + + + + + + + + + + + + + + + Computes the minimum clearance of a geometry or + set of geometries. + The Minimum Clearance is a measure of + what magnitude of perturbation of its vertices can be tolerated + by a geometry before it becomes topologically invalid. + + This class uses an inefficient O(N^2) scan. + It is primarily for testing purposes. + + + Martin Davis + + + + Gets or sets the total number of points in the created . + The created geometry will have no more than this number of points, + unless more are needed to create a valid geometry. + + + + + The height of an equilateral triangle of side one + + + + + Creates random point sets contained in a + region defined by either a rectangular or a polygonal extent. + + mbdavis + + + + Create a shape factory which will create shapes using the default + . + + + + + Create a shape factory which will create shapes using the given + + + The factory to use + + + + Sets a polygonal mask. + + if the mask is not polygonal + + + + Creates random point sets where the points + are constrained to lie in the cells of a grid. + + mbdavis + + + + Create a builder which will create shapes using the default + . + + + + + Create a builder which will create shapes using the given + . + + The factory to use + + + + Gets the containing the generated point + + A MultiPoint + + + + Gets or sets whether generated points are constrained to lie + within a circle contained within each grid cell. + This provides greater separation between points + in adjacent cells. + + The default is to not be constrained to a circle. + + + + + Gets or sets the fraction of the grid cell side which will be treated as + a gutter, in which no points will be created. + + The provided value is clamped to the range [0.0, 1.0]. + + + + + Simplifies a line (sequence of points) using + the standard Douglas-Peucker algorithm. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a using the Douglas-Peucker algorithm. + + + Ensures that any polygonal geometries returned are valid. + Simple lines are not guaranteed to remain simple after simplification. + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + Note that in general D-P does not preserve topology - + e.g. polygons can be split, collapse to lines or disappear + holes can be created or disappear, + and lines can cross. + To simplify point while preserving topology use TopologySafeSimplifier. + (However, using D-P is significantly faster). + + KNOWN BUGS: + In some cases the approach used to clean invalid simplified polygons + can distort the output geometry severely. + + + + + + Simplifies a geometry using a given tolerance. + + The geometry to simplify. + The tolerance to use. + A simplified version of the geometry. + + + + Creates a simplifier for a given geometry. + + The geometry to simplify. + + + + Gets the simplified geometry. + + The simplified geometry. + + + + The distance tolerance for the simplification. + + + All vertices in the simplified geometry will be within this + distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" + to have valid topology. + + + The caller may choose to disable this because: + + valid topology is not required + fixing topology is a relative expensive operation + in some pathological cases the topology fixing operation may either fail or run for too long + + The default is to fix polygon topology. + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a polygon, fixing it if required. + + + + + + + + Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. + + null if the simplification results in a degenerate ring + + + + + + + + + + + + Creates a valid area point from one that possibly has + bad topology (i.e. self-intersections). + Since buffer can handle invalid topology, but always returns + valid point, constructing a 0-width buffer "corrects" the + topology. + Note this only works for area geometries, since buffer always returns + areas. This also may return empty geometries, if the input + has no actual area. + + An area point possibly containing self-intersections. + A valid area point. + + + + An index of LineSegments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemVisitor subclass to reduce volume of query results. + + + + + + + + + + + + + + + + + + + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + A LineSegment which is tagged with its location in a Geometry. + Used to index the segments in a point and recover the segment locations + from the index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a collection of TaggedLineStrings, preserving topology + (in the sense that no new intersections are introduced). + This class is essentially just a container for the common + indexes used by . + + + + + Simplifies a collection of TaggedLineStrings. + + The collection of lines to simplify. + + + + Gets or sets the distance tolerance for the simplification.
+ Points closer than this tolerance to a simplified segment may + be removed. +
+
+ + + Represents a which can be modified to a simplified shape. + This class provides an attribute which specifies the minimum allowable length + for the modified result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a TaggedLineString, preserving topology + (in the sense that no new intersections are introduced). + Uses the recursive Douglas-Peucker algorithm. + + + + + Simplifies the given + using the distance tolerance specified. + + The linestring to simplify. + + + + Flattens a section of the line between + indexes and , + replacing them with a line between the endpoints. + The input and output indexes are updated + to reflect this. + + The start index of the flattened section. + The end index of the flattened section. + The new segment created. + + + + Tests whether a segment is in a section of a . + + + + + + + + + Remove the segs in the section of the line. + + + + + + + + Sets the distance tolerance for the simplification. + All vertices in the simplified geometry will be within this + distance of the original geometry. + + + + + Simplifies a point and ensures that + the result is a valid point having the + same dimension and number of components as the input, + and with the components having the same topological + relationship. + + If the input is a polygonal geometry + ( or ): + + The result has the same number of shells and holes as the input, + with the same topological structure + The result rings touch at no more than the number of touching points in the input + (although they may touch at fewer points). + The key implication of this statement is that if the + input is topologically valid, so is the simplified output. + + For linear geometries, if the input does not contain + any intersecting line segments, this property + will be preserved in the output. + + For all geometry types, the result will contain + enough vertices to ensure validity. For polygons + and closed linear geometries, the result will have at + least 4 vertices; for open linestrings the result + will have at least 2 vertices. + + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + The simplification uses a maximum-distance difference algorithm + similar to the Douglas-Peucker algorithm. + + +

KNOWN BUGS

+ + May create invalid topology if there are components which are small + relative to the tolerance value. + In particular, if a small hole is very near an edge, + it is possible for the edge to be moved by a relatively large tolerance value + and end up with the hole outside the result shell (or inside another hole). + Similarly, it is possible for a small polygon component to end up inside + a nearby larger polygon. + A workaround is to test for this situation in post-processing and remove + any invalid holes or polygons. + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A filter to add linear geometries to the linestring map + with the appropriate minimum size constraint. + Closed s (including s + have a minimum output size constraint of 4, + to ensure the output is valid. + For all other linestrings, the minimum size is 2 points. + + Martin Davis + + + + Filters linear geometries. + + A geometry of any type + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a using the Visvalingam-Whyatt area-based algorithm. + Ensures that any polygonal geometries returned are valid. Simple lines are not + guaranteed to remain simple after simplification. All geometry types are + handled. Empty and point geometries are returned unchanged. Empty geometry + components are deleted. + The simplification tolerance is specified as a distance. + This is converted to an area tolerance by squaring it. + + Known Bugs + * Not yet optimized for performance. + * Does not simplify the endpoint of rings. + To Do + * Allow specifying desired number of vertices in the output. + + + + Note that in general this algorithm does not preserve topology - e.g. polygons can be split, + collapse to lines or disappear holes can be created or disappear, and lines + can cross. + + 1.7 + + + + Simplifies a using a given tolerance. + + The to simplify. + The tolerance to use. + A simplified version of the . + + + + Creates a simplifier for a given . + + The to simplify. + + + + Gets the semplified . + + The semplified . + + + + Sets the distance tolerance for the simplification. All vertices in the + simplified will be within this distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" to have valid + topology. The caller may choose to disable this because: + * valid topology is not required. + * fixing topology is a relative expensive operation. + * in some pathological cases the topology fixing operation may either + fail or run for too long. + + The default is to fix polygon topology. + + + + Simplifies a , fixing it if required. + + + + + + + + Simplifies a . If the simplification results in a degenerate + ring, remove the component. + + + + null if the simplification results in a degenerate ring. + + + + Simplifies a , fixing it if required. + + + + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections. + A valid area geometry. + + + + A utility class which creates Conforming Delaunay Trianglulations + from collections of points and linear constraints, and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Sets the sites (point or vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + The site vertices do not have to contain the constraint + vertices as well; any site vertices which are + identical to a constraint vertex will be removed + from the site vertex set. + + The geometry from which the sites will be extracted. + + + + Gets the QuadEdgeSubdivision which models the computed triangulation. + + The subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + The geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the linear constraints to be conformed to. + All linear components in the input will be used as constraints. + The constraint vertices do not have to be disjoint from + the site vertices. + The constraints must not contain duplicate segments (up to orientation). + + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + + Creates a Conforming Delaunay Triangulation based on the given + unconstrained initial vertices. The initial vertex set should not contain + any vertices which appear in the constraint set. + + a collection of + the distance tolerance below which points are considered identical + + + + Sets the constraints to be conformed to by the computed triangulation. + The constraints must not contain duplicate segments (up to orientation). + The unique set of vertices (as es) + forming the constraints must also be supplied. + Supplying it explicitly allows the ConstraintVertexes to be initialized + appropriately(e.g. with external data), and avoids re-computing the unique set + if it is already available. + + list of the constraint {@link Segment}s + the set of unique es referenced by the segments + + + + Creates a vertex on a constraint segment + + the location of the vertex to create + the constraint segment it lies on + the new constraint vertex + + + + Inserts all sites in a collection + + a collection of ConstraintVertex + + + + Inserts a site into the triangulation, maintaining the conformal Delaunay property. + This can be used to further refine the triangulation if required + (e.g. to approximate the medial axis of the constraints, + or to improve the grading of the triangulation). + + the location of the site to insert + + + + Computes the Delaunay triangulation of the initial sites. + + + + + Enforces the supplied constraints into the triangulation. + + + if the constraints cannot be enforced + + + + Given a set of points stored in the kd-tree and a line segment defined by + two points in this set, finds a in the circumcircle of + the line segment, if one exists. This is called the Gabriel point - if none + exists then the segment is said to have the Gabriel condition. Uses the + heuristic of finding the non-Gabriel point closest to the midpoint of the + segment. + + the line segment + + A point which is non-Gabriel, + or null if no point is non-Gabriel + + + + + Gets or sets the to be + used during constraint enforcement. + Different splitting strategies may be appropriate + for special situations. + + the ConstraintSplitPointFinder to be used + + + + Gets the tolerance value used to construct the triangulation. + + a tolerance value + + + + Gets and sets the used to create new constraint vertices at split points. + + Allows the setting of a custom {@link ConstraintVertexFactory} to be used + to allow vertices carrying extra information to be created. + + + + + Gets the which represents the triangulation. + + + + + Gets the which contains the vertices of the triangulation. + + + + + Gets the sites (vertices) used to initialize the triangulation. + + + + + Gets the s which represent the constraints. + + + + + Gets the convex hull of all the sites in the triangulation, + including constraint vertices. + Only valid after the constraints have been enforced. + + the convex hull of the sites + + + + Indicates a failure during constraint enforcement. + + Martin Davis + 1.0 + + + + Creates a new instance with a given message. + + a string + + + + Creates a new instance with a given message and approximate location. + + a string + the location of the error + + + + Gets the approximate location of this error. + + a location + + + + An interface for strategies for determining the location of split points on constraint segments. + The location of split points has a large effect on the performance and robustness of enforcing a + constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, + especially at narrow constraint angles, since the split point will end up encroaching on the + segment containing the original encroaching point. With detailed knowledge of the geometry of the + constraints, it is sometimes possible to choose better locations for splitting. + + mbdavis + + + + Finds a point at which to split an encroached segment to allow the original segment to appear + as edges in a constrained Delaunay triangulation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + A vertex in a Constrained Delaunay Triangulation. + The vertex may or may not lie on a constraint. + If it does it may carry extra information about the original constraint. + + Martin Davis + + + + Models a site (node) in a . + The sites can be points on a line string representing a + linear site. + The vertex can be considered as a vector with a norm, length, inner product, cross + product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle + defined by this point and two others, etc.) are also defined in this class. + + It is common to want to attach user-defined data to + the vertices of a subdivision. + One way to do this is to subclass Vertex + to carry any desired information. + + David Skea + Martin Davis + + + + Creates an instance of this class using the given x- and y-ordinate valuse + + x-ordinate value + y-ordinate value + + + + Creates an instance of this class using the given x-, y- and z-ordinate values + + x-ordinate value + y-ordinate value + z-ordinate value + + + + Creates an instance of this class using a clone of the given . + + The coordinate + + + + Computes the cross product k = u X v. + + a vertex + returns the magnitude of u X v + + + + Computes the inner or dot product + + A vertex + The dot product u.v + + + + Computes the scalar product c(v) + + A vertex + The scaled vector + + + + Tests if this is inside the circle defined by the points a, b, c. This test uses simple + double-precision arithmetic, and thus may not be robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + true if this vertex is inside the circumcircle (a, b, c) + + + + Tests whether the triangle formed by this vertex and two + other vertices is in CCW orientation. + + a vertex + a vertex + true if the triangle is oriented CCW + + + + Computes the value of the ratio of the circumradius to shortest edge. If smaller than some + given tolerance B, the associated triangle is considered skinny. For an equal lateral + triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: + circumRadius/shortestEdge = 1/(2sin(theta)). + + second vertex of the triangle + third vertex of the triangle + ratio of circumradius to shortest edge. + + + + returns a new vertex that is mid-way between this vertex and another end point. + + the other end point. + the point mid-way between this and that. + + + + Computes the centre of the circumcircle of this vertex and two others. + + + + the Coordinate which is the circumcircle of the 3 points. + + + + For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate + a z value from the surrounding vertices. + + + + + Interpolates the Z-value (height) of a point enclosed in a triangle + whose vertices all have Z values. + The containing triangle must not be degenerate + (in other words, the three vertices must enclose a + non-zero area). + + The point to interpolate the Z value of + A vertex of a triangle containing the + A vertex of a triangle containing the + A vertex of a triangle containing the + The interpolated Z-value (height) of the point + + + + Computes the interpolated Z-value for a point p lying on the segment p0-p1 + + The point to interpolate the Z value of + A vertex of the segment is lying on + A vertex of the segment is lying on + The interpolated Z-value (height) of the point + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + Gets the z-ordinate value + + + + + Gets the coordinate + + + + + Creates a new constraint vertex + + the location of the vertex + + + + Merges the constraint data in the vertex other into this vertex. + This method is called when an inserted vertex is + very close to an existing vertex in the triangulation. + + the constraint vertex to merge + + + + Gets or sets whether this vertex lies on a constraint. + + true if the vertex lies on a constraint + + + + Gets or sets the external constraint object + + object which carries information about the constraint this vertex lies on + + + + An interface for factories which create a {@link ConstraintVertex} + + Martin Davis + + + + A utility class which creates Delaunay Trianglulations + from collections of points and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Extracts the unique s from the given . + + the geometry to extract from + a List of the unique Coordinates + + + + Converts all s in a collection to es. + + the coordinates to convert + a List of Vertex objects + + + + Computes the of a collection of s. + + a List of Coordinates + the envelope of the set of coordinates + + + + Sets the sites (vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + + the geometry from which the sites will be extracted. + + + + Sets the sites (vertices) which will be triangulated + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed triangulation. + + the subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + the geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + Computes a Delauanay Triangulation of a set of es, using an + incrementatal insertion algorithm. + + Martin Davis + 1.0 + + + + Creates a new triangulator using the given . + The triangulator uses the tolerance of the supplied subdivision. + + a subdivision in which to build the TIN + + + + Inserts all sites in a collection. The inserted vertices MUST be + unique up to the provided tolerance value. (i.e. no two vertices should be + closer than the provided tolerance value). They do not have to be rounded + to the tolerance grid, however. + + a Collection of Vertex + if the location algorithm fails to converge in a reasonable number of iterations + + + + Inserts a new point into a subdivision representing a Delaunay + triangulation, and fixes the affected edges so that the result is still a + Delaunay triangulation. + + a quadedge containing the inserted vertex + + + + A simple split point finder which returns the midpoint of the split segment. This is a default + strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. + Other points which could be used are: +
    +
  • The projection of the encroaching point on the segment
  • +
  • A point on the segment which will produce two segments which will not be further encroached
  • +
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • + point +
+
+ Martin Davis +
+ + + Gets the midpoint of the split segment + + + + + A strategy for finding constraint split points which attempts to maximise the length of the split + segments while preventing further encroachment. (This is not always possible for narrow angles). + + Martin Davis + + + + A basic strategy for finding split points when nothing extra is known about the geometry of + the situation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a split point which is the projection of the encroaching point on the segment + + The segment + The enchroaching point + A split point on the segment + + + + A framework to visit sets of edge-connected s in breadth-first order + + Martin Davis + 1.0 + + + + Called to initialize the traversal queue with a given set of s + + a collection of QuadEdgeTriangle + + + + Subclasses call this method to perform the visiting process. + + + + + An interface for classes which locate an edge in a + which either contains a given V + or is an edge of a triangle which contains V. + Implementors may utilized different strategies for + optimizing locating containing edges/triangles. + + Martin Davis + + + + Interface for classes which process triangles visited during travesals of a + + + Martin Davis + + + + Visits a triangle during a traversal of a . An implementation of + this method may perform processing on the current triangle. It must also decide whether a + neighbouring triangle should be added to the queue so its neighbours are visited. Often it + will perform processing on the neighbour triangle as well, in order to mark it as processed + (visited) and/or to determine if it should be visited. Note that choosing not to + visit the neighbouring triangle is the terminating condition for many traversal algorithms. + In particular, if the neighbour triangle has already been visited, it should not be visited + again. + + the current triangle being processed + the index of the edge in the current triangle being traversed + a neighbouring triangle next in line to visit + true if the neighbour triangle should be visited + + + + An interface for algorithms which process the triangles in a . + + Martin Davis + 1.0 + + + + + Locates s in a , + optimizing the search by starting in the + locality of the last edge found. + + Martin Davis + + + + Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. + The search starts from the last located edge amd proceeds on the general direction of v. + + + + + A class that represents the edge data structure which implements the quadedge algebra. + The quadedge algebra was described in a well-known paper by Guibas and Stolfi, + "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", + ACM Transactions on Graphics, 4(2), 1985, 75-123. + + Each edge object is part of a quartet of 4 edges, + linked via their Rot references. + Any edge in the group may be accessed using a series of operations. + Quadedges in a subdivision are linked together via their Next references. + The linkage between the quadedge quartets determines the topology + of the subdivision. + + + The edge class does not contain separate information for vertice or faces; a vertex is implicitly + defined as a ring of edges (created using the Next field). + + + David Skea + Martin Davis + + + + Creates a new QuadEdge quartet from o to d. + + the origin Vertex + the destination Vertex + the new QuadEdge quartet + + + + Creates a new QuadEdge connecting the destination of a to the origin of + b, in such a way that all three have the same left face after the + connection is complete. Additionally, the data pointers of the new edge + are set. + + the connected edge + + + + Splices two edges together or apart. + Splice affects the two edge rings around the origins of a and b, and, independently, the two + edge rings around the left faces of a and b. + In each case, (i) if the two rings are distinct, + Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it + into two separate pieces. Thus, Splice can be used both to attach the two edges together, and + to break them apart. + + an edge to splice + an edge to splice + + + + Turns an edge counterclockwise inside its enclosing quadrilateral. + + the quadedge to turn + + + + Quadedges must be made using {@link makeEdge}, + to ensure proper construction. + + + + + Gets the primary edge of this quadedge and its sym. + The primary edge is the one for which the origin + and destination coordinates are ordered + according to the standard ordering + + the primary quadedge + + + + Marks this quadedge as being deleted. + This does not free the memory used by + this quadedge quartet, but indicates + that this edge no longer participates + in a subdivision. + + + + + Sets the connected edge + + edge + + + + Tests if this quadedge and another have the same line segment geometry, + regardless of orientation. + + a quadege + true if the quadedges are based on the same line segment regardless of orientation + + + + Tests if this quadedge and another have the same line segment geometry + with the same orientation. + + a quadege + true if the quadedges are based on the same line segment + + + + Creates a representing the + geometry of this edge. + + a LineSegment + + + + Converts this edge to a WKT two-point LINESTRING indicating + the geometry of this edge. + + a String representing this edge's geometry + + + + Gets or sets the external data value for this edge. + + + an object containing external data + + + + + Tests whether this edge has been deleted. + + true if this edge has not been deleted. + + + + Gets the dual of this edge, directed from its right to its left. + + Gets or Sets the rotated edge + + + + Gets the dual of this edge, directed from its left to its right. + + Gets the inverse rotated edge. + + + + Gets the edge from the destination to the origin of this edge. + + Gets the sym of the edge. + + + + Gets the next CCW edge around the origin of this edge. + + Gets the next linked edge. + + + + Gets the next CW edge around (from) the origin of this edge. + + Gets the previous edge. + + + + Gets the next CCW edge around (into) the destination of this edge. + + Get the next destination edge. + + + + Gets the next CW edge around (into) the destination of this edge. + + Get the previous destination edge. + + + + Gets the CCW edge around the left face following this edge. + + Gets the next left face edge. + + + + Gets the CCW edge around the left face before this edge. + + Get the previous left face edge. + + + + Gets the edge around the right face ccw following this edge. + + Gets the next right face edge. + + + + Gets the edge around the right face ccw before this edge. + + Gets the previous right face edge. + + + + Gets or sets the vertex for the edge's origin + + Gets the origin vertex + + + + Gets or sets the vertex for the edge's destination + + Gets the destination vertex + + + + Gets the length of the geometry of this quadedge. + + Gets the length of the quadedge + + + + A class that contains the s representing a planar + subdivision that models a triangulation. + The subdivision is constructed using the + quadedge algebra defined in the classs . + All metric calculations + are done in the class. + In addition to a triangulation, subdivisions + support extraction of Voronoi diagrams. + This is easily accomplished, since the Voronoi diagram is the dual + of the Delaunay triangulation. + + Subdivisions can be provided with a tolerance value. Inserted vertices which + are closer than this value to vertices already in the subdivision will be + ignored. Using a suitable tolerance value can prevent robustness failures + from happening during Delaunay triangulation. + + + Subdivisions maintain a frame triangle around the client-created + edges. The frame is used to provide a bounded "container" for all edges + within a TIN. Normally the frame edges, frame connecting edges, and frame + triangles are not included in client processing. + + + David Skea + Martin Davis + + + + Gets the edges for the triangle to the left of the given . + + + + if the edges do not form a triangle + + + + Creates a new instance of a quad-edge subdivision based on a frame triangle + that encloses a supplied bounding box. A new super-bounding box that + contains the triangle is computed and stored. + + the bouding box to surround + the tolerance value for determining if two sites are equal + + + + Gets the collection of base s (one for every pair of + vertices which is connected). + + a collection of QuadEdges + + + + Sets the to use for locating containing triangles + in this subdivision. + + a QuadEdgeLocator + + + + Creates a new quadedge, recording it in the edges list. + + The origin vertex + The destination vertex + A new quadedge + + + + Creates a new QuadEdge connecting the destination of a to the origin of b, + in such a way that all three have the same left face after the connection + is complete. The quadedge is recorded in the edges list. + + A quadedge + A quadedge + A quadedge + + + + Deletes a quadedge from the subdivision. Linked quadedges are updated to + reflect the deletion. + + the quadedge to delete + + + + Locates an edge of a triangle which contains a location + specified by a Vertex v. + The edge returned has the + property that either v is on e, or e is an edge of a triangle containing v. + The search starts from startEdge amd proceeds on the general direction of v. + + + This locate algorithm relies on the subdivision being Delaunay. For + non-Delaunay subdivisions, this may loop for ever. + + the location to search for + an edge of the subdivision to start searching at + a QuadEdge which contains v, or is on the edge of a triangle containing v + + if the location algorithm fails to converge in a reasonable + number of iterations + + + + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the vertex to locate + a quadedge on the edge of a triangle which touches or contains the location
+ or null if no such triangle exists +
+
+ + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the Coordinate to locate + a quadedge on the edge of a triangle which touches or contains the location, + or null if no such triangle exists + + + + + Locates the edge between the given vertices, if it exists in the + subdivision. + + a coordinate + another coordinate + the edge joining the coordinates, if present, + or null if no such edge exists + + + + + Inserts a new site into the Subdivision, connecting it to the vertices of + the containing triangle (or quadrilateral, if the split point falls on an + existing edge). + + + + This method does NOT maintain the Delaunay condition. If desired, this must + be checked and enforced by the caller. + + + This method does NOT check if the inserted vertex falls on an edge. This + must be checked by the caller, since this situation may cause erroneous + triangulation + + + the vertex to insert + a new quad edge terminating in v + + + + Tests whether a QuadEdge is an edge incident on a frame triangle vertex. + + the edge to test + true if the edge is connected to the frame triangle + + + + Tests whether a QuadEdge is an edge on the border of the frame facets and + the internal facets. E.g. an edge which does not itself touch a frame + vertex, but which touches an edge which does. + + the edge to test + true if the edge is on the border of the frame + + + + Tests whether a vertex is a vertex of the outer triangle. + + the vertex to test + true if the vertex is an outer triangle vertex + + + + Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a + tolerance determined by the subdivision tolerance. + + a QuadEdge + a point + true if the vertex lies on the edge + + + + Tests whether a is the start or end vertex of a + , up to the subdivision tolerance distance. + + + + true if the vertex is a endpoint of the edge + + + + Gets the unique es in the subdivision, + including the frame vertices if desired. + + true if the frame vertices should be included + a collection of the subdivision vertices + + + + + Gets a collection of s whose origin + vertices are a unique set which includes + all vertices in the subdivision. + The frame vertices can be included if required. + + + This is useful for algorithms which require traversing the + subdivision starting at all vertices. + Returning a quadedge for each vertex + is more efficient than + the alternative of finding the actual vertices + using and then locating + quadedges attached to them. + + true if the frame vertices should be included + a collection of QuadEdge with the vertices of the subdivision as their origins + + + + Gets all primary quadedges in the subdivision. + A primary edge is a + which occupies the 0'th position in its array of associated quadedges. + These provide the unique geometric edges of the triangulation. + + true if the frame edges are to be included + a List of QuadEdges + + + + The quadedges forming a single triangle. + Only one visitor is allowed to be active at a + time, so this is safe. + + + + + Stores the edges for a visited triangle. Also pushes sym (neighbour) edges + on stack to visit later. + + + + + + the visited triangle edges,
+ or null if the triangle should not be visited (for instance, if it is outer) +
+
+ + + Gets a list of the triangles + in the subdivision, specified as + an array of the primary quadedges around the triangle. + + true if the frame triangles should be included + a List of QuadEdge[3] arrays + + + + Gets a list of the triangles in the subdivision, + specified as an array of the triangle es. + + true if the frame triangles should be included + a List of Vertex[3] arrays + + + + Gets the coordinates for each triangle in the subdivision as an array. + + true if the frame triangles should be included + a list of Coordinate[4] representing each triangle + + + + Gets the geometry for the edges in the subdivision as a + containing 2-point lines. + + the GeometryFactory to use + a IMultiLineString + + + + Gets the geometry for the triangles in a triangulated subdivision as a + of triangular s. + + the GeometryFactory to use + a GeometryCollection of triangular Polygons + + + + Gets the cells in the Voronoi diagram for this triangulation. + The cells are returned as a of s + + + The userData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a GeometryCollection of Polygons + + + + Gets a List of s for the Voronoi cells + of this triangulation. + + + The UserData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a List of Polygons + + + + Gets the Voronoi cell around a site specified + by the origin of a QuadEdge. + + + The userData of the polygon is set to be the + of the site. This allows attaching external + data associated with the site to this cell polygon. + + a quadedge originating at the cell site + a factory for building the polygon + a polygon indicating the cell extent + + + + Gets the vertex-equality tolerance value + used in this subdivision + + Gets the tolerance value + + + + Gets the envelope of the Subdivision (including the frame). + + Gets the envelope + + + + A TriangleVisitor which computes and sets the + circumcentre as the origin of the dual + edges originating in each triangle. + + mbdavis + + + + Models a triangle formed from s in a + which forms a triangulation. The class provides methods to access the + topological and geometric properties of the triangle and its neighbours in + the triangulation. Triangle vertices are ordered in CCW orientation in the + structure. + + + QuadEdgeTriangles support having an external data attribute attached to them. + Alternatively, this class can be subclassed and attributes can + be defined in the subclass. Subclasses will need to define + their own BuilderVisitor class + and CreateOn method. + + Martin Davis + 1.0 + + + + Creates s for all facets of a + representing a triangulation. + The data attributes of the s in the subdivision + will be set to point to the triangle which contains that edge. + This allows tracing the neighbour triangles of any given triangle. + + The QuadEdgeSubdivision to create the triangles on. + A List of the created QuadEdgeTriangles + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 Vertexes + the point to test + true if the point is contained in the triangle + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 QuadEdges + the point to test + true if the point is contained in the triangle + + + + Creates a new triangle from the given edges. + + An array of the edges of the triangle in CCW order + + + + Gets the vertices for this triangle. + + a new array containing the triangle vertices + + + + Gets the index for the given edge of this triangle + + a QuadEdge + the index of the edge in this triangle,
+ or -1 if the edge is not an edge of this triangle +
+
+ + + Gets the index for the edge that starts at vertex v. + + the vertex to find the edge for + the index of the edge starting at the vertex,
+ or -1 if the vertex is not in the triangle +
+
+ + + Tests whether this triangle is adjacent to the outside of the subdivision. + + true if the triangle is adjacent to the subdivision exterior + + + + Gets the triangles which are adjacent (include) to a + given vertex of this triangle. + + The vertex to query + A list of the vertex-adjacent triangles + + + + Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is + null + + an array containing the 3 neighbours of this triangle + + + + Gets or sets the external data value for this triangle. + + + + + Gets all edges which are incident on the origin of the given edge. + + the edge to start at + a List of edges which have their origin at the origin of the given + edge + + + + Algorithms for computing values and predicates + associated with triangles. + + + For some algorithms extended-precision + implementations are provided, which are more robust + (i.e. they produce correct answers in more cases). + Also, some more robust formulations of + some algorithms are provided, which utilize + normalization to the origin. + + Martin Davis + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + However, by using normalization to the origin + it provides improved robustness and increased performance. + Based on code by J.R.Shewchuk. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the + triangle is oriented counterclockwise. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This method uses more robust computation. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness, but a faster approach. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + a vertex of the triangle + a vertex of the triangle + a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + + + + + + + + + + + Computes the inCircle test using distance from the circumcentre. + Uses standard double-precision arithmetic. + + + In general this doesn't + appear to be any more robust than the standard calculation. However, there + is at least one case where the test point is far enough from the + circumcircle that this test gives the correct answer. +
+            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
+            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
+            
+
+ A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + The area of a triangle defined by the points a, b and c +
+ + + Checks if the computed value for isInCircle is correct, using + double-double precision arithmetic. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + + + + + Creates a new instance for the given ordinates. + + + + + Creates a new instance for the given ordinates, with associated external data. + + + + + Creates a new instance for the given points, with associated external data. + + the start point + the end point + an external data object + + + + Creates a new instance for the given points. + + the start point + the end point + + + + Determines whether two segments are topologically equal. + I.e. equal up to orientation. + + a segment + true if the segments are topologically equal + + + + Computes the intersection point between this segment and another one. + + a segment + the intersection point, or null if there is none + + + + Computes a string representation of this segment. + + a string + + + + Gets the start coordinate of the segment + + a Coordinate + + + + Gets the end coordinate of the segment + + a Coordinate + + + + Gets the start X ordinate of the segment + + the X ordinate value + + + + Gets the start Y ordinate of the segment + + the Y ordinate value + + + + Gets the start Z ordinate of the segment + + the Z ordinate value + + + + Gets the end X ordinate of the segment + + the X ordinate value + + + + Gets the end Y ordinate of the segment + + he Y ordinate value + + + + Gets the end Z ordinate of the segment + + the Z ordinate value + + + + Gets a LineSegment modelling this segment. + + a LineSegment + + + + Gets or sets the external data associated with this segment + + a data object + + + + Models a constraint segment which can be split in two in various ways, + according to certain geometric constraints. + + Martin Davis + + + + Computes the {@link Coordinate} that lies a given fraction along the line defined by the + reverse of the given segment. A fraction of 0.0 returns the end point of the + segment; a fraction of 1.0 returns the start point of the segment. + + the LineSegment + the fraction of the segment length along the line + the point at that distance + + + + Creates a map between the vertex s of a + set of s, + and the parent geometry, and transfers the source geometry + data objects to geometry components tagged with the coordinates. + + + This class can be used in conjunction with + to transfer data objects from the input site geometries + to the constructed Voronoi polygons. + + Martin Davis + + + + + Input is assumed to be a multiGeometry + in which every component has its userData + set to be a Coordinate which is the key to the output data. + The Coordinate is used to determine + the output data object to be written back into the component. + + + + + + A utility class which creates Voronoi Diagrams + from collections of points. + The diagram is returned as a of s, + representing the faces of the Voronoi diagram. + /// The faces are clipped to the larger of: + + + an envelope supplied by . + + + an envelope determined by the input sites. + + + The userData attribute of each face Polygon is set to + the Coordinate of the corresponding input site. + This allows using a Map to link faces to data associated with sites. + + Martin Davis + + + + Sets the sites (point or vertices) which will be diagrammed. + All vertices of the given geometry will be used as sites. + + geom the geometry from which the sites will be extracted. + + + + Sets the sites (point or vertices) which will be diagrammed + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed diagram. + + the subdivision containing the triangulation + + + + Gets the faces of the computed diagram as a + of s, clipped as specified. + + The attribute of each face is set to + the Coordinate of the corresponding input site. + This allows using a to link faces to data associated with sites. + + the geometry factory to use to create the output + a containg the face s of the diagram + + + + Sets the envelope to clip the diagram to. + The diagram will be clipped to the larger + of this envelope or an envelope surrounding the sites. + + the clip envelope. + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + tolerance the tolerance distance to use + + + + An alternative implementation of the priority queue abstract data type. + This allows us to do more than , which we + got from JTS. Ultimately, this queue enables scenarios that have more + favorable execution speed characteristics at the cost of less favorable + memory and usability characteristics. + + + The type of the priority for each queue node. + + + The type of data stored in the queue. + + + When enumerating over the queue, note that the elements will not be in + sorted order. To get at the elements in sorted order, use the copy + constructor and repeatedly elements from it. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to + copy from. + + + is . + + + + + Removes all nodes from this queue. + + + + + Determines whether the given node is contained within this queue. + + + The node to locate in the queue. + + + if is found in the + queue, otherwise . + + + + + Adds a given node to the queue with the given priority. + + + The node to add to the queue. + + + The priority for the node. + + + is . + + + + + Removes and returns the head of the queue. + + + The removed element. + + + + + Changes the priority of the given node. + + + The node whose priority to change. + + + The new priority for the node. + + + is . + + + + + Removes the given node from this queue if it is present. + + + The node to remove if present. + + + A value indicating whether the node was removed. + + + + + + + + + + + Gets the number of nodes currently stored in this queue. + + + + + Gets the node at the head of the queue. + This is the node whose compares + less than or equal to the priority of all other nodes in the queue. + + + + + A container for a prioritized node that sites in an + . + + + The type to use for the priority of the node in the queue. + + + The type to use for the data stored by the node in the queue. + + + + + Initializes a new instance of the class. + + + The to store in this node. + + + + + Gets the that is stored in this node. + + + + + Gets the of this node in the queue. + + + The queue may update this priority while the node is still in the queue. + + + + + Gets or sets the index of this node in the queue. + + + This should only be read and written by the queue itself. + It has no "real" meaning to anyone else. + + + + + A utility for making programming assertions. + + + + + + + + + + + + + + + + + + + + + A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. + + + + + + + + + + + + + + + + + + + Static utility class for casting objects + + + + + Cast function from arbitrary-type to + + The output type + The sequence of items to cast. + as an enumerable of + Thrown if cast cannot be performed + + + + Cast function from sub-type to super-type + + The output (super/base) type + The input (sub/derived) type + The sequence of items to cast. + as an enumerable of + + + + Cast function from super-type to sub-type + + The input (sub/derived) type + The output (super/base) type + The sequence of items to cast. + as an enumerable of + + + + Executes a transformation function on each element of a collection + and returns the results in a new List. + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Copies s in an array to an object array + + + + the source array + An array of objects + + + + + + + + + + + + + + + + + + + + + A CoordinateFilter that creates an array containing every coordinate in a Geometry. + + + + + Constructs a CoordinateArrayFilter. + + The number of points that the CoordinateArrayFilter will collect. + + + + + + + + + + Returns the Coordinates collected by this CoordinateArrayFilter. + + + + + CoordinateCompare is used in the sorting of arrays of Coordinate objects. + Implements a lexicographic comparison. + + + + + Compares two object and returns a value indicating whether one is less than, equal to or greater + than the other. + + First Coordinate object to compare. + Second Coordinate object to compare. + + <table cellspacing="0" class="dtTABLE"> + <TR VALIGN="top"> + <TH width=50%>Value</TH> + <TH width=50%>Condition</TH> + </TR> + <TR VALIGN="top"> + <TD width=50%>Less than zero</TD> + <TD width=50%><I>a</I> is less than <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Zero</TD> + <TD width=50%><I>a</I> equals <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Greater than zero</TD> + <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> + </TR> + </table> + + If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b + implements IComparable, then b. CompareTo (a) is returned. + Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not + generate an exception when using IComparable. When sorting, a null reference (Nothing) is + considered to be less than any other object. + + + + + A CoordinateFilter that counts the total number of coordinates + in a Geometry. + + + + + + + + + + + Returns the result of the filtering. + + + + + Converts degrees to radians. + + + + + Converts degrees to radians. + + The angle in degrees. + The angle in radians. + + + + + + + + + Only static methods! + + + + + Convert the given numeric value (passed as string) of the base specified by baseIn + to the value specified by baseOut. + + Numeric value to be converted, as string. + Base of input value. + Base to use for conversion. + Converted value, as string. + + + + + + + + + + + + + + + + + + + + + + + + + Utility functions to report memory usage. + + mbdavis + + + + A priority queue over a set of objects. + + Objects to add + Martin Davis + + + Insert into the priority queue. Duplicates are allowed. + + The item to insert. + + + + Test if the priority queue is logically empty. + + true if empty, false otherwise. + + + + Make the priority queue logically empty. + + + + + Remove the smallest item from the priority queue. + + The smallest item, or default(T) if empty. + + + + Returns size. + + + + + Converts radians to degress. + + + + + Converts radians to degress. + + Angle in radians. + The angle in degrees. + + + + + + + + + + + + + + + + + Buffer for characters. This approximates StringBuilder + but is designed to be faster for specific operations. + This is about 30% faster for the operations I'm interested in + (Append, Clear, Length, ToString). + This trades off memory for speed. + + + To make Remove from the head fast, this is implemented + as a ring buffer. + This uses head and tail indices into a fixed-size + array. This will grow the array as necessary. + + + + + Default constructor. + + + + + Construct with a specific capacity. + + + + + + Reallocate the buffer to be larger. For the new size, this + uses the max of the requested length and double the current + capacity. + This does not shift, meaning it does not change the head or + tail indices. + + The new requested length. + + + + Ensure that we're set for the requested length by + potentially growing or shifting contents. + + + + + + Move the buffer contents such that headIndex becomes 0. + + + + + Overwrite this object's underlying buffer with the specified + buffer. + + The character array. + The number of characters to consider filled + in the input buffer. + + + + Append a character to this buffer. + + + + + + Append a string to this buffer. + + The string to append. + + + + Append a string to this buffer. + + The string to append. + + + + Remove a character at the specified index. + + The index of the character to remove. + + + + + Remove a specified number of characters at the specified index. + + The index of the characters to remove. + The number of characters to remove. + + + + Find the first instance of a character in the buffer, and + return its index. This returns -1 if the character is + not found. + + The character to find. + The index of the specified character, or -1 + for not found. + + + + Empty the buffer. + + + + + Return the current contents as a string. + + The new string. + + + + Gets/Sets the number of characters in the character buffer. + Increasing the length this way provides indeterminate results. + + + + + Returns the capacity of this character buffer. + + + + + Indexer. + + + + + Exception class for unterminated tokens. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated quotes. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated block comments. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Bitwise enumeration for character types. + + + + word characters (usually alpha, digits, and domain specific) + + + # or something for line comments + + + whitespace + + + ' or " type + + + usually 0 to 9 + + + usually 0 to 9, a-f and A-F + + + eof char + + + + This contains the settings that control the behavior of the tokenizer. + This is separated from the StreamTokenizer so that common settings + are easy to package and keep together. + + + + + Default constructor. + + + + + Copy constructor. + + + + + Sets this object to be the same as the specified object. + Note that some settings which are entirely embodied by the character + type table. + + + + + Setup default parse behavior. + This resets to same behavior as on construction. + + bool - true for success. + + + + Apply settings which are commonly used for code parsing + C-endCapStyle code, including C++, C#, and Java. + + + + + + Clear the character type settings. This leaves them unset, + as opposed to the default. Use SetDefaults() for default + settings. + + + + + Specify that a particular character is a word character. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + The character. + + + + Specify that a range of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + First character. + Last character. + + + + Specify that a string of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + + + + + Specify that a character is a whitespace character. + Character table type manipulation method. + This type is exclusive with other types. + + The character. + + + + Specify that a range of characters are whitespace characters. + Character table type manipulation method. + This adds the characteristic to the char(s), rather + than overwriting other characteristics. + + First character. + Last character. + + + + Remove other type settings from a range of characters. + Character table type manipulation method. + + + + + + + Remove other type settings from a character. + Character table type manipulation method. + + + + + + Specify that a particular character is a comment-starting character. + Character table type manipulation method. + + + + + + Specify that a particular character is a quote character. + Character table type manipulation method. + + + + + + Return a string representation of a character type setting. + Since the type setting is bitwise encoded, a character + can have more than one type. + + The character type byte. + The string representation of the type flags. + + + + Check whether the specified char type byte has a + particular type flag set. + + The char type byte. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + This is the character type table. Each byte is bitwise encoded + with the character attributes, such as whether that character is + word or whitespace. + + + + + Whether or not to return whitespace tokens. If not, they're ignored. + + + + + Whether or not to return EolTokens on end of line. Eol tokens will not + break up other tokens which can be multi-line. For example block comments + and quotes will not be broken by Eol tokens. Therefore the number of + Eol tokens does not give you the line count of a stream. + + + + + Whether or not to look for // comments + + + + + Whether or not to look for /* */ block comments. + + + + + Whether or not to return comments. + + + + + Whether or not to check for unterminated quotes and block comments. + If true, and one is encoutered, an exception is thrown of the appropriate type. + + + + + Whether or not digits are specified as Digit type in the + character table. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + This setting may become incorrect if you modify the character + types table directly. + + + + + Whether or not to parse Hex (0xABCD...) numbers. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + + + + + A StreamTokenizer similar to Java's. This breaks an input stream + (coming from a TextReader) into Tokens based on various settings. The settings + are stored in the TokenizerSettings property, which is a + StreamTokenizerSettings instance. + + + + This is configurable in that you can modify TokenizerSettings.CharTypes[] array + to specify which characters are which type, along with other settings + such as whether to look for comments or not. + + + WARNING: This is not internationalized. This treats all characters beyond + the 7-bit ASCII range (decimal 127) as Word characters. + + + There are two main ways to use this: 1) Parse the entire stream at + once and get an ArrayList of Tokens (see the Tokenize* methods), + and 2) call NextToken() successively. + This reads from a TextReader, which you can set directly, and this + also provides some convenient methods to parse files and strings. + This returns an Eof token if the end of the input is reached. + + + Here's an example of the NextToken() endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer(); + tokenizer.GrabWhitespace = true; + tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging + tokenizer.TextReader = File.OpenText(fileName); + Token token; + while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); + + + + Here's an example of the Tokenize... endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer("some string"); + ArrayList tokens = new ArrayList(); + if (!tokenizer.Tokenize(tokens)) + { + // error handling + } + foreach (Token t in tokens) Console.WriteLine("t = {0}", t); + + + + Comment delimiters are hardcoded (// and /*), not affected by char type table. + + + This sets line numbers in the tokens it produces. These numbers are normally + the line on which the token starts. + There is one known caveat, and that is that when GrabWhitespace setting + is true, and a whitespace token contains a newline, that token's line number + will be set to the following line rather than the line on which the token + started. + + + + + + This is the number of characters in the character table. + + + + + Default constructor. + + + + + Construct and set this object's TextReader to the one specified. + + The TextReader to read from. + + + + Construct and set a string to tokenize. + + The string to tokenize. + + + + Utility function, things common to constructors. + + + + + Clear the stream settings. + + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + The state. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + Exclude this state from the possible next state. + The state. + + + + Read the next character from the stream, or from backString + if we backed up. + + The next character. + + + + Get the next token. The last token will be an EofToken unless + there's an unterminated quote or unterminated block comment + and Settings.DoUntermCheck is true, in which case this throws + an exception of type StreamTokenizerUntermException or sub-class. + + The output token. + bool - true for success, false for failure. + + + + Starting from current stream location, scan forward + over an int. Determine whether it's an integer or not. If so, + push the integer characters to the specified CharBuffer. + If not, put them in backString (essentially leave the + stream as it was) and return false. + + If it was an int, the stream is left 1 character after the + end of the int, and that character is output in the thisChar parameter. + + The formats for integers are: 1, +1, and -1 + The + and - signs are included in the output buffer. + + The CharBuffer to append to. + Whether or not to consider + to be part + of an integer. + The last character read by this method. + true for parsed an int, false for not an int + + + + Parse the rest of the stream and put all the tokens + in the input ArrayList. This resets the line number to 1. + + The ArrayList to append to. + bool - true for success + + + + Parse all tokens from the specified TextReader, put + them into the input ArrayList. + + The TextReader to read from. + The ArrayList to append to. + bool - true for success, false for failure. + + + + Parse all tokens from the specified file, put + them into the input ArrayList. + + The file to read. + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Tokenize a file completely and return the tokens in a Token[]. + + The file to tokenize. + A Token[] with all tokens. + + + + Parse all tokens from the specified string, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Parse all tokens from the specified Stream, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + This is the TextReader that this object will read from. + Set this to set the input reader for the parse. + + + + + The settings which govern the behavior of the tokenization. + + + + + The states of the state machine. + + + + + Token class used by StreamTokenizer. + This represents a single token in the input stream. + This is subclassed to provide specific token types, + such as CharToken, FloatToken, etc. + + + + + The line number in the input stream where this token originated. + This is base-1. + + + + + A storage object for the data of this token. + + + + + Backer for UntermError. + + + + An error message associated with unterm error. + + + + Construct a Token with the specified line number. + + The line number where this + token comes from. + + + + Equals override. + + The object to compare to. + bool - true for equals, false otherwise. + + + + Equals overload. + + The string to compare to. + bool + + + + Equals overload. + + The char to compare to. + bool + + + + Operator== overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator!= overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator== overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator!= overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator== overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Operator!= overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Override. Returns the ToString().GetHashCode(). + + The hash code. + + + + Produce a string which includes the line number. + + + + + + Produce a string which includes the token type. + + + + + + Create an object of the specified type corresponding to + this token. + + The type of object to create. + The new object, or null for error. + + + + The line number where this token was found. This is base-1. + + + + + The Object stored by this token. This will be + a primitive C# type. + + + + + Whether or not there was an unterminated token problem + when creating this token. See UntermErrorMessage for + a message associated with the problem. + + + + + The error message if there was an unterminated token error + creating this token. + + + + + Return this token's value as a string. + + This token's value as a string. + + + + Represents end-of-lines (line separator characters). + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Represents end of file/stream. + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Abstract base class for string tokens. + + + + Default constructor. + + + Constructor with the specified value + and line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for words, meaning sequences of word + characters. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for Quotes such as "this is a quote". + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for comments, including line and block + comments. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for whitespace such as spaces and tabs. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for characters, meaning non-word characters. + + + + Constructor with the specified value + and line number. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for floating point numbers, stored internally as a Double. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value and line number. + + + + + Constructor with the specified value and line number. + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Token type for integer tokens. This handles both Int32 and Int64. + + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + Constructor with the specified value + and line number. + + + + Constructor for a 64 bit int + + + + + Parse a string known to be a hex string. This is faster + than Parse which doesn't assume the number is Hex. This will + throw an exception if the input number isn't hex. + + The hex number as a string. + The line where this token was found. + A new IntToken set to the value in the input string. + + + + Convert the input string to an integer, if possible + + The string to parse. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + This enumerates verbosity levels. + + + + For error messages. + + + For warn messages. + + + For info messages. + + + For debug messages. + + + + Framework replacement for string.IsNullOrWhitespace + + The string to test + A value indicating if is null, empty or only contains whitespace characters + + + + A CoordinateFilter that builds a set of Coordinates. + The set of coordinates contains no duplicate points. + + + + + Convenience method which allows running the filter over an array of s. + + an array of coordinates + an array of the unique coordinates + + + + + + + + + + Returns the gathered s. + + + + + An algorithm for computing a distance metric + which is an approximation to the Hausdorff Distance + based on a discretization of the input . + + + + The algorithm computes the Hausdorff distance restricted to discrete points + for one of the geometries. + The points can be either the vertices of the geometries (the default), + or the geometries with line segments densified by a given fraction. + Also determines two points of the Geometries which are separated by the computed distance. + + + This algorithm is an approximation to the standard Hausdorff distance. + Specifically, + + for all geometries a, b: DHD(a, b) <= HD(a, b) + + The approximation can be made as close as needed by densifying the input geometries. + In the limit, this value will approach the true Hausdorff distance: + + DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 + + The default approximation is exact or close enough for a large subset of useful cases. + + + Examples of these are: + + + computing distance between Linestrings that are roughly parallel to each other, + and roughly equal in length. This occurs in matching linear networks. + + Testing similarity of geometries. + + + + An example where the default approximation is not close is: + + A = LINESTRING (0 0, 100 0, 10 100, 10 100) + B = LINESTRING (0 100, 0 10, 80 10) + + DHD(A, B) = 22.360679774997898 + HD(A, B) ~= 47.8 + + + + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The Discrete Hausdorff Distance + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The densify fraction. A value of 0 indicates, that no densification should take place + The Discrete Hausdorff Distance + + + Value of 0.0 indicates that no densification should take place + + + + Gets/sets the fraction by which to densify each segment. + + + Each segment will be (virtually) split into a number of equal-length + subsegments, whose fraction of the total length is closest + to the given fraction. + + +
+
Index: packages/NetTopologySuite.1.14/lib/net403-client/PowerCollections.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net403-client/PowerCollections.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net403-client/PowerCollections.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net403-client/PowerCollections.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,11141 @@ + + + + PowerCollections + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Makes a deep clone of this Deque. A new Deque is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the Deque takes time O(N), where N is the number of items in the Deque. + The cloned Deque. + T is a reference type that does not implement ICloneable. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Serialize the hash table. Called from the serialization infrastructure. + + + + + Called on deserialization. We cannot deserialize now, because hash codes + might not be correct now. We do real deserialization in the OnDeserialization call. + + + + + Deserialize the hash table. Called from the serialization infrastructure when + the object graph has finished deserializing. + + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N log N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Makes a deep clone of this BigList. A new BigList is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then this method is the same as Clone. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + +
+
Index: packages/NetTopologySuite.1.14/lib/net45/NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net45/NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net45/NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net45/NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,34111 @@ + + + + NetTopologySuite + + + + + An interface for rules which determine whether node points + which are in boundaries of geometry components + are in the boundary of the parent geometry collection. + The SFS specifies a single kind of boundary node rule, + the rule. + However, other kinds of Boundary Node Rules are appropriate + in specific situations (for instance, linear network topology + usually follows the .) + Some JTS operations + (such as , and ) + allow the BoundaryNodeRule to be specified, + and respect the supplied rule when computing the results of the operation. + + An example use case for a non-SFS-standard Boundary Node Rule is + that of checking that a set of s have + valid linear network topology, when turn-arounds are represented + as closed rings. In this situation, the entry road to the + turn-around is only valid when it touches the turn-around ring + at the single (common) endpoint. This is equivalent + to requiring the set of LineStrings to be + simple under the . + The SFS-standard is not + sufficient to perform this test, since it + states that closed rings have no boundary points. + + This interface and its subclasses follow the Strategy design pattern. + + Martin Davis + + + + + + + + Tests whether a point that lies in boundaryCount + geometry component boundaries is considered to form part of the boundary + of the parent geometry. + + boundaryCount the number of component boundaries that this point occurs in + true if points in this number of boundaries lie in the parent boundary + + + + Provides access to static instances of common s. + + + + + The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). + + + + + The Endpoint Boundary Node Rule. + + + + The MultiValent Endpoint Boundary Node Rule. + + + + The Monovalent Endpoint Boundary Node Rule. + + + + + The Boundary Node Rule specified by the OGC Simple Features Specification, + which is the same as the Mod-2 rule. + + + + + + A specifies that points are in the + boundary of a lineal geometry iff + the point lies on the boundary of an odd number + of components. + Under this rule s and closed + s have an empty boundary. + + + This is the rule specified by the OGC SFS, + and is the default rule used in JTS. + + Martin Davis + + + + A which specifies that any points which are endpoints + of lineal components are in the boundary of the + parent geometry. + This corresponds to the "intuitive" topological definition + of boundary. + Under this rule s have a non-empty boundary + (the common endpoint of the underlying LineString). + + + This rule is useful when dealing with linear networks. + For example, it can be used to check + whether linear networks are correctly noded. + The usual network topology constraint is that linear segments may touch only at endpoints. + In the case of a segment touching a closed segment (ring) at one point, + the Mod2 rule cannot distinguish between the permitted case of touching at the + node point and the invalid case of touching at some other interior (non-node) point. + The EndPoint rule does distinguish between these cases, + so is more appropriate for use. + + Martin Davis + + + + A which determines that only + endpoints with valency greater than 1 are on the boundary. + This corresponds to the boundary of a + being all the "attached" endpoints, but not + the "unattached" ones. + + Martin Davis + + + + A which determines that only + endpoints with valency of exactly 1 are on the boundary. + This corresponds to the boundary of a + being all the "unattached" endpoints. + + Martin Davis + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + It is also a reasonable strategy for cases where the + endpoint of one segment lies on or almost on the interior of another one. + Taking the most central endpoint ensures that the computed intersection + point lies in the envelope of the segments. + Also, by always returning one of the input points, this should result + in reducing segment fragmentation. + Intended to be used as a last resort for + computing ill-conditioned intersection situations which + cause other methods to fail. + + + WARNING: in some cases this algorithm makes a poor choice of endpoint. + It has been replaced by a better heuristic in . + + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + + Creates an instance of this class using the provided input coordinates + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + Determines a point closest to the given point. + + + + + Gets the intersection point + + + + + Computes the centroid of a of any dimension. + If the geometry is nominally of higher dimension, + but has lower effective dimension + (i.e. contains only components + having zero length or area), + the centroid will be computed as for the equivalent lower-dimension geometry. + If the input geometry is empty, a + null Coordinate is returned. + +

Algorithm

+ + Dimension 2 - the centroid ic computed + as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + Holes and multipolygons are handled correctly. + See http://www.faqs.org/faqs/graphics/algorithms-faq/ + for further details of the basic approach. + Dimension 1 - Computes the average of the midpoints + of all line segments weighted by the segment length. + Zero-length lines are treated as points. + + Dimension 0 - Compute the average coordinate over all points. + Repeated points are all included in the average + + + If the input geometries are empty, a null Coordinate is returned. +
+ 1.7 +
+ + + Computes the centroid point of a geometry. + + The geometry to use + + The centroid point, or null if the geometry is empty + + + + + the point all triangles are based at + + + + + temporary variable to hold centroid of triangle + + + + + Partial area sum + + + + + partial centroid sum + + + + + Creates a new instance for computing the centroid of a geometry + + + + + Adds a to the centroid total. + + >The to add. + + + + Gets the computed centroid. + + The computed centroid, or null if the input is empty + + + + Computes three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3. + The area is positive if the triangle is oriented CCW, and negative if CW. + + + + + Adds the line segments defined by an array of coordinates + to the linear centroid accumulators. + + An array of s + + + + Adds a point to the point centroid accumulator. + + A + + + + Computes the centroid of an area point. + + + Algorithm: + + Based on the usual algorithm for calculating + the centroid as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + + The algorithm has been extended to handle holes and multi-polygons. + See + for further details of the basic approach. + + + The code has also be extended to handle degenerate (zero-area) polygons. + In this case, the centroid of the line segments in the polygon + will be returned. + + + + + + Adds the area defined by a Geometry to the centroid total. + If the point has no area it does not contribute to the centroid. + + The point to add. + + + + Adds the area defined by an array of + coordinates. The array must be a ring; + i.e. end with the same coordinate as it starts with. + + An array of Coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3, + positive if a,b,c are oriented ccw, and negative if cw. + + + + + Adds the linear segments defined by an array of coordinates + to the linear centroid accumulators. + This is done in case the polygon(s) have zero-area, + in which case the linear centroid is computed instead. + + an array of s + + + + + + + + + + + + + + Computes the centroid of a linear point. + Algorithm: + Compute the average of the midpoints + of all line segments weighted by the segment length. + + + + + Adds the linear components of by a Geometry to the centroid total. + If the geometry has no linear components it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by an array of coordinates. + + An array of Coordinates. + + + + + + + + + Computes the centroid of a point point. + Algorithm: + Compute the average of all points. + + + + + Adds the point(s) defined by a Geometry to the centroid total. + If the point is not of dimension 0 it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by a coordinate. + + A coordinate. + + + + + + + + Basic computational geometry algorithms + for geometry and coordinates defined in 3-dimensional Cartesian space. + + @author mdavis + + + + Computes the distance between two 3D segments. + + @param A the start point of the first segment + @param B the end point of the first segment + @param C the start point of the second segment + @param D the end point of the second segment + @return the distance between the segments + + + + Implements basic computational geometry algorithms using arithmetic. + + Martin Davis + + + + A value which is safely greater than the + relative round-off error in double-precision numbers + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + Computes the sign of the determinant of the 2x2 matrix + with the given entries. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is 0. + + + + + + A filter for computing the orientation index of three coordinates. + + If the orientation can be computed safely using standard DP + arithmetic, this routine returns the orientation index. + Otherwise, a value i > 1 is returned. + In this case the orientation index must + be computed using some other more robust method. + The filter is fast to compute, so can be used to + avoid the use of slower robust methods except when they are really needed, + thus providing better average performance. + + Uses an approach due to Jonathan Shewchuk, which is in the public domain. + + + + The orientation index if it can be computed safely + > 1 if the orientation index cannot be computed safely> + + + + + + Computes an intersection point between two lines + using DD arithmetic. + Currently does not handle case of parallel lines. + + A point of 1st segment + Another point of 1st segment + A point of 2nd segment + Another point of 2nd segment + + + + + Specifies and implements various fundamental Computational Geometric algorithms. + The algorithms supplied in this class are robust for double-precision floating point. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + Returns the index of the direction of the point q + relative to a vector specified by p1-p2. + + The origin point of the vector. + The final point of the vector. + The point to compute the direction to. + + 1 if q is counter-clockwise (left) from p1-p2, + -1 if q is clockwise (right) from p1-p2, + 0 if q is collinear with p1-p2. + + + + + Tests whether a point lies inside or on a ring. + + + The ring may be oriented in either direction. + A point lying exactly on the ring boundary is considered to be inside the ring. + This method does not first check the point against the envelope + of the ring. + + Point to check for ring inclusion. + An array of s representing the ring (which must have first point identical to last point) + true if p is inside ring. + + + + + Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. + + + The ring may be oriented in either direction. + This method does not first check the point against the envelope of the ring. + + Point to check for ring inclusion + An array of coordinates representing the ring (which must have first point identical to last point) + The of p relative to the ring + + + + Tests whether a point lies on the line segments defined by a + list of coordinates. + + + + true if the point is a vertex of the line + or lies in the interior of a line segment in the linestring + + + + + Computes whether a ring defined by an array of s is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + An array of s froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + A coordinate sequence froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + The first vertex of the line segment + The second vertex of the line segment + The point to compute the relative orientation of + + 1 if q is counter-clockwise from p1-p2, + or -1 if q is clockwise from p1-p2, + or 0 if q is collinear with p1-p2 + + + + + Computes the distance from a point p to a line segment AB. + Note: NON-ROBUST! + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The distance from p to line segment AB. + + + + Computes the perpendicular distance from a point p + to the (infinite) line containing the points AB + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The perpendicular distance from p to line AB. + + + + Computes the distance from a point to a sequence of line segments. + + A point + A sequence of contiguous line segments defined by their vertices + The minimum distance between the point and the line segments + If there are too few points to make up a line (at least one?) + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates of the ring + The signed area of the ring + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates forming the ring + The signed area of the ring + + + + Computes the length of a linestring specified by a sequence of points. + + The points specifying the linestring + The length of the linestring + + + + Computes the convex hull of a . + The convex hull is the smallest convex Geometry that contains all the + points in the input Geometry. + Uses the Graham Scan algorithm. + + + + + Create a new convex hull construction for the input Geometry. + + + + + + Create a new convex hull construction for the input array. + + + + + + + + + + + + + + Returns a Geometry that represents the convex hull of the input point. + The point will contain the minimal number of points needed to + represent the convex hull. In particular, no more than two consecutive + points will be collinear. + + + If the convex hull contains 3 or more points, a Polygon; + 2 points, a LineString; + 1 point, a Point; + 0 points, an empty GeometryCollection. + + + + + Uses a heuristic to reduce the number of points scanned to compute the hull. + The heuristic is to find a polygon guaranteed to + be in (or on) the hull, and eliminate all points inside it. + A quadrilateral defined by the extremal points + in the four orthogonal directions + can be used, but even more inclusive is + to use an octilateral defined by the points in the 8 cardinal directions. + Note that even if the method used to determine the polygon vertices + is not 100% robust, this does not affect the robustness of the convex hull. + + To satisfy the requirements of the Graham Scan algorithm, + the returned array has at least 3 entries. + + + The coordinates to reduce + The reduced array of coordinates + + + + Pre sorts the coordinates + + + + + + + + + + + + + + + + + + + + Whether the three coordinates are collinear + and c2 lies between c1 and c3 inclusive. + + + + + + + + + + + + + + + + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + A 2-vertex LineString if the vertices are collinear; + otherwise, a Polygon with unnecessary (collinear) vertices removed. + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + The coordinates with unnecessary (collinear) vertices removed. + + + + Compares s for their angle and distance + relative to an origin. + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + Computes the Euclidean distance (L2 metric) from a to a . + + + Also computes two points on the geometry which are separated by the distance found. + + + + + Contains a pair of points and the distance between them. + + + Provides methods to update with a new point pair with either maximum or minimum distance. + + + + + Initializes to null. + + + + + Initializes the points. + + 1st coordinate + 2nd coordinate + + + + Initializes the points, avoiding recomputing the distance. + + 1st coordinate + 2nd coordinate + the distance between and + + + + The distance between the paired coordinates + + + + + Returns an array containing the paired points + + + + + Represents a homogeneous coordinate in a 2-D coordinate space. + In NTS s are used as a clean way + of computing intersections between line segments. + + David Skea + + + + Computes the (approximate) intersection point between two line segments using homogeneous coordinates. + + + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + 1st Coordinate of 1st linesegment + 2nd Coordinate of 1st linesegment + 1st Coordinate of 2nd linesegment + 2nd Coordinate of 2nd linesegment + + + + Computes the (approximate) intersection point between two line segments + using homogeneous coordinates. + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a homogeneous coordinate which is the intersection of the lines s. + define by the homogenous coordinates represented by two + + A coordinate + A coordinate + + + + Direct access to x private field + + + + + Direct access to y private field + + + + + Direct access to w private field + + + + + + + + + + Computes a point in the interior of an areal geometry. + + +

Algorithm:

+ + Find a Y value which is close to the centre of + the geometry's vertical extent but is different + to any of it's Y ordinates. + Create a horizontal bisector line using the Y value + and the geometry's horizontal extent + Find the intersection between the geometry + and the horizontal bisector line. + The intersection is a collection of lines and points. + Pick the midpoint of the largest intersection geometry + +

KNOWN BUGS

+ + If a fixed precision model is used, + in some cases this method may return a point + which does not lie in the interior.
+
+ + + + + + + + + + + Creates a new interior point finder + for an areal geometry. + + An areal geometry + + + + Tests the interior vertices (if any) + defined by an areal Geometry for the best inside point. + If a component Geometry is not of dimension 2 it is not tested. + + The point to add. + + + + Finds an interior point of a Polygon. + + The geometry to analyze. + + + + If point is a collection, the widest sub-point; otherwise, + the point itself. + + + + + + + + + + + + Returns the centre point of the envelope. + + The envelope to analyze. + The centre of the envelope. + + + + Gets the computed interior point. + + + + + Finds a safe bisector Y ordinate + by projecting to the Y axis + and finding the Y-ordinate interval + which contains the centre of the Y extent. + The centre of this interval is returned as the bisector Y-ordinate. + + Martin Davis + + + + Computes a point in the interior of an linear point. + Algorithm: + Find an interior vertex which is closest to + the centroid of the linestring. + If there is no interior vertex, find the endpoint which is + closest to the centroid. + + + + + + + + + + + Tests the interior vertices (if any) + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + Tests the endpoint vertices + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + + + + + + + + + + + + Computes a point in the interior of an point point. + Algorithm: + Find a point which is closest to the centroid of the point. + + + + + + + + + + + Tests the point(s) defined by a Geometry for the best inside point. + If a Geometry is not of dimension 0 it is not tested. + + The point to add. + + + + + + + + + + + + + + + An interface for classes which determine the of points in a + + Martin Davis + + + + Determines the of a point in the . + + The point to test + the location of the point in the geometry + + + + A LineIntersector is an algorithm that can both test whether + two line segments intersect and compute the intersection point(s) + if they do. + + There are three possible outcomes when determining whether two line segments intersect: + + - the segments do not intersect + - the segments intersect in a single point + - the segments are collinear and they intersect in a line segment + + + + For segments which intersect in a single point, the point may be either an endpoint + or in the interior of each segment. + If the point lies in the interior of both segments, + this is termed a proper intersection. + The property test for this situation. + + The intersection point(s) may be computed in a precise or non-precise manner. + Computing an intersection point precisely involves rounding it + via a supplied . + + LineIntersectors do not perform an initial envelope intersection test + to determine if the segments are disjoint. + This is because this class is likely to be used in a context where + envelope overlap is already known to occur (or be likely). + + + + + These are deprecated, due to ambiguous naming + + + + Indicates that line segments do not intersect + + + + + Indicates that line segments intersect in a single point + + + + + Indicates that line segments intersect in a line segment + + + + + Computes the "edge distance" of an intersection point p along a segment. + The edge distance is a metric of the point along the edge. + The metric used is a robust and easy to compute metric function. + It is not equivalent to the usual Euclidean metric. + It relies on the fact that either the x or the y ordinates of the + points in the edge are unique, depending on whether the edge is longer in + the horizontal or vertical direction. + NOTE: This function may produce incorrect distances + for inputs where p is not precisely on p1-p2 + (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. + My hypothesis is that the function is safe to use for points which are the + result of rounding points which lie on the line, but not safe to use for truncated points. + + + + + This function is non-robust, since it may compute the square of large numbers. + Currently not sure how to improve this. + + + + + The indexes of the endpoints of the intersection lines, in order along + the corresponding line + + + + + If MakePrecise is true, computed intersection coordinates will be made precise + using Coordinate.MakePrecise. + + + + + Gets an endpoint of an input segment. + + the index of the input segment (0 or 1) + the index of the endpoint (0 or 1) + The specified endpoint + + + + Compute the intersection of a point p and the line p1-p2. + This function computes the bool value of the hasIntersection test. + The actual value of the intersection (if there is one) + is equal to the value of p. + + + + + Computes the intersection of the lines p1-p2 and p3-p4. + This function computes both the bool value of the hasIntersection test + and the (approximate) value of the intersection point itself (if there is one). + + + + + Returns the intIndex'th intersection point. + + is 0 or 1. + The intIndex'th intersection point. + + + + Test whether a point is a intersection point of two line segments. + Note that if the intersection is a line segment, this method only tests for + equality with the endpoints of the intersection segment. + It does not return true if the input point is internal to the intersection segment. + + true if the input point is one of the intersection points. + + + + Tests whether either intersection point is an interior point of one of the input segments. + + + true if either intersection point is in the interior of one of the input segment. + + + + + Tests whether either intersection point is an interior point of the specified input segment. + + + true if either intersection point is in the interior of the input segment. + + + + + Computes the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The intIndex'th intersection point in the direction of the specified input line segment. + + + + + Computes the index (order) of the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The index of the intersection point along the segment (0 or 1). + + + + + Computes the intersection line index + + The segment index + + + + Computes the "edge distance" of an intersection point along the specified input line segment. + + is 0 or 1. + is 0 or 1. + The edge distance of the intersection point. + + + + Alias the [0] for ease of reference + + + + + Alias the [1] for ease of reference + + + + + Force computed intersection to be rounded to a given precision model + + + + + Force computed intersection to be rounded to a given precision model. + No getter is provided, because the precision model is not required to be specified. + + + + + Tests whether the input geometries intersect. + + true if the input geometries intersect. + + + + Returns the number of intersection points found. This will be either 0, 1 or 2. + + The number of intersection points found (0, 1, or 2) + + + + Tests whether an intersection is proper. + The intersection between two line segments is considered proper if + they intersect in a single point in the interior of both segments + (e.g. the intersection is a single point and is not equal to any of the endpoints). + The intersection between a point and a line segment is considered proper + if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). + + true if the intersection is proper. + + + + Determines the location of s relative to + a geometry, using indexing for efficiency. + This algorithm is suitable for use in cases where + many points will be tested against a given area. + + Thread-safe and immutable. + + Martin Davis + + + + An interface for classes which determine the of + points in areal geometries. + + Martin Davis + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + Creates a new locator for a given . + + the Geometry to locate in + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + + A visitor for items in an index. + + + + + + + + + + + Static methods for classes + + + + + Convenience method to test a point for intersection with a geometry + + The geometry is wrapped in a class. + + The locator to use. + The coordinate to test. + true if the point is in the interior or boundary of the geometry. + + + Computes the location of points relative to an areal , using a simple O(n) algorithm. + This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. + + The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. + + + + Determines the of a point in an areal . Currently this will never return a value of . + + The point to test + The areal geometry to test + The Location of the point in the geometry + + + + Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. + + The point to test + A linear ring + true if the point lies inside the ring + + + + Measures the degree of similarity between two s + using the area of intersection between the geometries. + The measure is normalized to lie in the range [0, 1]. + Higher measures indicate a great degree of similarity. + + + NOTE: Currently experimental and incomplete. + + mbdavis + + + + An interface for classes which measures the degree of similarity between two {@link Geometry}s. + + + The computed measure lies in the range [0, 1]. + Higher measures indicate a great degree of similarity. + A measure of 1.0 indicates that the input geometries are identical + A measure of 0.0 indicates that the geometries have essentially no similarity. + The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. + + mbdavis + + + + Function to measure the similarity between two s. + + A geometry + A geometry + The similarity value between two s + + + + Measures the degree of similarity between two s using the Hausdorff distance metric. + + + + The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. + + + The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing + this by dividing it by the diagonal distance across the envelope of the combined geometries. + + + mbdavis + + + + + + + + + + + Provides methods to mathematically combine values. + + Martin Davis + + + + + + + + + + + + Implements IPointInRing + using a MonotoneChains and a BinTree index to increase performance. + + + + + + An interface for classes which test whether a Coordinate lies inside a ring. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The action for the internal iterator for performing + envelope select queries on a MonotoneChain. + + + + + These envelopes are used during the MonotoneChain search process. + + + + + + + + + + This method is overridden to process a segment + in the context of the parent chain. + + The parent chain + The index of the start vertex of the segment being processed + + + + This is a convenience method which can be overridden to obtain the actual + line segment which is selected. + + + + + + + + + + + + + + + + + + + Computes the Minimum Bounding Circle (MBC) for the points in a . + The MBC is the smallest circle which covers all the input points + (this is also sometimes known as the Smallest Enclosing Circle). + This is equivalent to computing the Maximum Diameter of the input point set. + + + + The computed circle can be specified in two equivalent ways, + both of which are provide as output by this class: + + As a centre point and a radius + By the set of points defining the circle. + + Depending on the number of points in the input + and their relative positions, this + will be specified by anywhere from 0 to 3 points. + + 0 or 1 points indicate an empty or trivial input point arrangment. + 2 or 3 points define a circle which contains + all the input points. + + + + + The class can also output a which approximates the + shape of the MBC (although as an approximation it is not + guaranteed to cover all the input points.) + + Martin Davis + + + The algorithm used is based on the one by Jon Rokne in + the article "An Easy Bounding Circle" in Graphic Gems II. + + + + Creates a new object for computing the minimum bounding circle for the + point set defined by the vertices of the given geometry. + + The geometry to use to obtain the point set + + + + Gets a geometry which represents the Minimum Bounding Circle. + + + + If the input is degenerate (empty or a single unique point), + this method will return an empty geometry or a single Point geometry. + Otherwise, a Polygon will be returned which approximates the + Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) + + + A Geometry representing the Minimum Bounding Circle. + + + + Gets a geometry representing a line between the two farthest points + in the input. + These points will be two of the extremal points of the Minimum Bounding Circle. + They also lie on the convex hull of the input. + + A LineString between the two farthest points of the input + An empty LineString if the input is empty + A Point if the input is a point + + + + Gets a geometry representing the diameter of the computed Minimum Bounding Circle. + + + + the diameter line of the Minimum Bounding Circle + an empty line if the input is empty + a Point if the input is a point + + + + + + Gets the extremal points which define the computed Minimum Bounding Circle. + + + There may be zero, one, two or three of these points, + depending on the number of points in the input + and the geometry of those points. + + The points defining the Minimum Bounding Circle + + + + Gets the centre point of the computed Minimum Bounding Circle. + + the centre point of the Minimum Bounding Circle, null if the input is empty + + + + Gets the radius of the computed Minimum Bounding Circle. + + The radius of the Minimum Bounding Circle + + + + Computes the minimum diameter of a . + + + + The minimum diameter is defined to be the + width of the smallest band that contains the point, + where a band is a strip of the plane defined + by two parallel lines. + This can be thought of as the smallest hole that the point can be + moved through, with a single rotation. + + + The first step in the algorithm is computing the convex hull of the Geometry. + If the input Geometry is known to be convex, a hint can be supplied to + avoid this computation. + + + This class can also be used to compute a line segment representing + the minimum diameter, the supporting line segment of the minimum diameter, + and a minimum rectangle enclosing the input geometry. + This rectangle will + have width equal to the minimum diameter, and have one side + parallel to the supporting segment. + + + + + + + Gets the minimum rectangle enclosing a geometry. + + The geometry + The minimum rectangle enclosing the geometry + + + + Gets the minimum diameter enclosing a geometry. + + The geometry + The length of the minimum diameter of the geometry + + + + Compute a minimum diameter for a given . + + a Geometry. + + + + Compute a minimum diameter for a giver Geometry, + with a hint if + the Geometry is convex + (e.g. a convex Polygon or LinearRing, + or a two-point LineString, or a Point). + + a Geometry which is convex. + true if the input point is convex. + + + + + + + + + + + + + + + Compute the width information for a ring of Coordinates. + Leaves the width information in the instance variables. + + + + + + + + + + + + + + + + + + + + + + + Gets the minimum rectangular which encloses the input geometry. + + + + The rectangle has width equal to the minimum diameter, and a longer length. + If the convex hull of the input is degenerate (a line or point) a or is returned. + + + The minimum rectangle can be used as an extremely generalized representation for the given geometry. + + + The minimum rectangle enclosing the input (or a line or point if degenerate) + + + + Gets the length of the minimum diameter of the input Geometry. + + The length of the minimum diameter. + + + + Gets the Coordinate forming one end of the minimum diameter. + + A coordinate forming one end of the minimum diameter. + + + + Gets the segment forming the base of the minimum diameter. + + The segment forming the base of the minimum diameter. + + + + Gets a LineString which is a minimum diameter. + + A LineString which is a minimum diameter. + + + + Non-robust versions of various fundamental Computational Geometric algorithms, + FOR TESTING PURPOSES ONLY!. + The non-robustness is due to rounding error in floating point computation. + + + + + + + + + + + + + Computes whether a ring defined by an array of Coordinate is + oriented counter-clockwise. + This will handle coordinate lists which contain repeated points. + + an array of coordinates forming a ring. + + true if the ring is oriented counter-clockwise. + throws ArgumentException if the ring is degenerate (does not contain 3 different points) + + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + 1 if q is counter-clockwise from p1-p2 + -1 if q is clockwise from p1-p2 + 0 if q is collinear with p1-p2 + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + the origin point of the vector + the final point of the vector + the point to compute the direction to + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + A non-robust version of LineIntersector. + + + + + + + + + + true if both numbers are positive or if both numbers are negative, + false if both numbers are zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RParameter computes the parameter for the point p + in the parameterized equation + of the line from p1 to p2. + This is equal to the 'distance' of p along p1-p2. + + + + + + + + + + + + + + + Computes the topological relationship () of a single point to a Geometry. + + + A may be specified to control the evaluation of whether the point lies on the boundary or not + The default rule is to use the the SFS Boundary Determination Rule + + Notes: + + s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. + + Instances of this class are not reentrant. + + + + + + Initializes a new instance of the class. + + + + + Convenience method to test a point for intersection with a Geometry + + The coordinate to test. + The Geometry to test. + true if the point is in the interior or boundary of the Geometry. + + + + Computes the topological relationship ({Location}) of a single point to a Geometry. + It handles both single-element and multi-element Geometries. + The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. + + The Location of the point relative to the input Geometry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the number of segments crossed by a horizontal ray extending to the right + from a given point, in an incremental fashion. + This can be used to determine whether a point lies in a geometry. + The class determines the situation where the point lies exactly on a segment. + When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. + + + This class handles polygonal geometries with any number of shells and holes. + The orientation of the shell and hole rings is unimportant. + In order to compute a correct location for a given polygonal geometry, + it is essential that all segments are counted which + + touch the ray + lie in in any ring which may contain the point + + + The only exception is when the point-on-segment situation is detected, in which + case no further processing is required. + The implication of the above rule is that segments which can be a priori determined to not touch the ray + (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. + + + Martin Davis + + + + Determines the of a point in a ring. + This method is an exemplar of how to use this class. + + The point to test + An array of Coordinates forming a ring + The location of the point in the ring + + + + Determines the of a point in a ring. + + The point to test + A coordinate sequence forming a ring + The location of the point in the ring + + + + Counts a segment + + An endpoint of the segment + Another endpoint of the segment + + + + Reports whether the point lies exactly on one of the supplied segments. + + This method may be called at any time as segments are processed. If the result of this method is true, + no further segments need be supplied, since the result will never change again. + + + + + + Gets the of the point relative to the ring, polygon + or multipolygon from which the processed segments were provided. + + This property only determines the correct location if all relevant segments have been processed + + + + Tests whether the point lies in or on the ring, polygon + + + This property only determines the correct location if all relevant segments have been processed + + + + Computes whether a rectangle intersects line segments. + + + Rectangles contain a large amount of inherent symmetry + (or to put it another way, although they contain four + coordinates they only actually contain 4 ordinates + worth of information). + The algorithm used takes advantage of the symmetry of + the geometric situation + to optimize performance by minimizing the number + of line intersection tests. + + Martin Davis + + + + Creates a new intersector for the given query rectangle, + specified as an . + + The query rectangle, specified as an Envelope + + + + Tests whether the query rectangle intersects a given line segment. + + The first endpoint of the segment + The second endpoint of the segment + true if the rectangle intersects the segment + + + + Implements an algorithm to compute the + sign of a 2x2 determinant for double precision values robustly. + It is a direct translation of code developed by Olivier Devillers. + + The original code carries the following copyright notice: + ************************************************************************ + Author : Olivier Devillers + Olivier.Devillers@sophia.inria.fr + http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html + + Olivier Devillers has allowed the code to be distributed under + the LGPL (2012-02-16) saying "It is ok for LGPL distribution." + + ************************************************************************* + ************************************************************************* + Copyright (c) 1995 by INRIA Prisme Project + BP 93 06902 Sophia Antipolis Cedex, France. + All rights reserved + ************************************************************************* + + + + + Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is null. + + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + A robust version of . + + + + + + + + + + + + + + + + + + + + + + + This method computes the actual value of the intersection point. + To obtain the maximum precision from the intersection calculation, + the coordinates are normalized by subtracting the minimum + ordinate values (in absolute value). This has the effect of + removing common significant digits from the calculation to + maintain more bits of precision. + + + + + + + + + + Computes a segment intersection using homogeneous coordinates. + Round-off error can cause the raw computation to fail, + (usually due to the segments being approximately parallel). + If this happens, a reasonable approximation is computed instead. + + + + + Normalize the supplied coordinates to + so that the midpoint of their intersection envelope + lies at the origin. + + + + + Tests whether a point lies in the envelopes of both input segments. + A correctly computed intersection point should return true + for this test. + Since this test is for debugging purposes only, no attempt is + made to optimize the envelope test. + + + true if the input point lies within both input segment envelopes. + + + + Finds the endpoint of the segments P and Q which + is closest to the other segment. + This is a reasonable surrogate for the true + intersection points in ill-conditioned cases + (e.g. where two segments are nearly coincident, + or where the endpoint of one segment lies almost on the other segment). + + + This replaces the older CentralEndpoint heuristic, + which chose the wrong endpoint in some cases + where the segments had very distinct slopes + and one endpoint lay almost on the other segment. + + an endpoint of segment P + an endpoint of segment P + an endpoint of segment Q + an endpoint of segment Q + the nearest endpoint to the other segment + + + + Tests whether a Coordinate lies inside + a ring, using a linear-time algorithm. + + + + + + + + + + + + + + + + + + + + + + + Implements PointInRing using a SIRtree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all ICRSObject implementing types + + + + + Base Interface for CRSBase Object types. + + + + + Gets the CRS type. + + + + + Gets the type of the CRSBase object. + + + + + Gets the properties. + + + + + Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. + + + + + Defines the Named CRS type. + + + + + Defines the Linked CRS type. + + + + + Defines the Linked CRS type. + + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Defines the Named CRS type. + + + + + Initializes a new instance of the class. + + + The mandatory name + member must be a string identifying a coordinate reference system. OGC CRS URNs such as + 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. + + + + + A graph containing s. + + + + + A graph comprised of s. + It supports tracking the vertices in the graph + via edges incident on them, + to allow efficient lookup of edges and vertices. + + + This class may be subclassed to use a + different subclass of HalfEdge, + by overriding . + If additional logic is required to initialize + edges then + can be overridden as well. + + + + + Creates a single HalfEdge. + Override to use a different HalfEdge subclass. + + the origin location + a new with the given origin + + + + Adds an edge between the coordinates orig and dest + to this graph. + + + Only valid edges can be added (in particular, zero-length segments cannot be added) + + the edge origin location + the edge destination location + The created edge + null if the edge was invalid and not added + + + + + Test if an the coordinates for an edge form a valid edge (with non-zero length) + + The start coordinate + The end coordinate + true of the edge formed is valid + + + + Inserts an edge not already present into the graph. + + the edge origin location + the edge destination location + an existing edge with same orig (if any) + the created edge + + + + Finds an edge in this graph with the given origin + and destination, if one exists. + + the origin location + the destination location + an edge with the given orig and dest, or null if none exists + + + + A HalfEdge which carries information + required to support . + + + + + A which supports + marking edges with a boolean flag. + Useful for algorithms which perform graph traversals. + + + + + Represents a directed component of an edge in an . + HalfEdges link vertices whose locations are defined by s. + HalfEdges start at an origin vertex, + and terminate at a destination vertex. + HalfEdges always occur in symmetric pairs, with the method + giving access to the oppositely-oriented component. + HalfEdges and the methods on them form an edge algebra, + which can be used to traverse and query the topology + of the graph formed by the edges. + + + By design HalfEdges carry minimal information + about the actual usage of the graph they represent. + They can be subclassed to carry more information if required. + + + HalfEdges form a complete and consistent data structure by themselves, + but an is useful to allow retrieving edges + by vertex and edge location, as well as ensuring + edges are created and linked appropriately. + + + + + Creates a HalfEdge pair representing an edge + between two vertices located at coordinates p0 and p1. + + a vertex coordinate + a vertex coordinate + the HalfEdge with origin at p0 + + + + Initialize a symmetric pair of HalfEdges. + Intended for use by subclasses. + The edges are initialized to have each other + as the edge, and to have pointers + which point to edge other. + This effectively creates a graph containing a single edge. + + a HalfEdge + a symmetric HalfEdge + the initialized edge e0 + + + + Creates an edge originating from a given coordinate. + + the origin coordinate + + + + Finds the edge starting at the origin of this edge + with the given dest vertex, if any. + + the dest vertex to search for + + the edge with the required dest vertex, + if it exists, or null + + + + + Tests whether this edge has the given orig and dest vertices. + + the origin vertex to test + the destination vertex to test + true if the vertices are equal to the ones of this edge + + + + Inserts an edge + into the ring of edges around the origin vertex of this edge. + The inserted edge must have the same origin as this edge. + + the edge to insert + + + + Insert an edge with the same origin after this one. + Assumes that the inserted edge is in the correct + position around the ring. + + the edge to insert (with same origin) + + + + Compares edges which originate at the same vertex + based on the angle they make at their origin vertex with the positive X-axis. + This allows sorting edges around their origin vertex in CCW order. + + + + + Implements the total order relation. + The angle of edge a is greater than the angle of edge b, + where the angle of an edge is the angle made by + the first segment of the edge with the positive x-axis. + When applied to a list of edges originating at the same point, + this produces a CCW ordering of the edges around the point. + Using the obvious algorithm of computing the angle is not robust, + since the angle calculation is susceptible to roundoff error. + + + A robust algorithm is: + 1. compare the quadrants the edge vectors lie in. + If the quadrants are different, + it is trivial to determine which edge has a greater angle. + 2. If the vectors lie in the same quadrant, the + function + can be used to determine the relative orientation of the vectors. + + + + + Computes a string representation of a HalfEdge. + + + + + Computes the degree of the origin vertex. + The degree is the number of edges + originating from the vertex. + + the degree of the origin vertex + + + + Finds the first node previous to this edge, if any. + If no such node exists (i.e the edge is part of a ring) + then null is returned. + + + an edge originating at the node prior to this edge, if any, + or null if no node exists + + + + + Gets the origin coordinate of this edge. + + + + + Gets the destination coordinate of this edge. + + + + + Gets the symmetric pair edge of this edge. + + + + + Gets the next edge CCW around the + destination vertex of this edge. + If the vertex has degree 1 then this is the sym edge. + + + + + Returns the edge previous to this one + (with dest being the same as this orig). + + + + + The X component of the distance between the orig and dest vertices. + + + + + The Y component of the distance between the orig and dest vertices. + + + + + Sets the mark for the given edge pair to a boolean value. + + an edge of the pair to update + the mark value to set + + + + Marks the edges in a pair. + + an edge of the pair to mark + + + + Creates a new marked edge. + + the coordinate of the edge origin + + + + Marks this edge. + + + + + Sets this edge to be the start segment of an input LineString. + + + + + Tests whether this edge is the starting segment + in a LineString being dissolved. + + true if this edge is a start segment + + + + Dissolves the linear components + from a collection of s. + into a set of maximal-length s + in which every unique segment appears once only. + The output linestrings run between node vertices + of the input, which are vertices which have + either degree 1, or degree 3 or greater. + + + Use cases for dissolving linear components + include generalization + (in particular, simplifying polygonal coverages), + and visualization + (in particular, avoiding symbology conflicts when + depicting shared polygon boundaries). + + + This class does NOT node the input lines. + If there are line segments crossing in the input, + they will still cross in the output. + + + + + Dissolves the linear components in a geometry. + + the geometry to dissolve + the dissolved lines + + + + Adds a to be dissolved. + Any number of geometries may be adde by calling this method multiple times. + Any type of Geometry may be added. The constituent linework will be + extracted to be dissolved. + + geometry to be line-merged + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + the geometries to be line-merged + + + + Gets the dissolved result as a . + + the dissolved lines + + + + For each edge in stack + (which must originate at a node) + extracts the line it initiates. + + + + + Updates the tracked ringStartEdge + if the given edge has a lower origin + (using the standard ordering). + + + Identifying the lowest starting node meets two goals: + * It ensures that isolated input rings are created using the original node and orientation. + * For isolated rings formed from multiple input linestrings, + it provides a canonical node and orientation for the output + (rather than essentially random, and thus hard to test). + + + + + + Builds a line starting from the given edge. + The start edge origin is a node (valence = 1 or >= 3), + unless it is part of a pure ring. + + + A pure ring has no other incident lines. + In this case the start edge may occur anywhere on the ring. + + + The line is built up to the next node encountered, + or until the start edge is re-encountered + (which happens if the edges form a ring). + + + + + + Adds edges around this node to the stack. + + + + + + Builds an edge graph from geometries containing edges. + + + + + Adds the edges of a Geometry to the graph. + May be called multiple times. + Any dimension of Geometry may be added; the constituent edges are extracted. + + geometry to be added + + + + Adds the edges in a collection of s to the graph. + May be called multiple times. + Any dimension of may be added. + + the geometries to be added + + + + Represents a feature collection. + + + + + Initializes a new instance of the class. + + The features. + + + + Initializes a new instance of the class. + + + + + Adds the specified feature. + + The feature. + + + + Removes the specified feature. + + The feature. + true if item is successfully removed; otherwise, false. This method also returns + false if item was not found in the collection. + + + + Removes the element at the specified index of the collection. + + The index. + + + + Gets the features. + + The features. + + + + Gets the (mandatory) type of the GeoJSON Object. + + + The type of the object. + + + + + Gets or sets the (optional) Coordinate Reference System Object. + + + The Coordinate Reference System Objects. + + + + + Returns the indexTh element in the collection. + + + + + + Returns the number of features contained by this . + + + + + A representation of a planar, linear vector geometry. + + + +

Binary Predicates:

+ Because it is not clear at this time what semantics for spatial + analysis methods involving GeometryCollections would be useful, + GeometryCollections are not supported as arguments to binary + predicates or the Relate method. +
+ +

Overlay Methods:

+ The spatial analysis methods will + return the most specific class possible to represent the result. If the + result is homogeneous, a Point, LineString, or + Polygon will be returned if the result contains a single + element; otherwise, a MultiPoint, MultiLineString, + or MultiPolygon will be returned. If the result is + heterogeneous a GeometryCollection will be returned. +
+ + Representation of Computed Geometries: + The SFS states that the result + of a set-theoretic method is the "point-set" result of the usual + set-theoretic definition of the operation (SFS 3.2.21.1). However, there are + sometimes many ways of representing a point set as a Geometry. + The SFS does not specify an unambiguous representation of a given point set + returned from a spatial analysis method. One goal of NTS is to make this + specification precise and unambiguous. NTS uses a canonical form for + Geometrys returned from overlay methods. The canonical + form is a Geometry which is simple and noded: + Simple means that the Geometry returned will be simple according to + the NTS definition of IsSimple. + Noded applies only to overlays involving LineStrings. It + means that all intersection points on LineStrings will be + present as endpoints of LineStrings in the result. + This definition implies that non-simple geometries which are arguments to + spatial analysis methods must be subjected to a line-dissolve process to + ensure that the results are simple. + + + Constructed Points And The Precision Model: + The results computed by the set-theoretic methods may + contain constructed points which are not present in the input Geometrys. + These new points arise from intersections between line segments in the + edges of the input Geometrys. In the general case it is not + possible to represent constructed points exactly. This is due to the fact + that the coordinates of an intersection point may contain twice as many bits + of precision as the coordinates of the input line segments. In order to + represent these constructed points explicitly, NTS must truncate them to fit + the PrecisionModel. + Unfortunately, truncating coordinates moves them slightly. Line segments + which would not be coincident in the exact result may become coincident in + the truncated representation. This in turn leads to "topology collapses" -- + situations where a computed element has a lower dimension than it would in + the exact result. + When NTS detects topology collapses during the computation of spatial + analysis methods, it will throw an exception. If possible the exception will + report the location of the collapse. + + + +

Geometry Equality

+ There are two ways of comparing geometries for equality: + structural equality and topological equality. +

Structural Equality

+ Structural Equality is provided by the + method. + This implements a comparison based on exact, structural pointwise + equality. + The is a synonym for this method, + to provide structural equality semantics for + use in collections. + It is important to note that structural pointwise equality + is easily affected by things like + ring order and component order. In many situations + it will be desirable to normalize geometries before + comparing them (using the + or methods). + is provided + as a convenience method to compute equality over + normalized geometries, but it is expensive to use. + Finally, + allows using a tolerance value for point comparison. + +

Topological Equality

+ Topological Equality is provided by the + method. + It implements the SFS definition of point-set equality + defined in terms of the DE-9IM matrix. + To support the SFS naming convention, the method + is also provided as a synonym. + However, due to the potential for confusion with + its use is discouraged. + + Since and are overridden, + Geometries can be used effectively in .Net collections. + +
+
+ + + + + + + An object reference which can be used to carry ancillary data defined + by the client. + + + + The bounding box of this Geometry. + + + + + Creates a new Geometry via the specified GeometryFactory. + + The factory + + + + Returns true if the array contains any non-empty Geometrys. + + an array of Geometrys; no elements may be null + + true if any of the Geometrys + IsEmpty methods return false. + + + + + Returns true if the array contains any null elements. + + an array to validate. + true if any of arrays elements are null. + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + Returns an element Geometry from a GeometryCollection, + or this, if the geometry is not a collection. + + The index of the geometry element. + The n'th geometry contained in this geometry. + + + + Returns the minimum distance between this Geometry + and another Geometry g. + + The Geometry from which to compute the distance. + The distance between the geometries + 0 if either input geometry is empty + if g is null + + + + Tests whether the distance from this Geometry + to another is less than or equal to a specified value. + + the Geometry to check the distance to. + the distance value to compare. + true if the geometries are less than distance apart. + + + + Notifies this geometry that its coordinates have been changed by an external + party (for example, via a ). + + + When this method is called the geometry will flush + and/or update any derived information it has cached (such as its ). + The operation is applied to all component Geometries. + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When GeometryChanged is called, this method will be called for + this Geometry and its component Geometries. + + + + + Tests whether this geometry is disjoint from the argument geometry. + + + The Disjoint predicate has the following equivalent definitions: + + The DE-9IM intersection matrix for the two geometries matches FF*FF****. + !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
+
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys are disjoint. + +
+ + + Tests whether this geometry touches the argument geometry + + + The Touches predicate has the following equivalent definitions: + + The geometries have at least one point in common, + but their interiors do not intersect + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns + + FT*******, + F**T***** or + F***T****. + + + If both geometries have dimension 0, the predicate returns false, + since points have only interiors. + This predicate is symmetric. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys touch; + Returns false if both Geometrys are points. + + + + + Tests whether this geometry intersects the argument geometry. + + + The Intersects predicate has the following equivalent definitions: + + The two geometries have at least one point in common + The DE-9IM Intersection Matrix for the two geometries matches
+ [T********] or
+ [*T*******] or
+ [***T*****] or
+ [****T****]
+ !g.disjoint(this)
+ (Intersects is the inverse of Disjoint)
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys intersect. + +
+ + + Tests whether this geometry crosses the specified geometry. + + + The Crosses predicate has the following equivalent definitions: + + The geometries have some but not all interior points in common. + The DE-9IM Intersection Matrix for the two geometries matches + one of the following patterns: + + CodeDescription + [T*T******]for P/L, P/A, and L/A situations + [T*****T**]for L/P, A/P, and A/L situations) + [0********]for L/L situations + + + + For any other combination of dimensions this predicate returns false. + + The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. + In order to make the relation symmetric, + NTS extends the definition to apply to L/P, A/P and A/L situations as well. + + + The Geometry with which to compare this Geometry + true if the two Geometrys cross. + + + + Tests whether this geometry is within the specified geometry. + + + The within predicate has the following equivalent definitions: + + + Every point of this geometry is a point of the other geometry, + and the interiors of the two geometries have at least one point in common. + + The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] + g.contains(this) == true
(Within is the converse of )
+
+ + An implication of the definition is that "The boundary of a geometry is not within the Polygon". + In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false + (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) + For a predicate with similar behaviour but avoiding + this subtle limitation, see . + +
+ The Geometry with which to compare this Geometry. + true if this Geometry is within other. + + +
+ + + + Tests whether this geometry overlaps the specified geometry. + + + The Overlaps predicate has the following equivalent definitions: + + The geometries have at least one point each not shared by the other (or equivalently neither covers the other), + they have the same dimension, + and the intersection of the interiors of the two geometries has + the same dimension as the geometries themselves. + The DE-9IM Intersection Matrix for the two geometries matches + [T*T***T**] (for two points or two surfaces) + or [1*T***T**] (for two curves) + + If the geometries are of different dimension this predicate returns false. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys overlap. + For this function to return true, the Geometry + s must be two points, two curves or two surfaces. + + + + + Tests whether this geometry covers the argument geometry + + + The covers predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry. + The DE-9IM Intersection Matrix for the two geometries matches at least + one of the following patterns: + + [T*****FF*] or
+ [*T****FF*] or
+ [***T**FF*] or
+ [****T*FF*] +
+
+ g.CoveredBy(this) == true
+ (covers is the converse of )
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + In particular, unlike Contains it does not distinguish between + points in the boundary and in the interior of geometries. + For most situations, Covers should be used in preference to Contains. + As an added benefit, Covers is more amenable to optimization, + and hence should be more performant. + +
+ The Geometry with which to compare this Geometry + true if this Geometry covers + + +
+ + Tests whether this geometry is covered by the specified geometry. + + The CoveredBy predicate has the following equivalent definitions: + + Every point of this geometry is a point of the other geometry. + + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns: + + [T*F**F***] + [*TF**F***] + [**FT*F***] + [**F*TF***] + g.Covers(this) == true
+ (CoveredBy is the converse of ) +
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + +
+ the Geometry with which to compare this Geometry + true if this Geometry is covered by g + + +
+ + + Tests whether the elements in the DE-9IM + for the two Geometrys match the elements in intersectionPattern. + + + The pattern is a 9-character string, with symbols drawn from the following set: + + 0 (dimension 0) + 1 (dimension 1) + 2 (dimension 2) + T ( matches 0, 1 or 2) + F ( matches FALSE) + * ( matches any value) + For more information on the DE-9IM, see the OpenGIS Simple Features + Specification. + + the Geometry with which to compare this Geometry + the pattern against which to check the + intersection matrix for the two Geometrys + true if the DE-9IM intersection + matrix for the two Geometrys match intersectionPattern + + + + + Returns the DE-9IM intersection matrix for the two Geometrys. + + The Geometry with which to compare this Geometry + + A matrix describing the intersections of the interiors, + boundaries and exteriors of the two Geometrys. + + + + + Tests whether this geometry is + topologically equal to the argument geometry. + + This method is included for backward compatibility reasons. + It has been superseded by the method, + which has been named to clearly denote its functionality. + + This method should NOT be confused with the method + , which implements + an exact equality comparison. + + The Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal. + + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS Equals predicate. + + + The SFS equals predicate has the following equivalent definitions: + + The two geometries have at least one point in common, + and no point of either geometry lies in the exterior of the other geometry. + The DE-9IM Intersection Matrix for the two geometries matches + the pattern T*F**FFF* +
+            T*F
+            **F
+            FF*
+            
+
+ Note that this method computes topologically equality. + For structural equality, see {@link #equalsExact(Geometry)}. +
+ the Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal +
+ + + Tests whether this geometry is structurally and numerically equal + to a given Object. + + + If the argument Object is not a Geometry, + the result is false. + Otherwise, the result is computed using + . + + This method is provided to fulfill the Java contract + for value-based object equality. + In conjunction with + it provides semantics which are most useful + for using + Geometrys as keys and values in Java collections. + + Note that to produce the expected result the input geometries + should be in normal form. It is the caller's + responsibility to perform this where required + (using + or as appropriate). + + The object to compare + true if this geometry is exactly equal to the argument + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets a hash code for the Geometry. + + + An integer value suitable for use as a hashcode + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + + + + + + + Returns the Well-known Binary representation of this Geometry. + For a definition of the Well-known Binary format, see the OpenGIS Simple + Features Specification. + + The Well-known Binary representation of this Geometry. + + + + + + + + + + Returns the feature representation as GML 2.1.1 XML document. + This XML document is based on Geometry.xsd schema. + NO features or XLink are implemented here! + + + + + Computes a buffer area around this geometry having the given width. The + buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The buffer geometry is constructed using 8 segments per quadrant to approximate + the circular arcs. + The end cap style is BufferStyle.CapRound. + + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified accuracy of approximation for circular arcs. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + + + + Returns the smallest convex Polygon that contains all the + points in the Geometry. This obviously applies only to Geometry + s which contain 3 or more points. + + the minimum-area convex polygon containing this Geometry's points. + + + + Computes a new geometry which has all component coordinate sequences + in reverse order (opposite orientation) to this one. + + A reversed geometry + + + + Computes a Geometry representing the point-set which is + common to both this Geometry and the other Geometry. + + The intersection of two geometries of different dimension produces a result + geometry of dimension less than or equal to the minimum dimension of the input + geometries. + The result geometry may be a heterogenous . + If the result is empty, it is an atomic geometry + with the dimension of the lowest input dimension. + + Intersection of s is supported + only for homogeneous collection types. + + Non-empty heterogeneous arguments are not supported. + + The Geometry with which to compute the intersection. + A geometry representing the point-set common to the two Geometrys. + if a robustness error occurs. + if the argument is a non-empty heterogenous GeometryCollection + + + + Computes a Geometry representing the point-set + which is contained in both this + Geometry and the other Geometry. + + + The method may be used on arguments of different dimension, but it does not + support arguments. + + The union of two geometries of different dimension produces a result + geometry of dimension equal to the maximum dimension of the input + geometries. + The result geometry may be a heterogenous + . + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Unioning s has the effect of + noding and dissolving the input linework. In this context + "noding" means that there will be a node or endpoint in the result for + every endpoint or line segment crossing in the input. "Dissolving" means + that any duplicate (i.e. coincident) line segments or portions of line + segments will be reduced to a single line segment in the result. + If merged linework is required, the + class can be used. + + Non-empty arguments are not supported. + the Geometry with which to compute the union + A point-set combining the points of this Geometry and the + points of other + Thrown if a robustness error occurs + Thrown if either input is a non-empty GeometryCollection + + + + + Computes a Geometry representing the closure of the point-set + of the points contained in this Geometry that are not contained in + the other Geometry. + + If the result is empty, it is an atomic geometry + with the dimension of the left-hand input. + + Non-empty arguments are not supported. + + The Geometry with which to compute the difference. + A Geometry representing the point-set difference of this Geometry with other. + + + + Computes a Geometry representing the closure of the point-set + which is the union of the points in this Geometry which are not + contained in the other Geometry, + with the points in the other Geometry not contained in this + Geometry. + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Non-empty arguments are not supported. + + The Geometry with which to compute the symmetric difference. + a Geometry representing the point-set symmetric difference of this Geometry with other. + + + + Computes the union of all the elements of this geometry. + + + This method supports s (which the other overlay operations currently do not). + + The result obeys the following contract: + + Unioning a set of s has the effect of fully noding and dissolving the linework. + Unioning a set of s always returns a geometry + (unlike ), which may return geometries of lower dimension if a topology + collapse occurred). + + + Thrown if a robustness error occurs + + + + Returns true if the two Geometrys are exactly equal, + up to a specified tolerance. + Two Geometries are exactly within a tolerance equal if: + + they have the same class, + they have the same values of Coordinates, + within the given tolerance distance, in their internal + Coordinate lists, in exactly the same order. + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry + have identical structure and point values, up to the distance tolerance. + Distance at or below which two Coordinates will be considered equal. + + true if this and the other Geometry + are of the same class and have equal internal data. + + + + + + + + Returns true if the two Geometrys are exactly equal. + Two Geometries are exactly equal if: + + they have the same class, + they have the same values of Coordinates in their internal + Coordinate lists, in exactly the same order. + + This provides a stricter test of equality than + , which is more useful + in certain situations + (such as using geometries as keys in collections). + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry. + + true if this and the other Geometry have identical structure and point values. + + + + + Tests whether two geometries are exactly equal + in their normalized forms. + + This is a convenience method which creates normalized + versions of both geometries before computing + . + This method is relatively expensive to compute. + For maximum performance, the client + should instead perform normalization on the individual geometries + at an appropriate point during processing. + + + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + Performs an operation with or on this Geometry's coordinates. + + + If this method modifies any coordinate values, + must be called to update the geometry state. + Note that you cannot use this method to + modify this Geometry if its underlying CoordinateSequence's #get method + returns a copy of the Coordinate, rather than the actual Coordinate stored + (if it even stores Coordinate objects at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + + + If the filter reports that a coordinate value has been changed, + will be called automatically. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + + + + + + + Converts this Geometry to normal form (or canonical form ). + + + + Normal form is a unique representation for Geometrys. + It can be used to test whether two Geometrys are equal + in a way that is independent of the ordering of the coordinates within + them. Normal form equality is a stronger condition than topological + equality, but weaker than pointwise equality. + + The definitions for normal + form use the standard lexicographical ordering for coordinates. "Sorted in + order of coordinates" means the obvious extension of this ordering to + sequences of coordinates. + + + NOTE that this method mutates the value of this geometry in-place. + If this is not safe and/or wanted, the geometry should be + cloned prior to normalization. + + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry, using the given . + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + A IComparer<ICoordinateSequence> + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether the two Geometrys are equal, from the point + of view of the EqualsExact method. Called by EqualsExact + . In general, two Geometry classes are considered to be + "equivalent" only if they are the same class. An exception is LineString + , which is considered to be equivalent to its subclasses. + + The Geometry with which to compare this Geometry for equality. + + true if the classes of the two Geometry + s are considered to be equal by the equalsExact method. + + + + + Throws an exception if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + if g is a GeometryCollection, but not one of its subclasses. + + + + + Returns true if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + If g is a GeometryCollection, but not one of its subclasses. + + + + + Returns the minimum and maximum x and y values in this Geometry, + or a null Envelope if this Geometry is empty. + Unlike EnvelopeInternal, this method calculates the Envelope + each time it is called; EnvelopeInternal caches the result + of this method. + + + This Geometrys bounding box; if the Geometry + is empty, Envelope.IsNull will return true. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry having the same class. + + A Geometry having the same class as this Geometry. + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry of the same class. + using the given . + + A Geometry having the same class as this Geometry + The comparer + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the JTS Technical + Specifications + + + + + Returns the first non-zero result of CompareTo encountered as + the two Collections are iterated over. If, by the time one of + the iterations is complete, no non-zero result has been encountered, + returns 0 if the other iteration is also complete. If b + completes before a, a positive number is returned; if a + before b, a negative number. + + A Collection of IComparables. + A Collection of IComparables. + The first non-zero compareTo result, if any; otherwise, zero. + + + + + + + + + + + + + + + + + + + + + A predefined with == . + + + + + + + Gets the factory which contains the context in which this point was created. + + The factory for this point. + + + + Gets/Sets the user data object for this point, if any. + + + A simple scheme for applications to add their own custom data to a Geometry. + An example use might be to add an object representing a Coordinate Reference System. + Note that user data objects are not present in geometries created by + construction methods. + + + + + Sets the ID of the Spatial Reference System used by the Geometry. + + + + NOTE: This method should only be used for exceptional circumstances or + for backwards compatibility. Normally the SRID should be set on the + used to create the geometry. + SRIDs set using this method will not be propagated to + geometries returned by constructive methods. + + + + + + Returns the name of this Geometry's actual class. + + The name of this Geometrys actual class. + + + + Gets the OGC geometry type + + + + + Returns the PrecisionModel used by the Geometry. + + + the specification of the grid of allowable points, for this + Geometry and all other Geometrys. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the number of Geometryes in a GeometryCollection, + or 1, if the geometry is not a collection. + + + + + Tests whether this is simple. + + The SFS definition of simplicity + follows the general rule that a Geometry is simple if it has no points of + self-tangency, self-intersection or other anomalous points. + + Simplicity is defined for each subclass as follows: + + Valid polygonal geometries are simple, since their rings + must not self-intersect. IsSimple + tests for this condition and reports false if it is not met. + (This is a looser test than checking for validity). + Linear rings have the same semantics. + Linear geometries are simple iff they do not self-intersect at points + other than boundary points. + Zero-dimensional geometries (points) are simple iff they have no + repeated points. + Empty Geometrys are always simple. + + + true if this Geometry is simple + + + + + Tests whether this Geometry is topologically + valid, according to the OGC SFS specification. + For validity rules see the documentation for the specific geometry subclass. + + true if this Geometry is valid. + + + + Tests whether the set of points covered in this Geometry is empty. + + true if this Geometry does not cover any points. + + + + Returns the area of this Geometry. + Areal Geometries have a non-zero area. + They override this function to compute the area. + Others return 0.0 + + The area of the Geometry. + + + + Returns the length of this Geometry. + Linear geometries return their length. + Areal geometries return their perimeter. + They override this function to compute the length. + Others return 0.0 + + The length of the Geometry. + + + + Computes the centroid of this Geometry. + The centroid + is equal to the centroid of the set of component Geometries of highest + dimension (since the lower-dimension geometries contribute zero + "weight" to the centroid). + + The centroid of an empty geometry is POINT EMPTY. + + A Point which is the centroid of this Geometry. + + + + Computes an interior point of this Geometry. + + + An interior point is guaranteed to lie in the interior of the Geometry, + if it possible to calculate such a point exactly. Otherwise, + the point may lie on the boundary of the point. + + The interior point of an empty geometry is POINT EMPTY. + + A Point which is in the interior of this Geometry. + + + + + + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the boundary, or an empty geometry of appropriate dimension + if this Geometry is empty. + For a discussion of this function, see the OpenGIS Simple + Features Specification. As stated in SFS Section 2.1.13.1, "the boundary + of a Geometry is a set of Geometries of the next lower dimension." + + The closure of the combinatorial boundary of this Geometry. + NOTE: make abstract, remove setter and change geoapi + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + Gets a geometry representing the envelope (bounding box) of this Geometry. + + If this Geometry is + + empty, returns an empty Point + a point, returns a Point + a line parallel to an axis, a two-vertex LineString, + otherwise, returns a + Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, + maxy), (minx, maxy), (minx, miny). + + + + A Geometry representing the envelope of this Geometry + + + + + + Gets an containing + the minimum and maximum x and y values in this Geometry. + If the geometry is empty, an empty Envelope + is returned. + + + The returned object is a copy of the one maintained internally, + to avoid aliasing issues. + For best performance, clients which access this + envelope frequently should cache the return value. + the envelope of this Geometry. + An empty Envelope if this Geometry is empty + + + + + + + + + + + + + + + Extension Methods for geometries + + + + + Function to encode to an array of s. If assigned, is used. + + The geometry to encode + The writer to use + An array of s, that represent + + + + Delegate function declaration to handle filter operation + + The geometry to filter + + + + An implementation that applies filtering with the provided + + + + + Creates an instance of this class + + The filter method to be used + + + + OGC compliant geometry factory + + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + Note that the factory constructor methods do not change the input coordinates in any way. + In particular, they are not rounded to the supplied PrecisionModel. + It is assumed that input Coordinates meet the given precision. + + + + + A predefined with + == . + + + + + A predefined with + == . + + A shortcut for . + + + + A predefined with + == . + + + + + A predefined with + == . + + + + + + + + + + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. + + + + + Constructs a GeometryFactory that generates Geometries having the given + CoordinateSequence implementation, a double-precision floating PrecisionModel and a + spatial-reference ID of 0. + + + + + Constructs a GeometryFactory that generates Geometries having the given + {PrecisionModel} and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel and spatial-reference ID, and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + The SRID to use. + + + + Constructs a GeometryFactory that generates Geometries having a floating + PrecisionModel and a spatial-reference ID of 0. + + + + + Converts the ICollection to an array. + + The ICollection of Points to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Geometry's to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LinearRings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Polygons to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPoints to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiLineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPolygons to convert. + The ICollection in array format. + + + + Creates a with the same extent as the given envelope. + + + + The Geometry returned is guaranteed to be valid. + To provide this behaviour, the following cases occur: + + + If the Envelope is: +
    +
  • null returns an empty
  • +
  • a point returns a non-empty
  • +
  • a line returns a two-point
  • +
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
  • +
+
+
+ The Envelope + + An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases) + +
+ + + Creates a Point using the given Coordinate. + A null coordinate creates an empty Geometry. + + a Coordinate, or null + A object + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + a CoordinateSequence (possibly empty), or null + A object + + + + Creates a LineString using the given Coordinates. + A null or empty array creates an empty LineString. + + An array without null elements, or an empty array, or null. + A object + + + + Creates a LineString using the given CoordinateSequence. + A null or empty CoordinateSequence creates an empty LineString. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a LinearRing using the given Coordinates; a null or empty array + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A object + If the ring is not closed, or has too few points + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence (possibly empty), or null. + A object + If the ring is not closed, or has too few points + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + A object + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + the created Polygon + If the boundary ring is invalid + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + A object + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + A object + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + an array of Geometries, each of which may be empty but not null, or null + A object + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned.
+ If geomList contains several Polygons, a + MultiPolygon is returned.
+ If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned.
+ If geomList is empty, an empty GeometryCollection + is returned. + Note that this method does not "flatten" Geometries in the input, and hence if + any MultiGeometries are contained in the input a GeometryCollection containing + them will be returned. +
+ The Geometry to combine. + + A of the "smallest", "most type-specific" + class that can contain the elements of geomList. + +
+ + + Creates a deep copy of the input . + The defined for this factory + is used to copy the s + of the input geometry. + + This is a convenient way to change the CoordinateSequence + used to represent a geometry, or to change the + factory used for a geometry. + + can also be used to make a deep copy, + but it does not allow changing the CoordinateSequence type. + + The geometry + A deep copy of the input geometry, using the CoordinateSequence type of this factory + + + + + Returns the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + + + + + + The SRID value defined for this factory. + + + + + Creates an instance of this class using the default + values for , + and + . + + + + + Creates an instance of this class using the default + values for , + , + but the specified . + + + + Creates an instance of this class using the default + values for , + but the + specified . + + + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. +
The are guaranteed to be orientated clockwise. +
+
+ + + Methods to map various collections + of s + via defined mapping functions. + + Martin Davis + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation delegate + A result collection or geometry of most specific type + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation + A result collection or geometry of most specific type + + + + An interface for geometry functions used for mapping. + + Martin Davis + + + + Computes a new geometry value. + + The input geometry + A result geometry + + + + Represents an (1-dimensional) closed interval on the Real number line. + + + + + Creates a new interval instance, setting ==0d; + + + + + Creates a new interval instance, setting = and =; + + The minimum value + The maximum value + + + + Creates a new interval instance, setting = and =. + + + + + + Method to initialize the interval with the given and values.
+ If < , their values are exchanged. +
+ The minimum value + The maximum value +
+ + + Method to expand this interval to contain . + + The interval to contain. + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval R[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval R[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval R[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval R[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Gets or sets a value indicating the minimum value of the closed interval. + + + + + Gets or sets a value indicating the maximum value of the closed interval. + + + + + Gets the width of the interval ( - ) + + + + + Gets the centre of the interval ( + * 0.5d) + + + + + A visitor for s in a index. + + 1.7 + + + + Visits a node. + + The node to visit + + + + A contiguous portion of 1D-space. Used internally by SIRtree. + + + + + + + + + + + + + + + + + + + + + this + + + + + + + this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writes a formatted string containing the KML representation + of a JTS . + The output is KML fragments which can be substituted + wherever the KML abstract + element can be used. + + + Output elements are indented to provide a + nicely-formatted representation. + An output line prefix and maximum + number of coordinates per line can be specified. + + + The Z ordinate value output can be forced to be a specific value. + The and modes can be set. + If set, the corresponding sub-elements will be output. + + + + + The KML standard value clampToGround for use in . + + + + + The KML standard value relativeToGround for use in . + + + + + The KML standard value absolute for use in . + + + + + Writes a Geometry as KML to a string, using + a specified Z value. + + the geometry to write + the Z value to use + a string containing the KML geometry representation + + + + Writes a Geometry as KML to a string, using + a specified Z value, precision, extrude flag, + and altitude mode code. + + the geometry to write + the Z value to use + the maximum number of decimal places to write + the extrude flag to write + the altitude model code to write + a string containing the KML geometry representation + + + + Writes a in KML format as a string. + + the geometry to write + a string containing the KML geometry representation + + + + Writes the KML representation of a to a . + + the geometry to write + the writer to write to + + + + Appends the KML representation of a to a . + + the geometry to write + the buffer to write into + + + + Takes a list of coordinates and converts it to KML. + + + 2D and 3D aware. Terminates the coordinate output with a newline. + + + + + A tag string which is prefixed to every emitted text line. + This can be used to indent the geometry text in a containing document. + + + + + The maximum number of coordinates to output per line. + + + + + The Z value to be output for all coordinates. + This overrides any Z value present in the Geometry coordinates. + + + + + The flag to be output in the extrude element. + + + + + The flag to be output in the tesselate element. + + + + + The value output in the altitudeMode element. + + + + + The maximum number of decimal places to output in ordinate values. + Useful for limiting output size. + + + negative values set the precision to , + like standard behavior. + + + + + Reads a sequence of {@link Geometry}s in WKBHex format + from a text file. + Each WKBHex geometry must be on a single line + The geometries in the file may be separated by any amount + of whitespace and newlines. + + Martin Davis + + + + Creates a new given the + to use to parse the geometries. + + The geometry reader to use + + + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no filename was specified + Thrown if the filename specified does not exist + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The path to the file + Thrown if no stream was passed + Thrown if passed stream is not readable or seekable + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Reads a sequence of geometries.
+ If an is specified, geometries read up to the offset count are skipped. + If a is specified, no more than geometries are read. +
+ The stream reader to use. + Thrown if an I/O exception was encountered + Thrown if an error occured reading a geometry +
+ + + Tests if reader has reached limit + + A collection of already read geometries + true if number of geometries has been read. + + + + Tests if reader is at EOF. + + + + + Gets or sets a value indicating the maximum number of geometries to read + + + + + Gets or sets the number of geometries to skip before storing. + + + + + Enumeration for the 3 coordinate planes + + + + + Models a plane in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the oriented distance from a point to the plane.
+ The distance is: + + positive if the point lies above the plane (relative to the plane normal) + zero if the point is on the plane + negative if the point lies below the plane (relative to the plane normal) + +
+ The point to compute the distance for + The oriented distance to the plane +
+ + + Computes the axis plane that this plane lies closest to. + + Geometries lying in this plane undergo least distortion + (and have maximum area) + when projected to the closest axis plane. + This provides optimal conditioning for + computing a Point-in-Polygon test. + + The index of the closest axis plane + + + + Represents a vector in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the dot product of the 3D vectors AB and CD. + + A coordinate + A coordinate + A coordinate + A coordinate + The dot product + + + + Creates a new vector with given , and components. + + The x component + The y component + The z component + A new vector + + + + Creates a new vector from a . + + The coordinate to copy + A new vector + + + + Computes the 3D dot-product of two s + + The 1st vector + The 2nd vector + The dot product of the (coordinate) vectors + + + + Creates a vector, that is the difference of and + + The origin coordinate + The destination coordinate + + + + Creates a vector with the ordinates , and + + The x-ordinate + The y-ordinate + The z-ordinate + + + + Computes the dot-product of this and + + The 2nd vector + The dot product of the vectors + + + + Function to compute the length of this vector + + The length of this vector + + + + Function to compute the length of vector . + + A coordinate, treated as vector + The length of + + + + Function to compute a normalized form of this vector + + A normalized form of this vector + + + + Function to devide all dimensions of this vector by . + + The divisor + A new (divided) vector + + + + Function to compute a normalized form of vector . + + A coordinate vector + A normalized form of + + + + Gets a value indicating the x-ordinate + + + + + Gets a value indicating the y-ordinate + + + + + Gets a value indicating the z-ordinate + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + + + + Processes possible intersections detected by a . + + + + The is passed to a . + + The + method is called whenever the + detects that two s might intersect. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + This class is an example of the Strategy pattern. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + + + This method is called by clients + of the interface to process + intersections for two segments of the s being intersected. + + + + + + + + + Reports whether the client of this class needs to continue testing + all intersections in an arrangement. + + if there is no need to continue testing segments + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Intersects two sets of s using + brute-force comparison. + + + + + An intersector for the red-blue intersection problem. + In this class of line arrangement problem, + two disjoint sets of linestrings are intersected. + + Implementing classes must provide a way + of supplying the base set of segment strings to + test against (e.g. in the constructor, + for straightforward thread-safety). + + In order to allow optimizing processing, + the following condition is assumed to hold for each set: + + the only intersection between any two linestrings occurs at their endpoints. + + Implementations can take advantage of this fact to optimize processing + (i.e by avoiding testing for intersections between linestrings + belonging to the same set). + + + + + Computes the intersections with a given set of s, + using the supplied . + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of base segments. + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Processes all of the segment pairs in the given segment strings + using the given SegmentIntersector. + + A segment string + A segment string + The segment intersector to use + + + + A geometry service provider class + + + + + Creates an instance of this class, using the as default and a precision model. No is specified + + + + + Creates an instance of this class, using the provided , and spatial reference Id (. + + The coordinate sequence factory to use. + The precision model. + The default spatial reference ID + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Gets or sets the current instance + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Gets a value representing the number of geometry factories that have been stored in the cache + + + + + A pair of s, whose leaf items + support a distance metric between them. + Used to compute the distance between the members, + and to expand a member relative to the other + in order to produce new branches of the + Branch-and-Bound evaluation tree. + Provides an ordering based on the distance between the members, + which allows building a priority queue by minimum distance. + + Martin Davis + + + + Creates an instance of this class with the given s and the function. + + The first boundable + The second boundable + The item distance function + + + + Gets one of the member s in the pair + (indexed by [0, 1]). + + The index of the member to return (0 or 1) + The chosen member + + + + Computes the distance between the s in this pair. + The boundables are either composites or leaves. + If either is composite, the distance is computed as the minimum distance + between the bounds. + If both are leaves, the distance is computed by . + + The distance between the s in this pair. + + + + Compares two pairs based on their minimum distances + + + + + For a pair which is not a leaf + (i.e. has at least one composite boundable) + computes a list of new pairs + from the expansion of the larger boundable. + + + + + Gets the minimum possible distance between the Boundables in + this pair. + If the members are both items, this will be the + exact distance between them. + Otherwise, this distance will be a lower bound on + the distances between the items in the members. + + The exact or lower bound distance for this pair + + + + Tests if both elements of the pair are leaf nodes + + + + + An function for + items which are using the method. + + Martin Davis + + + + A function method which computes the distance + between two s in an . + Used for Nearest Neighbour searches. + + Martin Davis + + + + Computes the distance between two items. + + The first item. + The second item. + If the metric is not applicable to the arguments + The distance between and . + + + + Computes the distance between two items, + using the method. + + An item which is a geometry. + An item which is a geometry. + if either item is not a Geometry + The distance between the two items. + + + + Implements extended-precision floating-point numbers + which maintain 106 bits (approximately 30 decimal digits) of precision. + + A DoubleDouble uses a representation containing two double-precision values. + A number x is represented as a pair of doubles, x.hi and x.lo, + such that the number represented by x is x.hi + x.lo, where +
+                |x.lo| <= 0.5*ulp(x.hi)
+            
+ and ulp(y) means "unit in the last place of y". + The basic arithmetic operations are implemented using + convenient properties of IEEE-754 floating-point arithmetic. + + The range of values which can be represented is the same as in IEEE-754. + The precision of the representable numbers + is twice as great as IEEE-754 double precision. + + The correctness of the arithmetic algorithms relies on operations + being performed with standard IEEE-754 double precision and rounding. + This is the Java standard arithmetic model, but for performance reasons + Java implementations are not + constrained to using this standard by default. + Some processors (notably the Intel Pentium architecure) perform + floating point operations in (non-IEEE-754-standard) extended-precision. + A JVM implementation may choose to use the non-standard extended-precision + as its default arithmetic mode. + To prevent this from happening, this code uses the + Java strictfp modifier, + which forces all operations to take place in the standard IEEE-754 rounding model. + + The API provides both a set of value-oriented operations + and a set of mutating operations. + Value-oriented operations treat DoubleDouble values as + immutable; operations on them return new objects carrying the result + of the operation. This provides a simple and safe semantics for + writing DoubleDouble expressions. However, there is a performance + penalty for the object allocations required. + The mutable interface updates object values in-place. + It provides optimum memory performance, but requires + care to ensure that aliasing errors are not created + and constant values are not changed. + + This implementation uses algorithms originally designed variously by + Knuth, Kahan, Dekker, and Linnainmaa. + Douglas Priest developed the first C implementation of these techniques. + Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al. +

References

+ + Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, + in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, + IEEE Computer Society Press, Los Alamitos, Calif., 1991. + Yozo Hida, Xiaoye S. Li and David H. Bailey, + Quad-Double Arithmetic: Algorithms, Implementation, and Application, + manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. + David Bailey, High Precision Software Directory; + http://crd.lbl.gov/~dhbailey/mpdist/index.html + +
+ Martin Davis +
+ + + The value to split a double-precision value on during multiplication + + + + The value nearest to the constant Pi. + + + The value nearest to the constant 2 * Pi. + + + The value nearest to the constant Pi / 2. + + + + The value nearest to the constant e (the natural logarithm base). + + + + + A value representing the result of an operation which does not return a valid number. + + + + + The smallest representable relative difference between two values + + + + + Converts the string argument to a DoubleDouble number. + + A string containing a representation of a numeric value + The extended precision version of the value + Thrown if is not a valid representation of a number + + + Converts the double argument to a DoubleDouble number. + + @param x a numeric value + @return the extended precision version of the value + + + The high-order component of the double-double precision value. + + + The low-order component of the double-double precision value. + + + + Creates a new with value x. + + The initial value + + + + Creates a new with value (hi, lo). + + The high order component + The low order component + + + + Creates a with a value equal to the argument + + The initial value + + + Creates a new DoubleDouble with value equal to the argument. + + @param str the value to initialize by + @throws NumberFormatException if str is not a valid representation of a number + + + + Creates a new with the value of the argument. + + The value to copy + A copy of + + + + Creates and returns a copy of this value. + + Acopy of this value + + + + Returns a whose value is (this + ) + + The addende"/> + (this + ) + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns a whose value is (this + y). + + The addend + (this + y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Returns a whose value is -this. + + -this + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + ** + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + ** + + + Returns a DoubleDouble whose value is 1 / this. + + @return the reciprocal of this value + + + + Computes the minimum of this and another DD number. + + A DD number + The minimum of the two numbers + + + + Computes the maximum of this and another DD number. + + A DD number + The maximum of the two numbers + + + + + + Returns an integer indicating the sign of this value. + + + if this value is > 0, returns 1 + if this value is < 0, returns -1 + if this value is = 0, returns 0 + if this value is NaN, returns 0 + + + + An integer indicating the sign of this value + + + + Rounds this value to the nearest integer. + The value is rounded to an integer by adding 1/2 and taking the floor of the result. + Special cases: + + If this value is NaN, returns NaN. + + + This value rounded to the nearest integer + + + + Returns the integer which is largest in absolute value and not further + from zero than this value. + + Special cases: + + If this value is NaN, returns NaN. + + + + The integer which is largest in absolute value and not further from zero than this value + + + + + Returns the absolute value of this value. + + Special cases: + + if this value is NaN, it is returned. + + + The absolute value of this value + + + + Computes the square of this value. + + The square of this value + + + + Computes the square of this value. + + The square of this value. + + + Computes the positive square root of this value. + If the number is NaN or negative, NaN is returned. + + @return the positive square root of this number. + If the argument is NaN or less than zero, the result is NaN. + + + + Computes the value of this number raised to an integral power. + Follows semantics of .Net Math.Pow as closely as possible. + + The integer exponent + x raised to the integral power exp + + + Converts this value to the nearest double-precision number. + + @return the nearest double-precision number to this value + + + Converts this value to the nearest integer. + + @return the nearest integer to this value + + + + Gets a value indicating whether this object is positive or not + + + + + Gets a value indicating whether this object is positive or not + + + + Tests whether this value is equal to another DoubleDouble value. + + @param y a DoubleDouble value + @return true if this value = y + + + Tests whether this value is greater than another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value > y + + + Tests whether this value is greater than or equals to another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value >= y + + + + Tests whether this value is less than another DoubleDouble value. + + A DoubleDouble value + true if this value is < + + + + Compares two DoubleDouble objects numerically. + + @return -1,0 or 1 depending on whether this value is less than, equal to + or greater than the value of o + + + + Dumps the components of this number to a string. + + A string showing the components of the number + + + + Returns a string representation of this number, in either standard or scientific notation. + If the magnitude of the number is in the range [ 10-3, 108 ] + standard notation will be used. Otherwise, scientific notation will be used. + + A string representation of this number + + + + Returns the string representation of this value in standard notation. + + The string representation in standard notation + + + + Returns the string representation of this value in scientific notation. + + The string representation in scientific notation + + + Extracts the significant digits in the decimal representation of the argument. + A decimal point may be optionally inserted in the string of digits + (as long as its position lies within the extracted digits + - if not, the caller must prepend or append the appropriate zeroes and decimal point). + + @param y the number to extract ( >= 0) + @param decimalPointPos the position in which to insert a decimal point + @return the string containing the significant digits and possibly a decimal point + + + + Returns the string for this value if it has a known representation (e.g. NaN or 0.0). + + The string for this special number
+ or null if the number is not a special number
+
+ + + Determines the decimal magnitude of a number. + The magnitude is the exponent of the greatest power of 10 which is less than + or equal to the number. + + The number to find the magnitude of + The decimal magnitude of + + + + Converts a string representation of a real number into a DoubleDouble value. + The format accepted is similar to the standard Java real number syntax. + It is defined by the following regular expression: +
+            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
+            
+
+ The string to parse + The value of the parsed number + Thrown if str is not a valid representation of a number +
+ + + Gets a value indicating whether this object is zero (0) or not + + + + + Gets a value indicating whether this object is negative or not + + + + + Various utility functions for mathematical and numerical operations. + + + + + Clamps a double value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Clamps a int value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Computes the base-10 logarithm of a double value. + + + If the argument is NaN or less than zero, then the result is NaN. + If the argument is positive infinity, then the result is positive infinity. + If the argument is positive zero or negative zero, then the result is negative infinity. + + + + A positive number + The value log a, the base-10 logarithm of the input value + + + + + Computes the average of two numbers. + + A number + A number + The average of the inputs + + + + Computes the maximum fo three values + + A number + A number + A number + The maximum value of , and + + + + Computes the maximum of four values + + A number + A number + A number + A number + The maximum value of , , and + + + + Computes the minimum of four values + + A number + A number + A number + The minimum value of , and + + + + Computes the minimum of four values + + A number + A number + A number + A number + The minimum value of , , and + + + + Implements some 2D matrix operations + (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination. + In order to avoid overhead the algorithm runs in-place + on - if should not be modified the client must supply a copy. + + An nxn matrix in row/column order )modified by this method) + A vector of length n + A vector containing the solution (if any)
or null if the system has no or no unique solution +
+ If the matrix has the wrong size +
+ + + A 2-dimensional mathematical vector represented by double-precision X and Y components. + + mbdavis + + + + Creates a new vector with given X and Y components. + + The x component + The y component + A new vector + + + + Creates a new vector from an existing one. + + The vector to copy + A new vector + + + + Creates a vector from a . + + The coordinate to copy + A new vector + + + Creates a vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + A new vector + + + The X component of this vector. + + + The Y component of this vector. + + + + Creates an new vector instance + + + + + Creates a new vector instance using the provided and ordinates + + The x-ordinate value + The y-ordinate value + + + + Creates a new vector instance based on . + + The vector + + + Creates a new vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + + + + Creates a vector from a . + + The coordinate + A new vector + + + + Adds to this vector instance. + + The vector to add + The result vector + + + + Subtracts from this vector instance + + The vector to subtract + The result vector + + + + Multiplies the vector by a scalar value. + + The value to multiply by + A new vector with the value v * d + + + + Divides the vector by a scalar value. + + The value to divide by + A new vector with the value v / d + + + + Negates this vector + + A new vector with [-_x, -_y] + + + + + + + + + + + + + + + + Normalizes the vector + + A new normalized vector + + + + + + + + + + + Computes the weighted sum of this vector + with another vector, + with this vector contributing a fraction + of frac to the total. + + In other words, +
+            sum = frac * this + (1 - frac) * v
+            
+
+ The vector to sum + The fraction of the total contributed by this vector + The weighted sum of the two vectors +
+ + + Computes the distance between this vector and another one. + + A vector + The distance between the vectors + + + + Computes the dot-product of two vectors + + A vector + The dot product of the vectors + + + + Computes the angle this vector describes to the horizontal axis + + The angle + + + + + + + + + + + + + + + + + + Rotates this vector by + + The angle + The rotated vector + + + + Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 + degrees or Pi/2 radians). A positive number rotates counter-clockwise, a + negative number rotates clockwise. Under this operation the magnitude of + the vector and the absolute values of the ordinates do not change, only + their sign and ordinate index. + + The number of quarter-circles to rotate by + The rotated vector. + + + + + + + + + + + Gets a made of this vector translated by . + + The translation coordinate + A coordinate + + + + Gets a from this vector + + A coordinate + + + + Creates a copy of this vector + + A copy of this vector + + + + Gets a string representation of this vector + + A string representing this vector + + + + Tests if a vector has the same values for the x and y components. + + A with which to do the comparison. + true if is a with the same values for the X and Y components. + + + + Gets a hashcode for this vector. + + A hashcode for this vector + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + + Functions for performing vector mathematics. + + + + + Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each + triangle coordinate must have a Z value. If this is not the case, the returned Coordinate + will have NaN values. The returned vector has unit length. + + A point + A point + A point + The normal vector to the triangle -- + + + + Normalizes the vector + + The normalized + + + + Computes the cross product of and + + A vector + A vector + The cross product of and + + + + Computes the dot product of and + + A vector + A vector + The dot product of and + + + + Computes the determinant of a 2x2 matrix + + The m[0,0] value + The m[0,1] value + The m[1,0] value + The m[1,1] value + The determinant + + + + Helper class for transforming objects. + + + + + Transforms a object. + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Densifies a geometry by inserting extra vertices along the line segments + contained in the geometry. + All segments in the created densified geometry will be no longer than + than the given distance tolerance. + + + Densified polygonal geometries are guaranteed to be topologically correct. + The coordinates created during densification respect the input geometry's . + Note: At some future point this class will offer a variety of densification strategies. + + Martin Davis + + + + Densifies a geometry using a given distance tolerance, and respecting the input geometry's . + + The geometry densify + The distance tolerance () + The densified geometry + + + + Densifies a coordinate sequence. + + The coordinate sequence to densify + The distance tolerance () + The precision model to apply on the new coordinates + The densified coordinate sequence + + + Creates a new densifier instance + The geometry to densify + + + + Gets the densified geometry. + + The densified geometry + + + + Gets or sets the distance tolerance for the densification. All line segments + in the densified geometry will be no longer than the distance tolereance. + Simplified geometry will be within this distance of the original geometry. + The distance tolerance must be positive. + + + + + A framework for processes which transform an input Geometry into + an output , possibly changing its structure and type(s). + + + + This class is a framework for implementing subclasses + which perform transformations on + various different Geometry subclasses. + + + It provides an easy way of applying specific transformations + to given point types, while allowing unhandled types to be simply copied. + Also, the framework handles ensuring that if subcomponents change type + the parent geometries types change appropriately to maintain valid structure. + Subclasses will override whichever TransformX methods + they need to to handle particular Geometry types. + + + A typically usage would be a transformation that may transform Polygons into + Polygons, LineStrings or Points, depending on the geometry of the input + (For instance, a simplification operation). + This class would likely need to override the + method to ensure that if input Polygons change type the result is a GeometryCollection, + not a MultiPolygon. + + The default behaviour of this class is simply to recursively transform + each Geometry component into an identical object by deep copying down + to the level of, but not including, coordinates. + + + Note that all TransformXXX methods may return null, + to avoid creating empty point objects. This will be handled correctly + by the transformer. TransformXXX methods should always return valid + geometry - if they cannot do this they should return null + (for instance, it may not be possible for a transformLineString implementation + to return at least two points - in this case, it should return null). + The method itself will always + return a non-null Geometry object (but this may be empty). + > + + + + + + + + + true if empty geometries should not be included in the result. + + + + + true if a homogenous collection result + from a GeometryCollection should still + be a general GeometryCollection. + + + + + true if the type of the input should be preserved. + + + + + + + + + + + + Convenience method which provides standard way of + creating a CoordinateSequence. + + The coordinate array to copy. + A coordinate sequence for the array. + + + + Convenience method which provides statndard way of copying {CoordinateSequence}s + + The sequence to copy. + A deep copy of the sequence. + + + + Transforms a . + This method should always return a valid coordinate list for + the desired result type. (E.g. a coordinate list for a LineString + must have 0 or at least 2 points). + If this is not possible, return an empty sequence - + this will be pruned out. + + The coordinates to transform + The parent geometry + The transformed coordinates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Makes the input geometry available + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections + A valid area geometry + + + + Stores all attributes associated with a single Geometry feature. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the names + + + + + + + + + + + + + + + + + + + + + + + + Returns a string array containing + all names of present attributes. + + + + + + Returns a object array containing + all values of present attributes. + + + + + + Verifies if attribute specified already exists. + + + + + + + Build a field with the given value and add it to attributes table. + + Name of the new attribute. + Value for attribute (can be null). + If attribute already exists. + + + + Delete the specified attribute from the table. + + + + + + Return the System.Type of the specified attribute, + useful for casting values retrieved with GetValue methods. + + + + + + + Get the value of the specified attribute. + + + + + + + Set the value of the specified attribute. + + + + + + + + + + + + Get / Set the value of the specified attribute. + + + + + + + Feature class + + + + + + + + + + + + + + + + + Geometry representation of the feature. + + + + + Attributes table of the feature. + + + + + Angle orientation + + + + Constant representing no orientation + + + Constant representing straight orientation + + + Constant representing counterclockwise orientation + + + Constant representing left orientation + + + Constant representing clockwise orientation + + + Constant representing right orientation + + + + Utility functions for working with angles. + Unless otherwise noted, methods in this class express angles in radians. + + + + + Converts from radians to degrees. + + An angle in radians + The angle in degrees + + + + Converts from degrees to radians. + + An angle in degrees + The angle in radians + + + + Returns the angle of the vector from p0 to p1, relative to the positive X-axis. + + The angle is normalized to be in the range [ -Pi, Pi ]. + The start-point + The end-point + The normalized angle (in radians) that p0-p1 makes with the positive X-axis + + + + Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. + + + The angle is normalized to be in the range ( -Pi, Pi ]. + + The point + The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. + + + + Tests whether the angle between p0-p1-p2 is acute. + + + An angle is acute if it is less than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Tests whether the angle between p0-p1-p2 is obtuse + + + An angle is obtuse if it is greater than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Returns the unoriented smallest angle between two vectors. + + + The computed angle will be in the range [0, Pi). + + The tip of one vector + The tail of each vector + The tip of the other vector + + + + Returns the oriented smallest angle between two vectors. + The computed angle will be in the range (-Pi, Pi]. + A positive result corresponds to a rotation (CCW) from v1 to v2; + a negative result corresponds to a (CW) rotation; + a zero result corresponds to no rotation. + + The tip of v1 + The tail of each vector + The tip of v2 + The angle between v1 and v2, relative to v1 + + + + Computes the interior angle between two segments of a ring. + The ring is assumed to be oriented in a clockwise direction. + + The computed angle will be in the range [0, 2Pi] + A point of the ring + The next point of the ring + The next point of the ring + The interior angle based at p1 + + + + Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. + + An angle (in radians) + An angle (in radians) + Whether a1 must turn , or to overlap a2. + + + + Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. + + The angle to normalize + An equivalent angle in the range (-Pi, Pi] + + + + Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). + + E.g. + + + NormalizePositive(0.0) = 0.0 + NormalizePositive(-PI) = + NormalizePositive(-2PI) = 0.0 + NormalizePositive(-3PI) = + NormalizePositive(-4PI) = 0 + NormalizePositive(PI) = + NormalizePositive(2PI) = 0.0 + NormalizePositive(3PI) = + NormalizePositive(4PI) = 0.0 + + + + + The angle to normalize, in radians. + An equivalent positive angle + + + + Computes the unoriented smallest difference between two angles. + + + + The angles are assumed to be normalized to the range [-Pi, Pi]. + The result will be in the range [0, Pi]. + + + The angle of one vector (in [-Pi, Pi] ) + The angle of the other vector (in range [-Pi, Pi] ) + The angle (in radians) between the two vectors (in range [0, Pi] ) + + + + Useful utility functions for handling Coordinate arrays. + + + + + Tests whether an array of s forms a ring, by checking length and closure. + Self-intersection is not checked. + + An array of Coordinates + true if the coordinate form a ring. + + + + Finds a in a list of s + which is not contained in another list of s. + + The s to test. + An array of s to test the input points against. + + A from + which is not in , or null. + + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + + + + Determines which orientation of the array is (overall) increasing. + In other words, determines which end of the array is "smaller" + (using the standard ordering on ). + Returns an integer indicating the increasing direction. + If the sequence is a palindrome, it is defined to be + oriented in a positive direction. + + The array of Coordinates to test. + + 1 if the array is smaller at the start or is a palindrome, + -1 if smaller at the end. + + + + + Determines whether two arrays of equal length + are equal in opposite directions. + + + + + + + + Creates a deep copy of the argument Coordinate array. + + Array of Coordinates. + Deep copy of the input. + + + + Creates a deep copy of a given section of a source array into a destination Coordinate array. + The destination array must be an appropriate size to receive the copied coordinates. + + An array of Coordinates + The index to start copying from + The array to receive the deep-copied coordinates + The destination index to start copying to + The number of items to copy + + + + Converts the given of + s into a array. + + of coordinates. + + + If contains not only s. + + + + + Converts the given of + s into a array. + + of coordinates. + + + + + Returns whether Equals returns true for any two consecutive + coordinates in the given array. + + Array of Coordinates. + true if coord has repeated points; false otherwise. + + + + Returns either the given coordinate array if its length is greater than + the given amount, or an empty coordinate array. + + Length amount. + Array of Coordinates. + New Coordinate array. + + + + If the coordinate array argument has repeated points, + constructs a new array containing no repeated points. + Otherwise, returns the argument. + + + + + + + Collapses a coordinate array to remove all null elements. + + The coordinate array to collapse + An Array containing only non-null elements + + + + Reverses the coordinates in an array in-place. + + Array of Coordinates. + + + + Returns true if the two arrays are identical, both null, or pointwise + equal (as compared using Coordinate.Equals). + + First array of Coordinates. + Second array of Coordinates. + true if two Coordinates array are equals; false otherwise + + + + Returns true if the two arrays are identical, both null, or pointwise + equal, using a user-defined + for s. + + An array of s. + Another array of s. + + A for s. + + + + + + Returns the minimum coordinate, using the usual lexicographic comparison. + + Array to search. + The minimum coordinate in the array, found using CompareTo. + + + + Shifts the positions of the coordinates until firstCoordinate is first. + + Array to rearrange. + Coordinate to make first. + + + + Returns the index of in . + The first position is 0; the second is 1; etc. + + A to search for. + A array to search. + The position of coordinate, or -1 if it is not found. + + + + Extracts a subsequence of the input array + from indices to (inclusive). + The input indices are clamped to the array size; + If the end index is less than the start index, + the extracted array will be empty. + + The input array. + The index of the start of the subsequence to extract. + The index of the end of the subsequence to extract. + A subsequence of the input array. + + + + Computes the of the coordinates. + + the array to scan. + the of the . + + + Extracts the coordinates which intersect an {@link Envelope}. + + @param coordinates the coordinates to scan + @param env the envelope to intersect with + @return an array of the coordinates which intersect the envelope + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + Compares the specified s arrays. + + + + + + + + A comparator for arrays modulo their directionality. + E.g. if two coordinate arrays are identical but reversed + they will compare as equal under this ordering. + If the arrays are not equal, the ordering returned + is the ordering in the forward direction. + + + + + A backed by an array of s. + This is the implementation that s use by default. + + Coordinates returned by , and are live -- + modifications to them are actually changing the + CoordinateSequence's underlying data. + A dimension may be specified for the coordinates in the sequence, + which may be 2 or 3. + The actual coordinates will always have 3 ordinates, + but the dimension is useful as metadata in some situations. + + + + The actual dimension of the coordinates in the sequence. + Allowable values are 2 or 3. + + + + Constructs a sequence based on the given array of s. + The coordinate dimension is 3 + + + The array is not copied. + + The coordinate array that will be referenced. + + + + Constructs a sequence based on the given array + of s. + + The Array is not copied + The coordinate array that will be referenced. + The dimension of the coordinates + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Constructs a sequence of a given , populated + with new s of the given . + + The size of the sequence to create. + the dimension of the coordinates + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Get the Coordinate with index i. + + The index of the coordinate. + The requested Coordinate instance. + + + + Get a copy of the Coordinate with index i. + + The index of the coordinate. + A copy of the requested Coordinate. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Creates a deep copy of the object. + + The deep copy. + + + + + + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + This method exposes the internal Array of Coordinate Objects. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the string representation of the coordinate array. + + + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the length of the coordinate sequence. + + + + + Creates CoordinateSequences represented as an array of Coordinates. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Returns the singleton instance of CoordinateArraySequenceFactory. + + + + + A list of Coordinates, which may + be set to prevent repeated coordinates from occuring in the list. + + + + + Constructs a new list without any coordinates + + + + + Constructs a new list from an array of Coordinates, allowing repeated points. + (I.e. this constructor produces a with exactly the same set of points + as the input array.) + + Initial coordinates + + + + Constructs a new list from a collection of Coordinates, + allows repeated points. + + Collection of coordinates to load into the list. + + + + Constructs a new list from a collection of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Collection of coordinates to load into the list. + If false, repeated points are removed. + + + + Constructs a new list from an array of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Array of coordinates to load into the list. + If false, repeated points are removed. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Adds a section of an array of coordinates to the list. + + The coordinates + If set to false, repeated coordinates are collapsed + The index to start from + The index to add up to but not including + true (as by general collection contract) + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + If false, the array is added in reverse order. + Return true. + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the list. + + Coordinate to be inserted, as object. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the end of this list. + + Coordinate to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if all ok. + + + + Inserts the specified coordinate at the specified position in this list. + + The position at which to insert + the coordinate to insert + if set to false, repeated coordinates are collapsed + + + + Add an array of coordinates. + + Coordinates collection to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if at least one element has added (IList not empty). + + + + Ensure this coordList is a ring, by adding the start point if necessary. + + + + + Returns the Coordinates in this collection. + + Coordinater as Coordinate[] array. + + + + Returns a deep copy of this collection. + + The copied object. + + + + Compares two s. + + + For sequences of the same dimension, the ordering is lexicographic. + Otherwise, lower dimensions are sorted before higher. + The dimensions compared can be limited; if this is done + ordinate dimensions above the limit will not be compared. + + + If different behaviour is required for comparing size, dimension, + or coordinate values, any or all methods can be overridden. + + + + + Compare two doubles, allowing for NaN values. + NaN is treated as being less than any valid number. + + A double + A double + -1, 0, or 1 depending on whether a is less than, equal to or greater than b + + + The number of dimensions to test + + + Creates a comparator which will test all dimensions. + + + + + @param dimensionLimit + Creates a comparator which will test only the specified number of dimensions. + The number of dimensions to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 + + + + Compares the same coordinate of two s + + A coordinate sequence + A coordinate sequence + The index of the coordinate to test + the number of dimensiosn to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 + + + + Utility functions for manipulating s. + + + + + Reverses the coordinates in a sequence in-place. + + + + + + Swaps two coordinates in a sequence. + + seq the sequence to modify + the index of a coordinate to swap + the index of a coordinate to swap + + + + Copies a section of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinates from + The starting index of the coordinates to copy + The sequence to which the coordinates should be copied to + The starting index of the coordinates in + The number of coordinates to copy + + + + Copies a coordinate of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinate from + The index of the coordinate to copy + The sequence to which the coordinate should be copied to + The index of the coordinate in + + + + Tests whether a forms a valid , + by checking the sequence length and closure + (whether the first and last points are identical in 2D). + Self-intersection is not checked. + + The sequence to test + True if the sequence is a ring + + + + + Ensures that a CoordinateSequence forms a valid ring, + returning a new closed sequence of the correct length if required. + If the input sequence is already a valid ring, it is returned + without modification. + If the input sequence is too short or is not closed, + it is extended with one or more copies of the start point. + + The CoordinateSequenceFactory to use to create the new sequence + The sequence to test + The original sequence, if it was a valid ring, or a new sequence which is valid. + + + + Tests whether two s are equal. + To be equal, the sequences must be the same length. + They do not need to be of the same dimension, + but the ordinate values for the smallest dimension of the two + must be equal. + Two NaN ordinates values are considered to be equal. + + a CoordinateSequence + a CoordinateSequence + true if the sequences are equal in the common dimensions + + + + Creates a string representation of a . + The format is: + + ( ord0,ord1.. ord0,ord1,... ... ) + + + the sequence to output + the string representation of the sequence + + + + The CoordinateSequence implementation that Geometries use by default. In + this implementation, Coordinates returned by ToArray and GetCoordinates are live -- + parties that change them are actually changing the + DefaultCoordinateSequence's underlying data. + + + + + Constructs a DefaultCoordinateSequence based on the given array (the + array is not copied). + + Coordinate array that will be assimilated. + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns a copy of the coordinate at specified index. + + Coordinate index. + The copy of the coordinate specified. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns a deep copy of the object passed. + + The copied object. + + + + This method exposes the internal Array of Coordinate Objects. + + Coordinate[] array. + + + + Returns the string Representation of the coordinate array + + A string. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns the elements number of the coordinate sequence. + + + + + + Returns the elements number of the coordinate sequence. + + The length. + + + + Creates CoordinateSequences internally represented + as an array of x's and an array of y's. + + + + + + + + + + Returns a DefaultCoordinateSequence based on the given array + (the array is not copied). + + Coordinates array, which may not be null + nor contain null elements + Singleton instance of DefaultCoordinateSequenceFactory. + + + + Returns the singleton instance of DefaultCoordinateSequenceFactory. + + Singleton instance of DefaultCoordinateSequenceFactory. + + + + A coordinate sequence that follows the dotspatial shape range + + + + + Creates an instance of this class + + The + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The number of dimensions. + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The kind of ordinates. + + + + Creates a sequence based on the given coordinate sequence. + + The coordinate sequence. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Releases the weak reference to the weak referenced coordinate array + + This is necessary if you modify the values of the , , arrays externally. + + + + Gets the vector with x- and y-ordinate values; + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with z-ordinate values + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with measure values + + If you modify the values of this vector externally, you need to call ! + + + + A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, + and can be set. + + A coordinate sequence. + + + + Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. + + + + + + Gets the Ordinate flags that sequences created by this factory can cope with. + + + + + Basic implementation of GeometryCollection. + + + + + Represents an empty GeometryCollection. + + + + + Internal representation of this GeometryCollection. + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + For create this is used a standard + with == . + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a GeometryCollectionEnumerator: + this IEnumerator returns the parent geometry as first element. + In most cases is more useful the code + geometryCollectionInstance.Geometries.GetEnumerator(): + this returns an IEnumerator over geometries composing GeometryCollection. + + + + + + Creates a with + every component reversed. + The order of the components in the collection are not reversed. + + A in the reverse order + + + + + + + + + Collects all coordinates of all subgeometries into an Array. + Note that while changes to the coordinate objects themselves + may modify the Geometries in place, the returned Array as such + is only a temporary container which is not synchronized back. + + The collected coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "GeometryCollection" + + + + Gets the OGC geometry type + + + + + + + + + + Returns the area of this GeometryCollection. + + + + + Returns the length of this GeometryCollection. + + + + + Return true if all features in collection are of the same type. + + + + + Returns the iTh element in the collection. + + + + + + + Returns the number of geometries contained by this . + + + + + Iterates over all Geometry's in a GeometryCollection. + Implements a pre-order depth-first traversal of the GeometryCollection + (which may be nested). The original GeometryCollection is + returned as well (as the first object), as are all sub-collections. It is + simple to ignore the GeometryCollection objects if they are not + needed. + + + + + The GeometryCollection being iterated over. + + + + + Indicates whether or not the first element (the GeometryCollection) + has been returned. + + + + + The number of Geometrys in the the GeometryCollection. + + + + + The index of the Geometry that will be returned when next + is called. + + + + + The iterator over a nested GeometryCollection, or null + if this GeometryCollectionIterator is not currently iterating + over a nested GeometryCollection. + + + + + Constructs an iterator over the given GeometryCollection. + + + The collection over which to iterate; also, the first + element returned by the iterator. + + + + + + + + + + + + + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + + + The parent GeometryCollection is the first object returned! + + + + Models an OGC SFS LinearRing. + + + A LinearRing is a which is both closed and simple. + In other words, + the first and last coordinate in the ring must be equal, + and the interior of the ring must not self-intersect. + Either orientation of the ring is allowed. + + A ring must have either 0 or 4 or more points. + The first and last points must be equal (in 2D). + If these conditions are not met, the constructors throw + an + + + + + Models an OGC-style LineString + + + A LineString consists of a sequence of two or more vertices, + along with all points along the linearly-interpolated curves + (line segments) between each + pair of consecutive vertices. + Consecutive vertices may be equal. + The line segments in the line may intersect each other (in other words, + the linestring may "curl back" in itself and self-intersect. + Linestrings with exactly two identical points are invalid. + A linestring must have either 0 or 2 or more points. + If these conditions are not met, the constructors throw an . + + + + + + Represents an empty LineString. + + + + + The points of this LineString. + + + + + + + + + + + + + + + + + + + Creates a whose coordinates are in the reverse order of this objects. + + A with coordinates in the reverse order. + + + + Returns true if the given point is a vertex of this LineString. + + The Coordinate to check. + true if pt is one of this LineString's vertices. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalizes a LineString. A normalized linestring + has the first point which is not equal to it's reflected point + less than the reflected point. + + + + + + + + + + + + Initializes a new instance of the class. + + + For create this is used a standard + with == . + + The coordinates used for create this . + If too few points are provided + + + + Initializes a new instance of the class. + + + The points of the linestring, or null + to create the empty point. Consecutive points may not be equal. + + + If too few points are provided + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "LineString" + + + + Returns the length of this LineString + + The length of the polygon. + + + + + + + + + + + + + + + + + Returns the value of the angle between the + and the . + + + + + The minimum number of vertices allowed in a valid non-empty ring (= 4). + Empty rings with 0 vertices are also valid. + + + + + Constructs a LinearRing with the given points. + + + Points forming a closed and simple linestring, or + null or an empty array to create the empty point. + This array must not contain null elements. + + + If the ring is not closed, or has too few points + + + + + + + + + Initializes a new instance of the class. + + The points used for create this instance. + + For create this is used a standard + with == . + + If the ring is not closed, or has too few points + + + + Returns Dimensions.False, since by definition LinearRings do not have a boundary. + + + + + Returns the name of this object's interface. + + "LinearRing" + + + + Represents a line segment defined by two Coordinates. + Provides methods to compute various geometric properties + and relationships of line segments. + This class is designed to be easily mutable (to the extent of + having its contained points public). + This supports a common pattern of reusing a single LineSegment + object as a way of computing segment properties on the + segments defined by arrays or lists of Coordinates. + + + + + Creates an instance of this class using two coordinates + + The start-point + The end-point + + + + Creates an instance of this class using another instance + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the orientation of a LineSegment relative to this segment. + The concept of orientation is specified as follows: + Given two line segments A and L, + A is to the left of a segment L if A lies wholly in the + closed half-plane lying to the left of L + A is to the right of a segment L if A lies wholly in the + closed half-plane lying to the right of L + otherwise, A has indeterminate orientation relative to L. This + happens if A is collinear with L or if A crosses the line determined by L. + + The LineSegment to compare. + + 1 if seg is to the left of this segment, + -1 if seg is to the right of this segment, + 0 if seg is collinear to or crosses this segment. + + + + + Determines the orientation index of a relative to this segment. + The orientation index is as defined in . + + + + + 1 if p is to the left of this segment + -1 if p is to the right of this segment + 0 if p is collinear with this segment + " + + + + + + Reverses the direction of the line segment. + + + + + Puts the line segment into a normalized form. + This is useful for using line segments in maps and indexes when + topological equality rather than exact equality is desired. + + + + + Computes the distance between this line segment and another one. + + + + + + + Computes the distance between this line segment and a point. + + + + + Computes the perpendicular distance between the (infinite) line defined + by this line segment and a point. + + + + + + + Computes the that lies a given + fraction along the line defined by this segment. + + + A fraction of 0.0 returns the start point of the segment; + A fraction of 1.0 returns the end point of the segment. + If the fraction is < 0.0 or > 1.0 the point returned + will lie before the start or beyond the end of the segment. + + the fraction of the segment length along the line + the point at that distance + + + + Computes the that lies a given + + + A fraction along the line defined by this segment and offset from + the segment by a given distance. + A fraction of 0.0 offsets from the start point of the segment; + A fraction of 1.0 offsets from the end point of the segment. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + + the fraction of the segment length along the line + the distance the point is offset from the segment + (positive is to the left, negative is to the right) + the point at that distance and offset + if the segment has zero length + + + Computes the Projection Factor for the projection of the point p + onto this LineSegment. The Projection Factor is the constant r + by which the vector for this segment must be multiplied to + equal the vector for the projection of p on the line + defined by this segment. + + The projection factor will lie in the range (-inf, +inf), + or be NaN if the line segment has zero length. + + The point to compute the factor for + The projection factor for the point + + + + Computes the fraction of distance (in [0.0, 1.0]) + that the projection of a point occurs along this line segment. + If the point is beyond either ends of the line segment, + the closest fractional value (0.0 or 1.0) is returned. + + + Essentially, this is the clamped to + the range [0.0, 1.0]. + + the point + the fraction along the line segment the projection of the point occurs + + + + Compute the projection of a point onto the line determined + by this line segment. + Note that the projected point may lie outside the line segment. + If this is the case, the projection factor will lie outside the range [0.0, 1.0]. + + + + + + + Project a line segment onto this line segment and return the resulting + line segment. The returned line segment will be a subset of + the target line line segment. This subset may be null, if + the segments are oriented in such a way that there is no projection. + Note that the returned line may have zero length (i.e. the same endpoints). + This can happen for instance if the lines are perpendicular to one another. + + The line segment to project. + The projected line segment, or null if there is no overlap. + + + + Computes the closest point on this line segment to another point. + + The point to find the closest point to. + + A Coordinate which is the closest point on the line segment to the point p. + + + + + Computes the closest points on a line segment. + + + + A pair of Coordinates which are the closest points on the line segments. + + + + + Computes an intersection point between two segments, if there is one. + There may be 0, 1 or many intersection points between two segments. + If there are 0, null is returned. If there is 1 or more, a single one + is returned (chosen at the discretion of the algorithm). If + more information is required about the details of the intersection, + the {RobustLineIntersector} class should be used. + + A line segment + An intersection point, or null if there is none. + + + + + Computes the intersection point of the lines defined by two segments, if there is one. + + + There may be 0, 1 or an infinite number of intersection points between two lines. + If there is a unique intersection point, it is returned. + Otherwise, null is returned. + If more information is required about the details of the intersection, + the class should be used. + + A line segment defining a straight line + An intersection point, or null if there is none or an infinite number + + + + + Creates a LineString with the same coordinates as this segment + + the geometery factory to use + A LineString with the same geometry as this segment + + + + Returns true if o has the same values for its points. + + A LineSegment with which to do the comparison. + + true if o is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + + + + + + + + + + Compares this object with the specified object for order. + Uses the standard lexicographic ordering for the points in the LineSegment. + + + The LineSegment with which this LineSegment + is being compared. + + + A negative integer, zero, or a positive integer as this LineSegment + is less than, equal to, or greater than the specified LineSegment. + + + + + Returns true if other is + topologically equal to this LineSegment (e.g. irrespective + of orientation). + + + A LineSegment with which to do the comparison. + + + true if other is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + Return HashCode. + + + + + The end-point + + + + + The start-point + + + + + Gets the minimum X ordinate + + + + + Gets the maximum X ordinate + + + + + Gets the minimum Y ordinate + + + + + Gets the maximum Y ordinate + + + + + Computes the length of the line segment. + + The length of the line segment. + + + + Tests whether the segment is horizontal. + + true if the segment is horizontal. + + + + Tests whether the segment is vertical. + + true if the segment is vertical. + + + + The angle this segment makes with the x-axis (in radians). + + + + The midpoint of the segment + + + + Basic implementation of MultiLineString. + + + + + Represents an empty MultiLineString. + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + For create this is used a standard + with == . + + + + + Creates a in the reverse order to this object. + Both the order of the component LineStrings + and the order of their coordinate sequences are reversed. + + a in the reverse order. + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiLineString" + + + + Gets the OGC geometry type + + + + + Gets a value indicating whether this instance is closed. + + true if this instance is closed; otherwise, false. + + + + Models a collection of Points. + + + + + Represents an empty MultiPoint. + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + For create this is used a standard + with == . + + + + + + + + + + + + + Returns the Coordinate at the given position. + + The index of the Coordinate to retrieve, beginning at 0. + + The nth Coordinate. + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPoint" + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + Basic implementation of MultiPolygon. + + + + + Represents an empty MultiPolygon. + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + For create this is used a standard + with == . + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + + + + + + + + + + + Creates a {@link MultiPolygon} with every component reversed. + + The order of the components in the collection are not reversed. + An in the reverse order + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPolygon" + + + + + + + + + A bounding container for a which is in the shape of a general octagon. + + + The OctagonalEnvelope of a geometric object + is a geometry which is tight bound along the (up to) four extremal rectilineal parallels + and along the (up to) four extremal diagonal parallels. + Depending on the shape of the contained + geometry, the octagon may be degenerate to any extreme + (e.g. it may be a rectangle, a line, or a point). + + + + + Gets the octagonal envelope of a geometry + + The geometry + The octagonal envelope of the geometry + + + + Creates a new null bounding octagon + + + + + Creates a new null bounding octagon bounding a + + The coordinate to bound + + + + Creates a new null bounding octagon bounding a pair of s + + A coordinate to bound + A coordinate to bound + + + + Creates a new null bounding octagon bounding an + + + + + Creates a new null bounding octagon bounding an + (the copy constructor). + + + + + Creates a new null bounding octagon bounding a + + + + + Sets the value of this object to the null value + + + + + Tests if the extremal values for this octagon are valid. + + @return true if this object has valid values + + + + + A CoordinateSequence implementation based on a packed arrays. + A CoordinateSequence implementation based on a packed arrays. + + + + + A soft reference to the Coordinate[] representation of this sequence. + Makes repeated coordinate array accesses more efficient. + + + + + The dimensions of the coordinates hold in the packed array + + + + + The ordinates + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + + A copy of the i'th coordinate in the sequence + + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. + Note that if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + + + + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the first ordinate of a coordinate in this sequence. + + + + + + + Sets the second ordinate of a coordinate in this sequence. + + + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on doubles. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on floats. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked: + if it is over dimensions you may not get an exception but a meaningless value. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Builds packed array coordinate sequences. The array data type can be either + double or float, and defaults to double. + + + + + Initializes a new instance of the class, + using double values. + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + + + + + + Returns a CoordinateSequence based on the given array; whether or not the + array is copied is implementation-dependent. + + Coordinates array, which may not be null nor contain null elements + + + + + Returns a CoordinateSequence based on the given coordinate sequence; whether or not the + array is copied is implementation-dependent. + + + + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates + + The ordinates each coordinate has. is fix, and can be set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a single point. + + A Point is topologically valid if and only if: + + The coordinate which defines it if any) is a valid coordinate + (i.e. does not have an NaN X- or Y-ordinate + + + + + + + Represents an empty Point. + + + + + The Coordinate wrapped by this Point. + + + + + Initializes a new instance of the class. + + The coordinate used for create this . + + For create this is used a standard + with == . + + + + + Constructs a Point with the given coordinate. + + + Contains the single coordinate on which to base this Point, + or null to create the empty point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + The z coordinate. + /// + For create this is used a standard + with set to . + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + /// + For create this is used a standard + with set to . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Point" + + + + Gets the OGC geometry type + + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + + + + + + Represents a polygon with linear edges, which may include holes. + The outer boundary (shell) + and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. + The boundary rings of the polygon may have any orientation. + Polygons are closed, simple geometries by definition. + + The polygon model conforms to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + A Polygon is topologically valid if and only if: + + the coordinates which define it are valid coordinates + the linear rings for the shell and holes are valid + (i.e. are closed and do not self-intersect) + holes touch the shell or another hole at at most one point + (which implies that the rings of the shell and holes must not cross) + the interior of the polygon is connected, + or equivalently no sequence of touching holes + makes the interior of the polygon disconnected + (i.e. effectively split the polygon into two pieces). + + + + + + Represents an empty Polygon. + + + + + The exterior boundary, or null if this Polygon + is the empty point. + + + + + The interior boundaries, if any. + + + + + Initializes a new instance of the class. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + For create this is used a standard + with == . + + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Polygon" + + + + Returns the area of this Polygon + + + + + + Returns the perimeter of this Polygon. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the precision model of the Coordinates in a Geometry. + In other words, specifies the grid of allowable + points for all Geometrys. + + + The MakePrecise method allows rounding a coordinate to + a "precise" value; that is, one whose + precision is known exactly. + Coordinates are assumed to be precise in geometries. + That is, the coordinates are assumed to be rounded to the + precision model given for the point. + NTS input routines automatically round coordinates to the precision model + before creating Geometries. + All internal operations + assume that coordinates are rounded to the precision model. + Constructive methods (such as bool operations) always round computed + coordinates to the appropriate precision model. + Currently three types of precision model are supported: + + Floating: represents full double precision floating point. + This is the default precision model used in NTS + FloatingSingle: represents single precision floating point. + Fixed: represents a model with a fixed number of decimal places. + + A Fixed Precision Model is specified by a scale factor. + The scale factor specifies the size of the grid which numbers are rounded to. + Input coordinates are mapped to fixed coordinates according to the following + equations: + + jtsPt.x = round( (inputPt.x * scale ) / scale + jtsPt.y = round( (inputPt.y * scale ) / scale + + + For example, to specify 3 decimal places of precision, use a scale factor + of 1000. To specify -3 decimal places of precision (i.e. rounding to + the nearest 1000), use a scale factor of 0.001. + + Coordinates are represented internally as Java double-precision values. + Since .NET uses the IEEE-394 floating point standard, this + provides 53 bits of precision. (Thus the maximum precisely representable + integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). + + NTS binary methods currently do not handle inputs which have different precision models. + The precision model of any constructed geometric value is undefined. + + + + + The maximum precise value representable in a double. Since IEE754 + double-precision numbers allow 53 bits of mantissa, the value is equal to + 2^53 - 1. This provides almost 16 decimal digits of precision. + + + + + Determines which of two s is the most precise + + A precision model + A precision model + The PrecisionModel which is most precise + + + + The type of PrecisionModel this represents. + + + + + The scale factor which determines the number of decimal places in fixed precision. + + + + + Creates a PrecisionModel with a default precision + of Floating. + + + + + Creates a PrecisionModel that specifies + an explicit precision model type. + If the model type is Fixed the scale factor will default to 1. + + + The type of the precision model. + + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate + + Not used. + Not used. + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate. + + + + + Copy constructor to create a new PrecisionModel + from an existing one. + + + + + + Return HashCode. + + + + + Sets internal to the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the + precise representation of external. + + + + + Returns the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the precise + representation of external + + + + + Returns the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Sets external to the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Rounds a numeric value to the PrecisionModel grid. + Symmetric Arithmetic Rounding is used, to provide + uniform rounding behaviour no matter where the number is + on the number line. + + + This method has no effect on NaN values + + + + + + Rounds a Coordinate to the PrecisionModel grid. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compares this PrecisionModel object with the specified object for order. + A PrecisionModel is greater than another if it provides greater precision. + The comparison is based on the value returned by the + {getMaximumSignificantDigits) method. + This comparison is not strictly accurate when comparing floating precision models + to fixed models; however, it is correct when both models are either floating or fixed. + + + The PrecisionModel with which this PrecisionModel + is being compared. + + + A negative integer, zero, or a positive integer as this PrecisionModel + is less than, equal to, or greater than the specified PrecisionModel. + + + + + + + + + + + + Tests whether the precision model supports floating point. + + true if the precision model supports floating point. + + + + Returns the maximum number of significant digits provided by this + precision model. + Intended for use by routines which need to print out precise values. + + + The maximum number of decimal places provided by this precision model. + + + + + Returns the scale factor used to specify a fixed precision model. + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + The scale factor for the fixed precision model + + + + + Gets the type of this PrecisionModel. + + + + + + Returns the x-offset used to obtain a precise coordinate. + + + The amount by which to subtract the x-coordinate before + multiplying by the scale. + + + + + Returns the y-offset used to obtain a precise coordinate. + + + The amount by which to subtract the y-coordinate before + multiplying by the scale + + + + + A base class containing the logic for computes the contains + and covers spatial relationship predicates + for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + Contains and covers are very similar, and differ only in how certain + cases along the boundary are handled. These cases require + full topological evaluation to handle, so all the code in + this class is common to both predicates. + + + It is not possible to short-circuit in all cases, in particular + in the case where line segments of the test geometry touches the polygon linework. + In this case full topology must be computed. + (However, if the test geometry consists of only points, this + can be evaluated in an optimized fashion. + + + Martin Davis + + + + A base class for predicate operations on s. + + mbdavis + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether all components of the test Geometry are contained in the target geometry. + + Handles both linear and point components. + A geometry to test + + true if all componenta of the argument are contained in the target geometry + + + + + Tests whether all components of the test Geometry are contained in the interior of the target geometry. + + Handles both linear and point components. + A geometry to test + true if all componenta of the argument are contained in the target geometry interior + + + + Tests whether any component of the test Geometry intersects the area of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry + + + + Tests whether any component of the test Geometry intersects the interior of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry interior + + + + Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) + + The test geometry + The representative points of the target geometry + true if any component intersects the areal test geometry + + + This flag controls a difference between contains and covers. + + For contains the value is true. + For covers the value is false. + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Evaluate the contains or covers relationship + for the given geometry. + + the test geometry + true if the test geometry is contained + + + + Tests whether a geometry consists of a single polygon with no holes. + + True if the geometry is a single polygon with no holes + + + + Computes the full topological predicate. + Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon has the relationship with the test geometry + + + + A base class for subclasses. + + + Contains default implementations for methods, which simply delegate to the equivalent methods. + This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. + + Martin Davis + + + + Tests whether any representative of the target geometry intersects the test geometry. + This is useful in A/A, A/L, A/P, L/P, and P/P cases. + + The test geometry + true if any component intersects the areal test geometry + + + + Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. + + A geometry + true if the envelopes intersect + + + + Determines whether the envelope of this geometry covers the Geometry g. + + A geometry + true if g is contained in this envelope + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + Default implementation. + + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + Default implementation. + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + Default implementation. + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + Default implementation. + + + + Tests whether the base is disjoint from given geometry. + + The geometry to test + true if this geometry is disjoint from the given geometry + + Default implementation. + + + + Tests whether the base intersects a given geometry. + + The geometry to test + true if this geometry intersects the given geometry + + Default implementation. + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + Default implementation. + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + Default implementation. + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + Default implementation. + + + + Gets the list of representative points for this geometry. + One vertex is included for every component of the geometry + (i.e. including one for every ring of polygonal geometries). + + Do not modify the returned list! + + + + + A factory for creating s. It chooses an appropriate implementation of PreparedGeometry + based on the geoemtric type of the input geometry. + + + In the future, the factory may accept hints that indicate + special optimizations which can be performed. + + Martin Davis + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + mbdavis + + + + Computes the intersects spatial relationship predicate + for a target relative to other classes. + + + Uses short-circuit tests and indexing to improve performance. + + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared linestring + A test geometry + true if the linestring intersects the geometry + + + + Creates an instance of this operation. + + The target PreparedLineString + + + + Tests whether this geometry intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Tests whether any representative point of the test Geometry intersects + the target geometry. + + + Only handles test geometries which are Puntal (dimension 0) + + A Puntal geometry to test + true if any point of the argument intersects the prepared geometry + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + Martin Davis + + + + Tests whether this point intersects a . + + + The optimization here is that computing topology for the test geometry + is avoided. This can be significant for large geometries. + + + + + A prepared version for geometries. + This class supports both s and s. + This class does not support MultiPolygons which are non-valid + (e.g. with overlapping elements). + + + Instances of this class are thread-safe and immutable. + + mbdavis + + + + Computes the contains spatial relationship predicate for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + It is not possible to short-circuit in all cases, in particular + in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + + Martin Davis + + + + Computes the contains spatial relationship predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon contains the geometry + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon contains a given geometry. + + The test geometry + true if the test geometry is contained + + + + Computes the full topological contains predicate.
+ Used when short-circuit tests are not conclusive. +
+ The test geometry + true if this prepared polygon contains the test geometry +
+ + + Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
+ Uses short-circuit tests and indexing to improve performance. +
+ + + A Geometry A containsProperly another Geometry B iff + all points of B are contained in the Interior of A. + Equivalently, B is contained in A AND B does not intersect + the Boundary of A. + + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + In a situation with many geometries intersecting the boundary + of the target geometry, this can make a performance difference. + + + Martin Davis +
+ + Computes the containsProperly predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon properly contains the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon containsProperly a given geometry. + + The test geometry + true if the polygon properly contains the geometry + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + + Uses short-circuit tests and indexing to improve performance. + + It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + Martin Davis + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + The prepared polygon + A test geometry + true if the polygon covers the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon covers a given geometry. + + The test geometry + true if the test geometry is covered + + + + Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon covers the test geometry + + + + Computes the intersects spatial relationship predicate + for s relative to all other classes. + + Uses short-circuit tests and indexing to improve performance. + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared polygon + A test geometry + true if the polygon intersects the geometry + + + + Creates an instance of this operation. + + The prepared polygon + + + + Tests whether this PreparedPolygon intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Indicates an invalid or inconsistent topological situation encountered during processing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a planar triangle, and provides methods for calculating various + properties of triangles. + + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + + Tests whether a triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 degrees. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + True if the triangle is acute. + + + + Computes the line which is the perpendicular bisector of the + + A point + Another point + The perpendicular bisector, as an HCoordinate line segment a-b. + + + Computes the circumcentre of a triangle. + + The circumcentre is the centre of the circumcircle, + the smallest circle which encloses the triangle. + It is also the common intersection point of the + perpendicular bisectors of the sides of the triangle, + and is the only point which has equal distance to all three + vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. For example, + the circumcentre of an obtuse isoceles triangle lies outside the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The circumcentre of the triangle + + + + Computes the determinant of a 2x2 matrix. Uses standard double-precision + arithmetic, so is susceptible to round-off error. + + the [0,0] entry of the matrix + the [0,1] entry of the matrix + the [1,0] entry of the matrix + the [1,1] entry of the matrix + The determinant + + + + Computes the incentre of a triangle. + + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + It is also the point at which the bisectors of the triangle's angles meet. + It is the centre of the triangle's InCircle, which is the unique circle + that is tangent to each of the triangle's three sides. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point which is the incentre of the triangle + + + Computes the centroid (centre of mass) of a triangle. + + This is also the point at which the triangle's three + medians intersect (a triangle median is the segment from a vertex of the triangle to the + midpoint of the opposite side). + The centroid divides each median in a ratio of 2:1. + The centroid always lies within the triangle. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The centroid of the triangle + + + Computes the length of the longest side of a triangle + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The length of the longest side of the triangle + + + Computes the point at which the bisector of the angle ABC cuts the segment AC. + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The angle bisector cut point + + + + Computes the 2D area of a triangle. + The area value is always non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + Computes the signed 2D area of a triangle. + + + + The area value is positive if the triangle is oriented CW, + and negative if it is oriented CCW. + + + The signed area value can be used to determine point orientation, but + the implementation in this method is susceptible to round-off errors. + Use for robust orientation + calculation. + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + + Computes the 3D area of a triangle. + The value computed is alway non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The 3D area of the triangle + + + + Computes the Z-value (elevation) of an XY point + on a three-dimensional plane defined by a triangle + whose vertices have Z-values. + The defining triangle must not be degenerate + (in other words, the triangle must enclose a + non-zero area), + and must not be parallel to the Z-axis. + + This method can be used to interpolate + the Z-value of a point inside a triangle + (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + The computed Z-value (elevation) of the point + + + + Creates a new triangle with the given vertices. + + A vertex + A vertex + A vertex + + + + Computes the InCentre of this triangle + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + This is also the point at which the bisectors of the angles meet. + It is the centre of the triangle's InCircle, + which is the unique circle that is tangent to each of the triangle's three sides. + + + The point which is the InCentre of the triangle. + + + + + Tests whether this triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 + degrees. + + true if this triangle is acute + + + + Computes the circumcentre of this triangle. The circumcentre is the centre + of the circumcircle, the smallest circle which encloses the triangle. It is + also the common intersection point of the perpendicular bisectors of the + sides of the triangle, and is the only point which has equal distance to + all three vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + The circumcentre of this triangle + + + + Computes the centroid (centre of mass) of this triangle. This is also the + point at which the triangle's three medians intersect (a triangle median is + the segment from a vertex of the triangle to the midpoint of the opposite + side). The centroid divides each median in a ratio of 2:1. + + The centroid always lies within the triangle. + + The centroid of this triangle + + + + Computes the length of the longest side of this triangle + + The length of the longest side of this triangle + + + + Computes the 2D area of this triangle. The area value is always + non-negative. + + The area of this triangle + + + + + Computes the signed 2D area of this triangle. The area value is positive if + the triangle is oriented CW, and negative if it is oriented CCW. + + The signed area value can be used to determine point orientation, but the + implementation in this method is susceptible to round-off errors. Use + + for robust orientation calculation. + + The signed 2D area of this triangle + + + + + Computes the 3D area of this triangle. The value computed is alway + non-negative. + + The 3D area of this triangle + + + + Computes the Z-value (elevation) of an XY point on a three-dimensional + plane defined by this triangle (whose vertices must have Z-values). This + triangle must not be degenerate (in other words, the triangle must enclose + a non-zero area), and must not be parallel to the Z-axis. + + This method can be used to interpolate the Z-value of a point inside this + triangle (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + The computed Z-value (elevation) of the point + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + Represents an affine transformation on the 2D Cartesian plane. + + + + It can be used to transform a or . + An affine transformation is a mapping of the 2D plane into itself + via a series of transformations of the following basic types: +
    +
  • reflection (through a line)
  • +
  • rotation (around the origin)
  • +
  • scaling (relative to the origin)
  • +
  • shearing (in both the X and Y directions)
  • +
  • translation
  • +
+
+ + In general, affine transformations preserve straightness and parallel lines, + but do not preserve distance or shape. + + + An affine transformation can be represented by a 3x3 + matrix in the following form: +
+            T = | m00 m01 m02 |
+                | m10 m11 m12 |
+                |  0   0   1  |
+            
+ A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') + by representing it as a 3x1 matrix and using matrix multiplication to compute: +
+            | x' |  = T x | x |
+            | y' |        | y |
+            | 1  |        | 1 |
+            
+
+

Transformation Composition

+ + Affine transformations can be composed using the method. + Composition is computed via multiplication of the + transformation matrices, and is defined as: +
+            A.compose(B) = TB x TA
+            
+
+ + This produces a transformation whose effect is that of A followed by B. + The methods , , + , , and + have the effect of composing a transformation of that type with + the transformation they are invoked on. + The composition of transformations is in general not commutative. + +

Transformation Inversion

+ + Affine transformations may be invertible or non-invertible. + If a transformation is invertible, then there exists + an inverse transformation which when composed produces + the identity transformation. + The method + computes the inverse of a transformation, if one exists. + + + @author Martin Davis + +
+
+ + + Creates a transformation for a reflection about the + line (x0,y0) - (x1,y1). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + the x-ordinate of a another point on the reflection line + the y-ordinate of a another point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a reflection about the + line (0,0) - (x,y). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a rotation + about the origin + by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + a transformation for the rotation + + + + Creates a transformation for a rotation + by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a scaling relative to the origin. + + the value to scale by in the x direction + the value to scale by in the y direction + a transformation for the scaling + + + + Creates a transformation for a scaling relative to the point (x,y). + + The value to scale by in the x direction + The value to scale by in the y direction + The x-ordinate of the point to scale around + The y-ordinate of the point to scale around + A transformation for the scaling + + + + Creates a transformation for a shear. + + the value to shear by in the x direction + the value to shear by in the y direction + a tranformation for the shear + + + + Creates a transformation for a translation. + + the value to translate by in the x direction + the value to translate by in the y direction + a tranformation for the translation + + + + Constructs a new identity transformation + + + + + Constructs a new transformation whose + matrix has the specified values. + + an array containing the 6 values { m00, m01, m02, m10, m11, m12 } + if matrix is null + if matrix is too small + + + + Constructs a new transformation whose + matrix has the specified values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + + + + Constructs a transformation which is + a copy of the given one. + + the transformation to copy + + + + Constructs a transformation + which maps the given source + points into the given destination points. + + source point 0 + source point 1 + source point 2 + the mapped point for source point 0 + the mapped point for source point 1 + the mapped point for source point 2 + + + + Sets this transformation to be the identity transformation. + + + The identity transformation has the matrix: +
+            | 1 0 0 |
+            | 0 1 0 |
+            | 0 0 1 |
+            
+
+ this transformation, with an updated matrix +
+ + + Sets this transformation's matrix to have the given values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + this transformation, with an updated matrix + + + + Sets this transformation to be a copy of the given one + + a transformation to copy + this transformation, with an updated matrix + + + + Computes the inverse of this transformation, if one + exists. + + + + * The inverse is the transformation which when + * composed with this one produces the identity + * transformation. + * A transformation has an inverse if and only if it + * is not singular (i.e. its + * determinant is non-zero). + * Geometrically, an transformation is non-invertible + * if it maps the plane to a line or a point. + * If no inverse exists this method + * will throw a . + + + * The matrix of the inverse is equal to the + * inverse of the matrix for the transformation. + * It is computed as follows: + *
+            *                 1
+            * inverse(A)  =  ---   x  adjoint(A)
+            *                det
+            *
+            *
+            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
+            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
+            *                det      |  0     0     m00*m11-m10*m01  |
+            *
+            *
+            *
+            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
+            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
+            *               |   0           0          1               |
+            *
+            * 
+
+
+ A new inverse transformation + + +
+ + + Explicitly computes the math for a reflection. May not work. + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection + about the line defined by vector (x,y). + + + The transformation for a reflection + is computed by: +
+            d = sqrt(x2 + y2)
+            sin = x / d;
+            cos = x / d;
+            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
+            
+
+ the x-component of the reflection line vector + the y-component of the reflection line vector + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the orign. + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle theta + has the value: +
+            |  cos(theta)  -sin(theta)   0 |
+            |  sin(theta)   cos(theta)   0 |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the origin + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   0 |
+            |  sinTheta   cosTheta   0 |
+            |         0          0   1 |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y). + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y) + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |         0          0         1       |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a scaling. + + + The transformation matrix for a scale + has the value: +
+            |  xScale      0  dx |
+            |  1      yScale  dy |
+            |  0           0   1 |
+            
+
+ the amount to scale x-ordinates by + the amount to scale y-ordinates by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a shear. + + + The transformation matrix for a shear + has the value: +
+            |  1      xShear  0 |
+            |  yShear      1  0 |
+            |  0           0  1 |
+            
+ Note that a shear of (1, 1) is not + equal to shear(1, 0) composed with shear(0, 1). + Instead, shear(1, 1) corresponds to a mapping onto the + line x = y. +
+ the x component to shear by + the y component to shear by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a translation. + + + For a translation by the vector (x, y) + the transformation matrix has the value: +
+            |  1  0  dx |
+            |  1  0  dy |
+            |  0  0   1 |
+            
+
+ the x component to translate by + the y component to translate by + this transformation, with an updated matrix +
+ + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of the line to reflect around + the y-ordinate of the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation transformation composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by in radians + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around the origin composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a scale transformation composed + with the current value. + + the value to scale by in the x direction + the value to scale by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a shear transformation composed + with the current value. + + the value to shear by in the x direction + the value to shear by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a translation transformation composed + with the current value. + + the value to translate by in the x direction + the value to translate by in the y direction + this transformation, with an updated matrix + + + + Updates this transformation to be + the composition of this transformation with the given . + + + This produces a transformation whose effect + is equal to applying this transformation + followed by the argument transformation. + Mathematically, +
+            A.compose(B) = TB x TA
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Updates this transformation to be the composition + of a given with this transformation. + + + This produces a transformation whose effect + is equal to applying the argument transformation + followed by this transformation. + Mathematically, +
+            A.composeBefore(B) = TA x TB
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Applies this transformation to the coordinate + and places the results in the coordinate + (which may be the same as the source). + + the coordinate to transform + the coordinate to accept the results + the dest coordinate + + + + + Cretaes a new which is the result of this transformation applied to the input Geometry. + + A Geometry + The transformed Geometry + + + + Applies this transformation to the i'th coordinate + in the given CoordinateSequence. + + a CoordinateSequence + the index of the coordinate to transform + + + + Transforms the i'th coordinate in the input sequence + + A CoordinateSequence + The index of the coordinate to transform + + + + Tests if an object is an AffineTransformation and has the same matrix as this transformation. + + An object to test + true if the given object is equal to this object + + + + Gets a text representation of this transformation. + The string is of the form: + + AffineTransformation[[m00, m01, m02], [m10, m11, m12]] + + + A string representing this transformation + + + + Clones this transformation + + A copy of this transformation + + + + Gets an array containing the entries + of the transformation matrix. + + + Only the 6 non-trivial entries are returned, + in the sequence: +
+            m00, m01, m02, m10, m11, m12
+            
+
+ an array of length 6 +
+ + + Computes the determinant of the transformation matrix. + + + + The determinant is computed as: +
+             | m00 m01 m02 |
+             | m10 m11 m12 | = m00 * m11 - m01 * m10
+             |  0   0   1  |
+             
+
+ + If the determinant is zero, + the transform is singular (not invertible), + and operations which attempt to compute + an inverse will throw a . + +
+ the determinant of the transformation + + + The determinant of the transformation + +
+ + + Reports that this filter should continue to be executed until + all coordinates have been transformed. + + false + + + Tests if this transformation is the identity transformation. + + + + Builds an defined by a set of control vectors. + + + + A control vector consists of a source point and a destination point, + which is the image of the source point under the desired transformation. + + + A transformation is well-defined + by a set of three control vectors + if and only if the source points are not collinear. + (In particular, the degenerate situation + where two or more source points are identical will not produce a well-defined transformation). + A well-defined transformation exists and is unique. + If the control vectors are not well-defined, the system of equations + defining the transformation matrix entries is not solvable, + and no transformation can be determined. + + No such restriction applies to the destination points. + However, if the destination points are collinear or non-unique, + a non-invertible transformations will be generated. + + + This technique of recovering a transformation + from its effect on known points is used in the Bilinear Interpolated Triangulation + algorithm for warping planar surfaces. + + + Martin Davis + + + + Constructs a new builder for the transformation defined by the given set of control point mappings. + + A control point + A control point + A control point + The image of under the required transformation + The image of under the required transformation + The image of under the required transformation + + + + Computes the + determined by the control point mappings, + or null if the control vectors do not determine a well-defined transformation. + + + + An affine transformation + null if the control vectors do not determine a well-defined transformation. + + + + + + Computes the transformation matrix by + solving the two systems of linear equations + defined by the control point mappings, + if this is possible. + + True if the transformation matrix is solvable + + + + Solves the transformation matrix system of linear equations + for the given right-hand side vector. + + The vector for the right-hand side of the system + The solution vector, if it can be determinated, otherwise null + + + + Supports creating s defined by various kinds of inputs and transformation mapping rules. + + Martin Davis + + + + Creates a tranformation from a set of three control vectors. A control + vector consists of a source point and a destination point, which is the + image of the source point under the desired transformation. Three control + vectors allows defining a fully general affine transformation. + + + + + + + + The computed transformation + + + + Creates an AffineTransformation defined by a pair of control vectors. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. The + computed transformation is a combination of one or more of a uniform scale, + a rotation, and a translation (i.e. there is no shear component and no + reflection) + + + + + + The computed transformation + null if the control vectors do not determine a well-defined transformation + + + + Creates an AffineTransformation defined by a single control vector. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. This + produces a translation. + + The start point of the control vector + The end point of the control vector + The computed transformation + + + + Creates an AffineTransformation defined by a set of control vectors. + Between one and three vectors must be supplied. + + The source points of the vectors + The destination points of the vectors + The computed transformation + if the control vector arrays are too short, long or of different lengths + + + + Creates an AffineTransformation defined by a maping between two baselines. + The computed transformation consists of: + + a translation from the start point of the source baseline to the start point of the destination baseline, + a rotation through the angle between the baselines about the destination start point, + and a scaling equal to the ratio of the baseline lengths. + + If the source baseline has zero length, an identity transformation is returned. + + The start point of the source baseline + The end point of the source baseline + The start point of the destination baseline + The end point of the destination baseline + + + + + Extracts a single representative from each connected component of a . + + 1.9 + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The Geometry from which to extract + A list of Coordinates + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + Maps the members of a + into another GeometryCollection via a defined + mapping function. + + Martin Davis + + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + Combines s to produce a of the most appropriate type. + + + Input geometries which are already collections will have their elements extracted first. + No validation of the result geometry is performed. + (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). + + mbdavis + + + + Combines a collection of geometries. + The geometries to combine + The combined geometry + + + + Combines two geometries. + + A geometry to combine + A geometry to combine + The combined geometry + + + + Combines three geometries. + + A geometry to combine + A geometry to combine + A geometry to combine + The combined geometry + + + + Creates a list from two items + + + + A list from two geometries + + + + Creates a list from three items + + + + + A list from three geometries + + + + Creates a new combiner for a collection of geometries + + The geometries to combine + + + + Extracts the GeometryFactory used by the geometries in a collection + + + a GeometryFactory + + + + Computes the combination of the input geometries to produce the most appropriate or + + A Geometry which is the combination of the inputs + + + + + Value indicating whether empty geometries should be skipped + + + + + A class which supports creating new s + which are modifications of existing ones, + maintaining the same type structure. + + + Geometry objects are intended to be treated as immutable. + This class allows you to "modifies" a Geometrys + by traversing them, applying a user-defined + , or + and creating a new Geometrys with the same structure but + (possibly) modified components. + + Examples of the kinds of modifications which can be made are: + + + The values of the coordinates may be changed. + The editor does not check whether changing coordinate values makes the result Geometry invalid + + + The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). + The modifed coordinate lists must be consistent with their original parent component + (e.g. a LinearRing must always have at least 4 coordinates, and the first and last + coordinate must be equal). + + + Components of the original point may be deleted + (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). + Deletions will be propagated up the component tree appropriately. + + + + All changes must be consistent with the original Geometry's structure + (e.g. a Polygon cannot be collapsed into a LineString). + If changing the structure is required, use a . + + + This class supports creating an edited Geometry + using a different via the + constructor. + Examples of situations where this is required is if the geometry is + transformed to a new SRID and/or a new PrecisionModel. + + Usage notes + + The resulting Geometry is not checked for validity. + If validity needs to be enforced, the new Geometry's + method should be called. + By default the UserData of the input geometry is not copied to the result. + + + + + + + + + The factory used to create the modified Geometry. + + + If null the GeometryFactory of the input is used. + + + + + Creates a new GeometryEditor object which will create + edited with the same as the input Geometry. + + + + + Creates a new GeometryEditor object which will create + edited s with the given . + + The GeometryFactory to create the edited Geometry with. + + + + Edit the input Geometry with the given edit operation. + Clients can create subclasses of GeometryEditorOperation or + CoordinateOperation to perform required modifications. + + The Geometry to edit. + The edit operation to carry out. + A new Geometry which is the result of the editing (which may be empty). + + + + Gets or sets a value indicating if the User Data is copied to the edit result. + If so, only the object reference is copied. + + + + + A interface which specifies an edit operation for Geometries. + + + + + Edits a Geometry by returning a new Geometry with a modification. + The returned Geometry may be the input geometry itself. + It may be null if the geometry is to be deleted. + + The Geometry to modify. + + The factory with which to construct the modified Geometry + (may be different to the factory of the input point). + + A new Geometry which is a modification of the input Geometry. + null if the Geometry is to be deleted completely + + + + A GeometryEditorOperation which does not modify + the input geometry. + This can be used for simple changes of + (including PrecisionModel and SRID). + + mbdavis + + + + A GeometryEditorOperation which edits the coordinate list of a Geometry. + Operates on Geometry subclasses which contains a single coordinate list. + + + + + + + + + + + + + Edits the array of Coordinates from a Geometry. + + The coordinate array to operate on. + The point containing the coordinate list. + An edited coordinate array (which may be the same as the input). + + + + A which edits the + of a . + + Operates on Geometry subclasses which contains a single coordinate list. + + + + An edited coordinate sequence (which may be the same as the input) + + + + Extracts the components of a given type from a . + + + + + Extracts the T components from an and adds them to the provided . + + the geometry from which to extract + the list to add the extracted elements to + The geometry type to extract + + + + Extracts the T elements from a single and returns them in a . + + the geometry from which to extract + + + + Extracts the components of type T from a . + + + + + Constructs a filter with a list in which to store the elements found. + + The list to extract into + + + + Extracts all the 1-dimensional () components from a . + For polygonal geometries, this will extract all the component s. + If desired, s can be forced to be returned as s. + + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single point. + If more than one point is to be processed, it is more + efficient to create a single LineExtracterFilter instance + and pass it to multiple geometries. + + The point from which to extract linear components. + The list of linear components. + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The geometry from which to extract linear components + true if s should be converted to s + The list of linear components + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + true if s should be converted to s + A linear geometry + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single + and adds them to the. + + The geometry from which to extract + The list to add the extracted elements to + The list argument + + + + Extracts the elements from a single + and returns them in a . + + The geometry from which to extract + A list containing the linear elements + + + + Extracts the elements from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Constructs a filter with a list in which to store the elements found. + + + + + Implements some 2D matrix operations (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination.
+ In order to avoid overhead the algorithm runs in-place + on A - if A should not be modified the client must supply a copy. +
+ A an nxn matrix in row/column order )modified by this method) + A vector of length n + if the matrix is the wrong size + + + A vector containing the solution (if any) + null if the system has no or no unique solution + + +
+ + + Indicates that an is non-invertible. + + Martin Davis + + + + Extracts all the 0-dimensional (Point) components from a Geometry. + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + the geometry from which to extract + + + + Constructs a PointExtracterFilter with a list in which to store Points found. + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + The geometry from which to extract + + + + Constructs a PolygonExtracterFilter with a list in which to store Polygons found. + + + + + + + + + + + + A visitor to elements which componets, which + allows short-circuiting when a defined condition holds. + + + + + + + + + + + + + + + + + + + + + + + A Depth object records the topological depth of the sides + of an Edge for up to two Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Depth object is null (has never been initialized) if all depths are null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalize the depths for each point, if they are non-null. + A normalized depth + has depth values in the set { 0, 1 }. + Normalizing the depths + involves reducing the depths by the same amount so that at least + one of them is 0. If the remaining value is > 0, it is set to 1. + + + + + + + + + + + Calls GetDepth and SetDepth. + + + + + + + + + + + + + Models the end of an edge incident on a node. + + + + EdgeEnds have a direction determined by the direction of the ray from the initial + point to the next point. + + + EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". + This ordering is used to sort EdgeEnds around a node. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the total order relation: + a has a greater angle with the positive x-axis than b. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is obviously susceptible to roundoff. + A robust algorithm is: + - first compare the quadrant. If the quadrants + are different, it it trivial to determine which vector is "greater". + - if the vectors lie in the same quadrant, the computeOrientation function + can be used to decide the relative orientation of the vectors. + + + + + + Subclasses should override this if they are using labels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes the factor for the change in depth when moving from one location to another. + E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. + + + + + + + + + + The depth of each side (position) of this edge. + The 0 element of the array is never used. + + + + + + + + + + + + + + + + + + + + + + + + + + Compute the label in the appropriate orientation for this DirEdge. + + + + + Set both edge depths. + One depth for a given side is provided. + The other is computed depending on the Location + transition and the depthDelta of the edge. + + + + + + + Set both edge depths. One depth for a given side is provided. The other is + computed depending on the Location transition and the depthDelta of the edge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VisitedEdge get property returns true if bot Visited + and Sym.Visited are true. + VisitedEdge set property marks both DirectedEdges attached to a given Edge. + This is used for edges corresponding to lines, which will only + appear oriented in a single direction in the result. + + + + + + + + + + + + + + + + + + + + + + + + + This edge is a line edge if + at least one of the labels is a line label + any labels which are not line labels have all Location = Exterior. + + + + + This is an interior Area edge if + its label is an Area label for both Geometries + and for each Geometry both sides are in the interior. + + true if this is an interior Area edge. + + + + A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. + It supports labelling the edges as well as linking the edges to form both + MaximalEdgeRings and MinimalEdgeRings. + + + + + A EdgeEndStar is an ordered list of EdgeEnds around a node. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + A map which maintains the edges in sorted order around the node. + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + The location of the point for this star in Geometry i Areas. + + + + + Insert a EdgeEnd into this EdgeEndStar. + + + + + + Insert an EdgeEnd into the map, and clear the edgeList cache, + since the list of edges has now changed. + + + + + + + Iterator access to the ordered list of edges is optimized by + copying the map collection to a list. (This assumes that + once an iterator is requested, it is likely that insertion into + the map is complete). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate for the node this star is based at. + + + + + + + + + + + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + Insert a directed edge in the list. + + + + + + + + + + + + + + + + + + + + + + + + + Compute the labelling for all dirEdges in this star, as well + as the overall labelling. + + + + + + For each dirEdge in the star, merge the label . + + + + + Update incomplete dirEdge labels from the labelling for the node. + + + + + + + + + + + + Traverse the star of DirectedEdges, linking the included edges together. + To link two dirEdges, the next pointer for an incoming dirEdge + is set to the next outgoing edge. + DirEdges are only linked if: + they belong to an area (i.e. they have sides) + they are marked as being in the result + Edges are linked in CCW order (the order they are stored). + This means that rings have their face on the Right + (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). + PRECONDITION: No pair of dirEdges are both marked as being in the result. + + + + + + + + + + + + + + + + Traverse the star of edges, maintaing the current location in the result + area at this node (if any). + If any L edges are found in the interior of the result, mark them as covered. + + + + + + + + + + + Compute the DirectedEdge depths for a subsequence of the edge array. + + The last depth assigned (from the R side of the last edge visited). + + + + + + + + + + + + + + + + + + + + A GraphComponent is the parent class for the objects' + that form a graph. Each GraphComponent can carry a + Label. + + + + + + + + + + + + + + + + + + + + + Compute the contribution to an IM for this component. + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + + + + + + + + + + + IsInResult indicates if this component has already been included in the result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A coordinate in this component (or null, if there are none). + + + + + An isolated component is one that does not intersect or touch any other + component. This is the case if the label has valid locations for + only a single Geometry. + + true if this component is isolated. + + + + Updates an IM from the label for an edge. + Handles edges from both L and A geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an EdgeIntersection for intersection intIndex. + An intersection that falls exactly on a vertex of the edge is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if the coordinate sequences of the Edges are identical. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The depthDelta is the change in depth as an edge is crossed from R to L. + + The change in depth as the edge is crossed from R to L. + + + + + + + + + + + + + + + + + + + + + + + + An Edge is collapsed if it is an Area edge and it consists of + two segments which are equal and opposite (eg a zero-width V). + + + + + + + + + + + + + + + + + + + + An EdgeIntersection represents a point on an + edge which intersects with another edge. + The intersection may either be a single point, or a line segment + (in which case this point is the start of the line segment) + The label attached to this intersection point applies to + the edge from this point forwards, until the next + intersection or the end of the edge. + The intersection point must be precise. + + + + + + + + + + + + + + + + + + + + + + + + + -1 this EdgeIntersection is located before the argument location, + 0 this EdgeIntersection is at the argument location, + 1 this EdgeIntersection is located after the argument location. + + + + + + + + + + + + + + + + + + The point of intersection. + + + + + The index of the containing line segment in the parent edge. + + + + + The edge distance of this point along the containing line segment. + + + + + A list of edge intersections along an Edge. + + + + + + + + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + + The EdgeIntersection found or added. + + + + Returns an iterator of EdgeIntersections. + + + + + + + + + + + + Adds entries for the first and last points of the edge to the list. + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the input list (this is so a single list + can be used to accumulate all split edges for a Geometry). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + + + + + + + + + + + + A EdgeList is a list of Edges. It supports locating edges + that are pointwise equals to a target edge. + + + + + + Remove the selected Edge element from the list if present. + + Edge element to remove from list + + + + Insert an edge unless it is already in the list. + + + + + + + + + + + + If there is an edge equal to e already in the list, return it. + Otherwise return null. + + + + equal edge, if there is one already in the list, + null otherwise. + + + + + + + + + + + + + + + + + + If the edge e is already in the list, return its index. + + + + Index, if e is already in the list, + -1 otherwise. + + + + + + + + + + + + + + + + + + + + + + + Validates that a collection of is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Checks whether the supplied s are correctly noded. + + an enumeration of Edges. + If the SegmentStrings are not correctly noded + + + + Creates a new validator for the given collection of s. + + + + + Checks whether the supplied edges are correctly noded. + + If the SegmentStrings are not correctly noded + + + + + + + + + The directed edge which starts the list of edges for this EdgeRing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compute a LinearRing from the point list previously collected. + Test if the ring is a hole (i.e. if it is CCW) and set the hole flag + accordingly. + + + + + + + + + + + + + + + + + + + Collect all the points from the DirectedEdges of this ring into a contiguous list. + + + + + + + + + + + + + + + + + + + + + + Merge the RHS label from a DirectedEdge into the label for this EdgeRing. + The DirectedEdge label may be null. This is acceptable - it results + from a node which is NOT an intersection node between the Geometries + (e.g. the end node of a LinearRing). In this case the DirectedEdge label + does not contribute any information to the overall labelling, and is simply skipped. + + + + + + + + + + + + + + + This method will cause the ring to be computed. + It will also check any holes, if they have been assigned. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the list of DirectedEdges that make up this EdgeRing. + + + + + + + + + + A GeometryGraph is a graph that models a given Geometry. + + + + + The computation of the IntersectionMatrix relies on the use of a structure + called a "topology graph". The topology graph contains nodes and edges + corresponding to the nodes and line segments of a Geometry. Each + node and edge in the graph is labeled with its topological location relative to + the source point. + Note that there is no requirement that points of self-intersection be a vertex. + Thus to obtain a correct topology graph, Geometrys must be + self-noded before constructing their graphs. + Two fundamental operations are supported by topology graphs: + Computing the intersections between all the edges and nodes of a single graph + Computing the intersections between the edges and nodes of two different graphs + + + + + For nodes in the Collection, link the DirectedEdges at the node that are in the result. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The node if found; null otherwise + + + + + + Add a set of edges to the graph. For each edge two DirectedEdges + will be created. DirectedEdges are NOT linked by this method. + + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Returns the EdgeEnd which has edge e as its base edge + (MD 18 Feb 2002 - this should return a pair of edges). + + + The edge, if found null if the edge was not found. + + + + Returns the edge whose first two coordinates are p0 and p1. + + + + The edge, if found null if the edge was not found. + + + + Returns the edge which starts at p0 and whose first segment is + parallel to p1. + + + + The edge, if found null if the edge was not found. + + + + The coordinate pairs match if they define line segments lying in the same direction. + E.g. the segments are parallel and in the same quadrant + (as opposed to parallel and opposite!). + + + + + + + + + + + + + + + + + + + + + + + + + This method implements the Boundary Determination Rule + for determining whether + a component (node or edge) that appears multiple times in elements + of a MultiGeometry is in the boundary or the interior of the Geometry. + The SFS uses the "Mod-2 Rule", which this function implements. + An alternative (and possibly more intuitive) rule would be + the "At Most One Rule": + isInBoundary = (componentCount == 1) + + + + + The lineEdgeMap is a map of the linestring components of the + parentGeometry to the edges which are derived from them. + This is used to efficiently perform findEdge queries + + + + + If this flag is true, the Boundary Determination Rule will used when deciding + whether nodes are in the boundary or not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + Adds a polygon ring to the graph. Empty rings are ignored. + The left and right topological location arguments assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged. + + + + + + + + + + + + + + + + + + + + Add an Edge computed externally. The label on the Edge is assumed + to be correct. + + + + + + Add a point computed externally. The point is assumed to be a + Point Geometry part, which has a location of INTERIOR. + + + + + + Compute self-nodes, taking advantage of the Geometry type to + minimize the number of intersection tests. (E.g. rings are + not tested for self-intersection, since they are assumed to be valid). + + The LineIntersector to use. + If false, intersection checks are optimized to not test rings for self-intersection. + The SegmentIntersector used, containing information about the intersections found. + + + + + + + + + + + + + + + + + + + + + Adds candidate boundary points using the current . + This is used to add the boundary + points of dim-1 geometries (Curves/MultiCurves). + + + + + + + + + + + + + Add a node for a self-intersection. + If the node is a potential boundary node (e.g. came from an edge which + is a boundary) then insert it as a potential boundary node. + Otherwise, just add it as a regular node. + + + + + + + + Determines the of the given in this geometry. + + The point to test + + The location of the point in the geometry + + + + + + + + + + + + + + + + + + + + Gets the used with this geometry graph. + + + + + + + + + + An EdgeSetIntersector computes all the intersections between the + edges in the set. It adds the computed intersections to each edge + they are found on. It may be used in two scenarios: + determining the internal intersections between a single set of edges + determining the mutual intersections between two different sets of edges + It uses a SegmentIntersector to compute the intersections between + segments and to record statistics about what kinds of intersections were found. + + + + + Computes all self-intersections between edges in a set of edges, + allowing client to choose whether self-intersections are computed. + + A list of edges to test for intersections. + The SegmentIntersector to use. + true if self-intersections are to be tested as well. + + + + Computes all mutual intersections between two sets of edges. + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + They have the following properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + + Specifically, a sequence of contiguous line segments + is a monotone chain iff all the vectors defined by the oriented segments + lies in the same quadrant. + + Monotone Chains have the following useful properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + Note that due to the efficient intersection test, there is no need to limit the size + of chains to obtain fast performance. + + + + + + + + + + + + + + + + + + + + The index of the last point in the monotone chain. + + + + + + Computes the intersection of line segments, + and adds the intersection to the edges containing the segments. + + + + + + + + + + + + + Testing only. + + + + + + + + + + + + + + + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning + and end segments. + + + + + + + + + This method is called by clients of the EdgeIntersector class to test for and add + intersections for two segments of the edges being intersected. + Note that clients (such as MonotoneChainEdges) may choose not to intersect + certain pairs of segments for efficiency reasons. + + + + + + + + + + + + + + + + + + + + + + + + + The proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire Geometry, since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the Geometry. + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this SegmentIntersector. + + + + + Finds all intersections in one or two sets of edges, + using the straightforward method of + comparing all segments. + This algorithm is too slow for production use, but is useful for testing purposes. + + + + + + + + + + + + + + + + + + + + + Performs a brute-force comparison of every segment in each Edge. + This has n^2 performance, and is about 100 times slower than using + monotone chains. + + + + + + + + Finds all intersections in one or two sets of edges, + using an x-axis sweepline algorithm in conjunction with Monotone Chains. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + The use of MonotoneChains as the items in the index + seems to offer an improvement in performance over a sweep-line alone. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + Finds all intersections in one or two sets of edges, + using a simple x-axis sweepline algorithm. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because DELETE events have a link to their corresponding INSERT event, + it is possible to compute exactly the range of events which must be + compared to a given INSERT event object. + + + + + + + + + + + + + + + + + + + + + + + + + Creates an INSERT event. + + The edge set label for this object. + The event location + the object being inserted + + + + Creates a DELETE event. + + The event location + The corresponding INSERT event + + + + Events are ordered first by their x-value, and then by their eventType. + Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Label indicates the topological relationship of a component + of a topology graph to a given Geometry. + This class supports labels for relationships to two Geometrys, + which is sufficient for algorithms for binary operations. + Topology graphs support the concept of labeling nodes and edges in the graph. + The label of a node or edge specifies its topological relationship to one or + more geometries. (In fact, since NTS operations have only two arguments labels + are required for only two geometries). A label for a node or edge has one or + two elements, depending on whether the node or edge occurs in one or both of the + input Geometrys. Elements contain attributes which categorize the + topological location of the node or edge relative to the parent + Geometry; that is, whether the node or edge is in the interior, + boundary or exterior of the Geometry. Attributes have a value + from the set {Interior, Boundary, Exterior}. In a node each + element has a single attribute On. For an edge each element has a + triplet of attributes Left, On, Right. + It is up to the client code to associate the 0 and 1 TopologyLocations + with specific geometries. + + + + + Converts a Label to a Line label (that is, one with no side Location). + + Label to convert. + Label as Line label. + + + + Construct a Label with a single location for both Geometries. + Initialize the locations to Null. + + + + + + Construct a Label with a single location for both Geometries. + Initialize the location for the Geometry index. + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for both Geometries to the given values. + + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for the given Geometry index. + + + + + + + + + Construct a Label with the same values as the argument Label. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge this label with another one. + Merging updates any null attributes of this label with the attributes from lbl. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts one GeometryLocation to a Line location. + + + + + + + + + + + + + + + + + + + + + + Only non-null if this node is precise. + + + + + + + + + + + + + + + + + Basic nodes do not compute IMs. + + + + + + Add the edge to the list of edges at this node. + + + + + + + + + + + + To merge labels for two nodes, + the merged location for each LabelElement is computed. + The location for the corresponding node LabelElement is set to the result, + as long as the location is non-null. + + + + + + + + + + + + + Updates the label of a node to BOUNDARY, + obeying the mod-2 boundaryDetermination rule. + + + + + + The location for a given eltIndex for a node will be one + of { Null, Interior, Boundary }. + A node may be on both the boundary and the interior of a point; + in this case, the rule is that the node is considered to be in the boundary. + The merged location is the maximum of the two input values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The basic node constructor does not allow for incident edges. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + + + + + + + This method expects that a node has a coordinate value. + + + + + + + + + + + + + Adds a node for the start point of this EdgeEnd + (if one does not already exist in this map). + Adds the EdgeEnd to the (possibly new) node. + + + + + + The node if found; null otherwise. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An indicator that a Location is on a GraphComponent (0) + + + + + An indicator that a Location is to the left of a GraphComponent (1) + + + + + An indicator that a Location is to the right of a GraphComponent (2) + + + + + An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) + /// + + + + A Position indicates the position of a Location relative to a graph component + (Node, Edge, or Area). + + + + + Returns Positions.Left if the position is Positions.Right, + Positions.Right if the position is Left, or the position + otherwise. + + + + + + Utility functions for working with quadrants, which are numbered as follows: + + 1 | 0 + --+-- + 2 | 3 + + + + + + North-East + + + + + North-West + + + + + South-West + + + + + South-East + + + + + Only static methods! + + + + + Returns the quadrant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + If the displacements are both 0 + + + + Returns the quadrant of a directed line segment from p0 to p1. + + + + if the points are equal + + + + Returns true if the quadrants are 1 and 3, or 2 and 4. + + + + + + + Returns the right-hand quadrant of the halfplane defined by the two quadrants, + or -1 if the quadrants are opposite, or the quadrant if they are identical. + + + + + + + Returns whether the given quadrant lies within the given halfplane (specified + by its right-hand quadrant). + + + + + + + Returns true if the given quadrant is 0 or 1. + + + + + + A TopologyLocation is the labelling of a + GraphComponent's topological relationship to a single Geometry. + + + If the parent component is an area edge, each side and the edge itself + have a topological location. These locations are named: + + Onon the edge + Leftleft-hand side of the edge + Rightright-hand side + + + If the parent component is a line edge or node, there is a single + topological relationship attribute, On. + + The possible values of a topological location are + { , , , } + + The labelling is stored in an array _location[j] where + where j has the values On, Left, Right. + + + + + + + + + + + + Constructs a TopologyLocation specifying how points on, to the left of, and to the + right of some GraphComponent relate to some Geometry. Possible values for the + parameters are Location.Null, Location.Exterior, Location.Boundary, + and Location.Interior. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge updates only the Null attributes of this object + with the attributes of another. + + + + + + + + + + + Get calls Get(Positions posIndex), + Set calls SetLocation(Positions locIndex, Location locValue) + + + + + + + true if all locations are Null. + + + + + true if any locations are Null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An BinTree (or "Binary Interval Tree") + is a 1-dimensional version of a quadtree. + It indexes 1-dimensional intervals (which may + be the projection of 2-D objects on an axis). + It supports range searching + (where the range may be a single point). + + + + This structure is dynamic - + new items can be added at any time, + and it will support deletion of items + (although this is not currently implemented). + + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + This index is different to the Interval Tree of Edelsbrunner + or the Segment Tree of Bentley. + + + + + Ensure that the Interval for the inserted item has non-zero extents. + Use the current minExtent to pad it, if necessary. + + + + + + + + + + + + + + + + + Removes a single item from the tree. + + itemEnv the Envelope of the item to be removed + the item to remove + true if the item was found (and thus removed) + + + + + + + + + + + + + + + + + Queries the tree to find all candidate items which + may overlap the query interval. + If the query interval is null, all items in the tree are found. + min and max may be the same value. + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + + + + + + + + + + + + + + + + + Compute the total number of nodes in the tree. + + The number of nodes in the tree. + + + + A Key is a unique identifier for a node in a tree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node of a Bintree. + + + + + The base class for nodes in a Bintree. + + + + + Returns the index of the subnode that wholely contains the given interval. + If none does, returns -1. + + + + + + + + + + + + Subnodes are numbered as follows: + 0 | 1 + . + + + + + + + + + + + + + + + + + + + + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + Removes a single item from this subtree. + + The envelope containing the item + The item to remove + true if the item was found and removed + + + + + + + + + Gets whether this node is prunable + + + + + Gets whether this node has any children + + + + + + + + + + Gets whether this node has any subnodes + + + + + + + + + + + + + + + Creates a node + + The interval of the node item + A new node + + + + Creates a larger node, that contains both and + If is null, a node for is created. + + The original node + The additional interval + A new node + + + + Creates a new node instance + + The node's interval + The node's level + + + + + + + + + + + Returns the subnode containing the envelope. + Creates the node if + it does not already exist. + + + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subnode for the index. + If it doesn't exist, create it. + + + + + + + + + + + + Gets the node's + + + + + The root node of a single Bintree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the tree this is the root of. + + + + + + + Insert an item which is known to be contained in the tree rooted at + the given Node. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + The root node matches all searches. + + + + + + MonotoneChains are a way of partitioning the segments of a linestring to + allow for fast searching of intersections. + + + + They have the following properties: + + the segments within a monotone chain never intersect each other + the envelope of any contiguous subset of the segments in a monotone chain + is equal to the envelope of the endpoints of the subset. + + + + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows an efficient + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + One of the goals of this implementation of MonotoneChains is to be + as space and time efficient as possible. One design choice that aids this + is that a MonotoneChain is based on a subarray of a list of points. + This means that new arrays of points (potentially very large) do not + have to be allocated. + + MonotoneChains support the following kinds of queries: + + Envelope selectdetermine all the segments in the chain which + intersect a given envelope. + Overlapdetermine all the pairs of segments in two chains whose + envelopes overlap. + + + + This implementation of MonotoneChains uses the concept of internal iterators + ( and ) + to return the resultsets for the above queries. + This has time and space advantages, since it + is not necessary to build lists of instantiated objects to represent the segments + returned by the query. + Queries made in this manner are thread-safe. + + + + + + + + + + + + + + + Gets the line segment starting at + + The index of the segment + The line segment to extract to + + + + Determine all the line segments in the chain whose envelopes overlap + the searchEnvelope, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the select action on chain segments + which it can determine are not in the search envelope. + However, it *may* call the select action on segments + which do not intersect the search envelope. + This saves on the overhead of checking envelope intersection + each time, since clients may be able to do this more efficiently. + + The search envelope + The select action to execute on selected segments + + + + + + + + + + + + + Determine all the line segments in two chains which may overlap, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the overlap action on chain segments + which it can determine do not overlap. + However, it *may* call the overlap action on segments + which do not actually interact. + This saves on the overhead of checking intersection + each time, since clients may be able to do this more efficiently. + + The monotone chain + The overlap action to execute on selected segments + + + + + + + + + + + + + + + Gets or sets the Id + + + + + Gets the chain's context + + + + + Gets the chain's envelope + + + + + Gets the start index + + + + + Gets the end index of the underlying linestring + + + + + Return the subsequence of coordinates forming this chain. + Allocates a new array to hold the Coordinates. + + + + + Constructs s + for sequences of s. + + + + + Only static methods! + + + + + + + + + + + + + + + + + + + Return a list of the MonotoneChains + for the given list of coordinates. + + + + + + + Return an array containing lists of start/end indexes of the monotone chains + for the given list of coordinates. + The last entry in the array points to the end point of the point array, + for use as a sentinel. + + + + + + Finds the index of the last point in a monotone chain + starting at a given point. + Any repeated points (0-length segments) will be included + in the monotone chain returned. + + The coordinates + The start index + + The index of the last point in the monotone chain starting at start. + + + + + The action for the internal iterator for performing + overlap queries on a MonotoneChain. + + + + + This envelope is used during the MonotoneChain search process. + + + + + This envelope is used during the MonotoneChain search process. + + + + + + + + + + + + + + + This function can be overridden if the original chains are needed. + + + The index of the start of the overlapping segment from mc1. + + The index of the start of the overlapping segment from mc2. + + + + This is a convenience function which can be overridden to obtain the actual + line segments which overlap. + + + + + + + A visitor for nodes and items in an index. + + + + + + + + + + + A static index on a set of 1-dimensional intervals, + using an R-Tree packed based on the order of the interval midpoints. + + + It supports range searching, + where the range is an interval of the real line (which may be a single point). + A common use is to index 1-dimensional intervals which + are the projection of 2-D objects onto an axis of the coordinate system. + + This index structure is static + - items cannot be added or removed once the first query has been made. + The advantage of this characteristic is that the index performance + can be optimized based on a fixed set of items. + + Martin Davis + + + + + Adds an item to the index which is associated with the given interval + + The lower bound of the item interval + The upper bound of the item interval + The item to insert + if the index has already been queried + + + + Search for intervals in the index which intersect the given closed interval + and apply the visitor to them. + + The lower bound of the query interval + The upper bound of the query interval + The visitor to pass any matched items to + + + + The basic insertion and query operations supported by classes + implementing spatial index algorithms. + A spatial index typically provides a primary filter for range rectangle queries. A + secondary filter is required to test for exact intersection. Of course, this + secondary filter may consist of other tests besides intersection, such as + testing other kinds of spatial relationships. + + + + + Adds a spatial item with an extent specified by the given Envelope to the index. + + + + + Queries the index for all items whose extents intersect the given search Envelope + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A list of the items found by the query. + + + + Queries the index for all items whose extents intersect the given search , + and applies an to them. + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A visitor object to apply to the items found. + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + A node of a , which represents one or more points in the same location. + + The type of the object + dskea + + + + Creates a new KdNode. + + coordinate of point + coordinate of point + A data objects to associate with this node + + + + Creates a new KdNode. + + The point location of new node + A data objects to associate with this node + + + + Gets x-ordinate of this node + + + + + Gets y-ordinate of this node + + + + + Gets the location of this node + + + + + Gets the user data object associated with this node. + + + + + Gets or sets the left node of the tree + + + + + Gets or sets the right node of the tree + + + + + Gets the number of inserted points that are coincident at this location. + + + + + Gets whether more than one point with this value have been inserted (up to the tolerance) + + + + + + An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. + + + This implementation supports detecting and snapping points which are closer + than a given distance tolerance. + If the same point (up to tolerance) is inserted + more than once , it is snapped to the existing node. + In other words, if a point is inserted which lies within the tolerance of a node already in the index, + it is snapped to that node. + When a point is snapped to a node then a new node is not created but the count of the existing node + is incremented. + If more than one node in the tree is within tolerance of an inserted point, + the closest and then lowest node is snapped to. + + The type of the user data object + David Skea + Martin Davis + + + + Converts a collection of s to an array of s. + + A collection of nodes + An array of the coordinates represented by the nodes + + + + Converts a collection of {@link KdNode}s + to an array of s, + specifying whether repeated nodes should be represented + by multiple coordinates. + + a collection of nodes + true if repeated nodes should + be included multiple times + An array of the coordinates represented by the nodes + + + + Creates a new instance of a KdTree with a snapping tolerance of 0.0. + (I.e. distinct points will not be snapped) + + + + + Creates a new instance of a KdTree with a snapping distance + tolerance. Points which lie closer than the tolerance to a point already + in the tree will be treated as identical to the existing point. + + The tolerance distance for considering two points equal + + + + Inserts a new point in the kd-tree, with no data. + + The point to insert + The kdnode containing the point + + + + Inserts a new point into the kd-tree. + + The point to insert + A data item for the point + + A new KdNode if a new point is inserted, else an existing + node is returned with its counter incremented. This can be checked + by testing returnedNode.getCount() > 1. + + + + + Finds the node in the tree which is the best match for a point + being inserted. + The match is made deterministic by returning the lowest of any nodes which + lie the same distance from the point. + There may be no match if the point is not within the distance tolerance of any + existing node. + + The point being inserted + + + the best matching node + null if no match was found + + + + + + Inserts a point known to be beyond the distance tolerance of any existing node. + The point is inserted at the bottom of the exact splitting path, + so that tree shape is deterministic. + + The point to insert + + + The data for the point + The created node + + + + + + Performs a range search of the points in the index. + + The range rectangle to query + + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection of the KdNodes found + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection to accumulate the result nodes into + + + + Performs a nearest neighbor search of the points in the index. + + The point to search the nearset neighbor for + + + + Tests whether the index contains any items. + + + + + DoubleBits manipulates Double numbers + by using bit manipulation and bit-field extraction. + For some operations (such as determining the exponent) + this is more accurate than using mathematical operations + (which suffer from round-off error). + The algorithms and constants in this class + apply only to IEEE-754 double-precision floating point format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This computes the number of common most-significant bits in the mantissa. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + The number of common most-significant mantissa bits. + + + + A representation of the Double bits formatted for easy readability. + + + + + + + + + + Determines the exponent for the number. + + + + + Determines the exponent for the number. + + + + + Provides a test for whether an interval is + so small it should be considered as zero for the purposes of + inserting it into a binary tree. + The reason this check is necessary is that round-off error can + cause the algorithm used to subdivide an interval to fail, by + computing a midpoint value which does not lie strictly between the + endpoints. + + + + + This value is chosen to be a few powers of 2 less than the + number of bits available in the double representation (i.e. 53). + This should allow enough extra precision for simple computations to be correct, + at least for comparison purposes. + + + + + Only static methods! + + + + + Computes whether the interval [min, max] is effectively zero width. + I.e. the width of the interval is so much less than the + location of the interval that the midpoint of the interval cannot be + represented precisely. + + + + + A Key is a unique identifier for a node in a quadtree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a node of a Quadtree. Nodes contain + items which have a spatial extent corresponding to the node's position + in the quadtree. + + + + + The base class for nodes in a Quadtree. + + + + + Gets the index of the subquad that wholly contains the given envelope. + If none does, returns -1. + + The index of the subquad that wholly contains the given envelope
+ or -1 if no subquad wholly contains the envelope
+
+ + + + + + + + subquads are numbered as follows: + 2 | 3 + --+-- + 0 | 1 + + + + + + + + + + + Removes a single item from this subtree. + + The envelope containing the item. + The item to remove. + true if the item was found and removed. + + + + Insert items in this into the parameter! + + IList for adding items. + Parameter IList with this items. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the subquad containing the envelope . + Creates the subquad if + it does not already exist. + + The envelope to search for + The subquad containing the search envelope. + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subquad for the index. + If it doesn't exist, create it. + + + + + + + + + + + + + + + + + + A Quadtree is a spatial index structure for efficient range querying + of items bounded by 2D rectangles.
+ s can be indexed by using their s.
+ Any type of object can also be indexed, as long as it has an extent that can be + represented by an . + + This Quadtree index provides a primary filter + for range rectangle queries. The various query methods return a list of + all items which may intersect the query rectangle. Note that + it may thus return items which do not in fact intersect the query rectangle. + A secondary filter is required to test for actual intersection + between the query rectangle and the envelope of each candidate item. + The secondary filter may be performed explicitly, + or it may be provided implicitly by subsequent operations executed on the items + (for instance, if the index query is followed by computing a spatial predicate + between the query geometry and tree items, + the envelope intersection check is performed automatically. + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + + This data structure is also known as an MX-CIF quadtree + following the terminology usage of Samet and others. +
+
+ + + Ensure that the envelope for the inserted item has non-zero extents. + Use the current minExtent to pad the envelope, if necessary. + + + + + + + minExtent is the minimum envelope extent of all items + inserted into the tree so far. It is used as a heuristic value + to construct non-zero envelopes for features with zero X and/or Y extent. + Start with a non-zero extent, in case the first feature inserted has + a zero extent in both directions. This value may be non-optimal, but + only one feature will be inserted with this value. + + + + + Constructs a Quadtree with zero items. + + + + + + + + + + + + Removes a single item from the tree. + + The Envelope of the item to be removed. + The item to remove. + true if the item was found (and thus removed). + + + + Queries the tree and returns items which may lie in the given search envelope. + + + Precisely, the items that are returned are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be returned as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not returned - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A List of items which may intersect the search envelope + + + + Queries the tree and visits items which may lie in the given search envelope. + + + Precisely, the items that are visited are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be visited as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not visited - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A visitor object which is passed the visited items + + + + Return a list of all items in the Quadtree. + + + + + + + + + + + Returns the number of levels in the tree. + + + + + Tests whether the index contains any items. + + + + + Returns the number of items in the tree. + + + + + QuadRoot is the root of a single Quadtree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the quadtree this is the root of. + + + + + Insert an item which is known to be contained in the tree rooted at + the given QuadNode root. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + + + + + A node of an . A node is one of: + + empty + an interior node containing child s + a leaf node containing data items (s). + + A node stores the bounds of its children, and its level within the index tree. + + + + + Constructs an AbstractNode at the given level in the tree + + + 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Returns a representation of space that encloses this Boundable, + preferably not much bigger than this Boundable's boundary yet fast to + test for intersection with the bounds of other Boundables. The class of + object returned depends on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other + object (for other subclasses of AbstractSTRtree). + + + + + Adds either an AbstractNode, or if this is a leaf node, a data object + (wrapped in an ItemBoundable). + + + + + + Returns either child s, or if this is a leaf node, real data (wrapped + in s). + + + + + Gets the bounds of this node + + + + + Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Gets the count of the s at this node. + + + + + Tests whether there are any s at this node. + + + + + Base class for STRtree and SIRtree. STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + This implementation is based on s rather than just s, + because the STR algorithm operates on both nodes and + data, both of which are treated as s. + + + + + Set to null when index is built, to avoid retaining memory. + + + + Constructs an AbstractSTRtree with the specified maximum number of child + nodes that a node may have. + + + + + + Creates parent nodes, grandparent nodes, and so forth up to the root + node, for the data that has been inserted into the tree. Can only be + called once, and thus can be called only after all of the data has been + inserted into the tree. + + + + + + + + + + + + Sorts the childBoundables then divides them into groups of size M, where + M is the node capacity. + + + + + + + Creates the levels higher than the given level. + + The level to build on. + the level of the Boundables, or -1 if the boundables are item + boundables (that is, below level 0). + The root, which may be a ParentNode or a LeafNode. + + + + Also builds the tree, if necessary. + + + + + + Gets a tree structure (as a nested list) + corresponding to the structure of the items and nodes in this tree. + The returned Lists contain either Object items, + or Lists which correspond to subtrees of the tree + Subtrees which do not contain any items are not included. + Builds the tree if necessary. + + a List of items and/or Lists + + + + Removes an item from the tree. + (Builds the tree, if necessary.) + + + + + Returns the maximum number of child nodes that a node may have. + + + + + Tests whether the index contains any items. + This method does not build the index, + so items can still be inserted after it has been called. + + + + + Gets the number of elements in the tree + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + For STRtrees, the bounds will be Envelopes; + for SIRtrees, Intervals; + for other subclasses of AbstractSTRtree, some other class. + + The bounds of one spatial object. + The bounds of another spatial object. + Whether the two bounds intersect. + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + Boundable wrapper for a non-Boundable spatial object. Used internally by + AbstractSTRtree. + + + + + + + + + + + + The bounds + + + + + The item + + + + + One-dimensional version of an STR-packed R-tree. SIR stands for + "Sort-Interval-Recursive". STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an SIRtree with the default (10) node capacity. + + + + + Constructs an SIRtree with the given maximum number of child nodes that + a node may have. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + + Returns items whose bounds intersect the given value. + + + + + + Returns items whose bounds intersect the given bounds. + + Possibly equal to x2. + Possibly equal to x1. + + + + + + + + + + + + + + + + + + + + + + + + + + + A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. + For two-dimensional spatial data. + The STR packed R-tree is simple to implement and maximizes space + utilization; that is, as many leaves as possible are filled to capacity. + Overlap between nodes is far less than in a basic R-tree. However, once the + tree has been built (explicitly or on the first call to #query), items may + not be added or removed. + Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an STRtree with the default (10) node capacity. + + + + + Constructs an STRtree with the given maximum number of child nodes that + a node may have. + + The minimum recommended capacity setting is 4. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates the parent level for the given child level. First, orders the items + by the x-values of the midpoints, and groups them into vertical slices. + For each slice, orders the items by the y-values of the midpoints, and + group them into runs of size M (the node capacity). For each run, creates + a new (parent) node. + + + + + + + + + + + + + + + + + + + + + + + + + Must be sorted by the x-value of the envelope midpoints. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + + + + + + + Finds the two nearest items in the tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + A distance metric applicable to the items in this tree + The pair of the nearest items + + + + Finds the item in this tree which is nearest to the given , + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + The query does not have to be + contained in the tree, but it does + have to be compatible with the + distance metric. + + The envelope of the query item + The item to find the nearest neighbour of + A distance metric applicable to the items in this tree and the query item + The nearest item in this tree + + + + Finds the two nearest items from this tree + and another tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + The result value is a pair of items, + the first from this tree and the second + from the argument tree. + + Another tree + A distance metric applicable to the items in the trees + The pair of the nearest items, one from each tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ProjectionEvents are ordered first by their x-value, and then by their eventType. + It is important that Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sweepline implements a sorted index on a set of intervals. + It is used to compute all overlaps between the interval in the index. + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reads a sequence of s in WKT format from a text file. + + The geometries in the file may be separated by any amount of whitespace and newlines. + + Martin Davis + + + + + Creates a new given the to read from and a to use to parse the geometries. + + the to read from + the geometry reader to use + + + + Creates a new , given the name of the file to read from. + + The name of the file to read from + The geometry reader to use + + + + Creates a new , given a to read with. + + The stream reader of the file to read from + The geometry reader to use + + + + Reads a sequence of geometries. + + + + If an offset is specified, geometries read up to the offset count are skipped. + If a limit is specified, no more than geometries are read. + + The list of geometries read + + + + Tests if reader is at EOF. + + + + + Gets/Sets the maximum number of geometries to read. + + + + + Gets/Sets the number of geometries to skip before reading. + + + + + Finds if two sets of s intersect. + + + Uses indexing for fast performance and to optimize repeated tests + against a target set of lines. + Short-circuited to return as soon an intersection is found. + + Immutable and thread-safe. + + + + + Creates an intersection finder against a given set of segment strings. + + The segment strings to search for intersections + + + + Tests for intersections with a given set of target {@link SegmentString}s. + + The SegmentStrings to test + true if an intersection was found + + + + Tests for intersections with a given set of target s. + using a given SegmentIntersectionDetector. + + The SegmentStrings to test + The intersection detector to use + true if the detector reports intersections + + + Gets the segment set intersector used by this class. + This allows other uses of the same underlying indexed structure. + + + + Intersects two sets of s using a index based + on s and a . + + Thread-safe and immutable. + + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of indexed segments. + + + + + + + Gets the index constructed over the base segment strings + + NOTE: To retain thread-safety, treat returned value as immutable + + + + Segment overlap action class + + + + + Creates an instance of this class using the provided + + The segment intersector to use + + + + Detects and records an intersection between two s, + if one exists. Only a single intersection is recorded. + + + This strategy can be configured to search for proper intersections. + In this case, the presence of any intersection will still be recorded, + but searching will continue until either a proper intersection has been found + or no intersections are detected. + + + + + Creates an intersection finder using a + + + + + Creates an intersection finder using a given + + The LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected. + + + Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). + + + + + Gets or sets whether processing must continue until a proper intersection is found + + + + + Gets or sets whether processing can terminate once any intersection is found. + + + + + Tests whether an intersection was found. + + + + + Tests whether a proper intersection was found. + + + + + Tests whether a non-proper intersection was found. + + + + + Gets the computed location of the intersection. Due to round-off, the location may not be exact. + + + + Gets the endpoints of the intersecting segments. + + An array of the segment endpoints (p00, p01, p10, p11) + + + + Tests whether processing can terminate, + because all required information has been obtained + (e.g. an intersection of the desired type has been detected). + + + + + Utility methods for processing s + + Martin Davis + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Converts a collection of s into a . + The geometry will be either a + or a (possibly empty). + + A collection of . + A geometry factory + A or a . + + + + Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. + These kinds of geometries are useful as a more complex geometry for testing algorithms. + + + Martin Davis + + + + + Computes various kinds of common geometric shapes. + Allows various ways of specifying the location and extent of the shapes, + as well as number of line segments used to form them. + + + + + Create a shape factory which will create shapes using the default GeometryFactory. + + + + + Create a shape factory which will create shapes using the given GeometryFactory. + + The factory to use. + + + + Creates a rectangular Polygon. + + A rectangular polygon. + + + + Creates a circular Polygon. + + A circular polygon. + + + + Creates an elliptical Polygon. + If the supplied envelope is square the + result will be a circle. + + An an ellipse or circle. + + + + Creates a squircular . + + a squircle + + + + Creates a supercircular + of a given positive power. + + a supercircle + + + + Creates a elliptical arc, as a LineString. + + The arc is always created in a counter-clockwise direction. + + Start angle in radians + Size of angle in radians + + + + + Creates an elliptical arc polygon. + + + The polygon is formed from the specified arc of an ellipse + and the two radii connecting the endpoints to the centre of the ellipse. + + Start angle in radians + Size of angle in radians + An elliptical arc polygon + + + + Gets/Sets the location of the shape by specifying the base coordinate + (which in most cases is the + lower left point of the envelope containing the shape). + + + + + Gets/Sets the location of the shape by specifying the centre of + the shape's bounding box. + + + + + Gets or sets the envelope of the shape + + + + + Gets/Sets the total number of points in the created Geometry. + + + + + Gets/Sets the size of the extent of the shape in both x and y directions. + + + + + Gets/Sets the width of the shape. + + + + + Gets/Sets the height of the shape. + + + + + Gets/Sets the rotation angle, in radians, to use for the shape. + The rotation is applied relative to the centre of the shape. + + + + + Creates a factory which will create sine stars using the default + + + + + Creates a factory which will create sine stars using the given + + The factory to use + + + + Generates the geometry for the sine star + + The geometry representing the sine star + + + Gets/Sets the number of arms in the star + + + + Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. + + Value should be between 0.0 and 1.0 + + + + Extends the class to allow reading values in the BigEndian format. + + + While extends + adding methods for reading integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for reading values in the BigEndian format. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + encoding is null. + The stream does not support reading, the stream is null, or the stream is already closed. + + + + Reads a 2-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by two bytes. + + + A 2-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 2-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by two bytes. + + + A 2-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by four bytes. + + + A 4-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by eight bytes. + + + An 8-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a string from the current stream. + The string is prefixed with the length, encoded as an integer seven bits at a time. + + The string being read. + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a decimal value from the current stream + and advances the current position of the stream by sixteen bytes. + + + A decimal value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Extends the class to allow writing values in the BigEndian format. + + + While extends + adding methods for writing integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for writing values in the BigEndian format. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The supplied stream. + output is null. + + The stream does not support writing, or the stream is already closed. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + output or encoding is null. + + The stream does not support writing, or the stream is already closed. + + + + Writes a two-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a two-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes a length-prefixed string to this stream in the current encoding + of the , + and advances the current position of the stream in accordance + with the encoding used and the specific characters being written to the stream. + + The value to write. + The stream is closed. + An I/O error occurs. + value is null. + + + + Writes a decimal value to the current stream and advances the stream position by sixteen bytes. + + The decimal value to write. + The stream is closed. + An I/O error occurs. + + + + Reads a GML document and creates a representation of the features based on NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + + + + Initialize reader with a standard . + + + + + Initialize reader with the given . + + + + + Read a GML document and returns relative . + + + + + + + Reads the coordinate. + + The reader. + + + + + Extract a from a x,y string value. + + + + + + + Extract a from a pos entity string value. + + + + + + + Extract a from a x,y string value. + + + + + builder. + + + + + Writes the GML representation of the features of NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + Thanks to rstuven for improvements :) + + + + + + Returns an XmlReader with feature informations. + Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. + + + + + + + Writes a GML feature into a generic Stream, such a FileStream or other streams. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formatter for double values of coordinates + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + Converts a Well-Known Binary byte data to a Geometry. + + + The reader repairs structurally-invalid input + (specifically, LineStrings and LinearRings which contain + too few points have vertices added, + and non-closed rings are closed). + s + + + + Converts a hexadecimal string to a byte array. + The hexadecimal digit symbols are case-insensitive. + + A string containing hex digits + An array of bytes with the value of the hex string + + + true if structurally invalid input should be reported rather than repaired. + At some point this could be made client-controllable. + + + + Initialize reader with a standard . + + + + + Initialize reader with the given GeometryFactory. + + + + + + Reads a in binary WKB format from an array of s. + + The byte array to read from + The geometry read + if the WKB data is ill-formed. + + + + Reads a in binary WKB format from an . + + The stream to read from + The geometry read + if the WKB data is ill-formed. + + + + + + + + + + + + + + + + + Function to read a coordinate sequence. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to form a ring. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to serve a line string. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to convert from to + + The coordinate system + The corresponding + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Function to determine whether an ordinate should be handled or not. + + + + + + + The builder. + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + WKB Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + Point with Z coordinate. + + + + + LineString with Z coordinate. + + + + + Polygon with Z coordinate. + + + + + MultiPoint with Z coordinate. + + + + + MultiLineString with Z coordinate. + + + + + MultiPolygon with Z coordinate. + + + + + GeometryCollection with Z coordinate. + + + + + Point with M ordinate value. + + + + + LineString with M ordinate value. + + + + + Polygon with M ordinate value. + + + + + MultiPoint with M ordinate value. + + + + + MultiLineString with M ordinate value. + + + + + MultiPolygon with M ordinate value. + + + + + GeometryCollection with M ordinate value. + + + + + Point with Z coordinate and M ordinate value. + + + + + LineString with Z coordinate and M ordinate value. + + + + + Polygon with Z coordinate and M ordinate value. + + + + + MultiPoint with Z coordinate and M ordinate value. + + + + + MultiLineString with Z coordinate and M ordinate value. + + + + + MultiPolygon with Z coordinate and M ordinate value. + + + + + GeometryCollection with Z coordinate and M ordinate value. + + + + + Writes a Well-Known Binary byte data representation of a Geometry. + + + WKBWriter stores X,Y,Z values if is not , + otherwise value is discarded and only X,Y are stored. + + + + Converts a byte array to a hexadecimal string. + A byte array + + + Converts a byte array to a hexadecimal string. + A byte array + + + + Initializes writer with LittleIndian byte order. + + + + + Initializes writer with the specified byte order. + + Encoding type + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + M values, present or not, should be emitted + + + + Writes a WKB representation of a given point. + + + + + + + Writes a WKB representation of a given point. + + + + + + + + + + + + + + + Writes LittleIndian ByteOrder. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets or sets whether the value should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Standard byte size for each complex point. + Each complex point (LineString, Polygon, ...) contains: + 1 byte for ByteOrder and + 4 bytes for WKBType. + 4 bytes for SRID value + + + + + Gets a value whether or not EWKB featues may be used. + EWKB features are + 0x80000000 flag if geometry's z-ordinate values are written + 0x40000000 flag if geometry's m-ordinate values are written + 0x20000000 flag if geometry's SRID value is written + + + + + Converts a Well-Known Text string to a Geometry. + + The WKTReader allows + extracting Geometry objects from either input streams or + internal strings. This allows it to function as a parser to read Geometry + objects from text blocks embedded in other data formats (e.g. XML). + + The Well-known + Text format is defined in the + OpenGIS Simple Features Specification for SQL . + + NOTE: There is an inconsistency in the SFS. + The WKT grammar states that MultiPoints are represented by + MULTIPOINT ( ( x y), (x y) ), + but the examples show MultiPoints as MULTIPOINT ( x y, x y ). + Other implementations follow the latter syntax, so NTS will adopt it as well. + A WKTReader is parameterized by a GeometryFactory, + to allow it to create Geometry objects of the appropriate + implementation. In particular, the GeometryFactory will + determine the PrecisionModel and SRID that is used. + The WKTReader will convert the input numbers to the precise + internal representation. + + reads also non-standard "LINEARRING" tags. + + + + + + Creates a WKTReader that creates objects using a basic GeometryFactory. + + + + + Creates a WKTReader that creates objects using the given + GeometryFactory. + + The factory used to create Geometrys. + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + A Reader which will return a "Geometry Tagged Text" + string (see the OpenGIS Simple Features Specification). + + A Geometry read from reader. + + + + + Returns the next array of Coordinates in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next element returned by the stream should be "(" (the + beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". + + + if set to true skip extra parenthesis around coordinates. + + + The next array of Coordinates in the + stream, or an empty array if "EMPTY" is the next element returned by + the stream. + + + + + + + + + + + + + + + + + + + + Returns the next number in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a number. + + The next number in the stream. + if the next token is not a valid number + + + + Returns the next "EMPTY" or "(" in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be "EMPTY" or "(". + + + The next "EMPTY" or "(" in the stream as uppercase text. + + + + Returns the next ")" or "," in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")" or ",". + + + The next ")" or "," in the stream. + + + + Returns the next ")" in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")". + + + The next ")" in the stream. + + + + Returns the next word in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a word. + + The next word in the stream as uppercase text. + + + + Creates a Geometry using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Geometry Tagged Text. + + A Geometry specified by the next token + in the stream. + + + + Creates a Point using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Point Text. + + + A Point specified by the next token in + the stream. + + + + Creates a LineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + + A LineString specified by the next + token in the stream. + + + + Creates a LinearRing using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + A LinearRing specified by the next + token in the stream. + + + + Creates a MultiPoint using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <MultiPoint Text. + + + + A MultiPoint specified by the next + token in the stream. + + + + Creates an array of Points having the given Coordinates. + + + The Coordinates with which to create the Points + + The factory to create the points + + Points created using this WKTReader + s GeometryFactory. + + + + + Creates a Polygon using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a Polygon Text. + + + + A Polygon specified by the next token + in the stream. + + + + + Creates a MultiLineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiLineString Text. + + + + A MultiLineString specified by the + next token in the stream. + + + + Creates a MultiPolygon using the next token in the stream. + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiPolygon Text. + + + + A MultiPolygon specified by the next + token in the stream, or if if the coordinates used to create the + Polygon shells and holes do not form closed linestrings. + + + + Creates a GeometryCollection using the next token in the + stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <GeometryCollection Text. + + + + A GeometryCollection specified by the + next token in the stream. + + + + Gets or sets the factory to create geometries + + + + + Gets or sets the default SRID + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Outputs the textual representation of a . + The outputs coordinates rounded to the precision + model. No more than the maximum number of necessary decimal places will be + output. + The Well-known Text format is defined in the OpenGIS Simple Features + Specification for SQL. + A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does + not define a special tag for LinearRings. The standard tag to use is + "LINESTRING". + + + + + Generates the WKT for a Point specified by a . + + The point coordinate. + The WKT + + + + Generates the WKT for a N-point LineString specified by a . + + The sequence to write. + The WKT + + + Generates the WKT for a LINESTRING + specified by a {@link CoordinateSequence}. + + @param seq the sequence to write + + @return the WKT string + + + + Generates the WKT for a LineString specified by two s. + + The first coordinate. + The second coordinate. + The WKT + + + + Creates the NumberFormatInfo used to write doubles + with a sufficient number of decimal places. + + + The PrecisionModel used to determine + the number of decimal places to write. + + + A NumberFormatInfo that write doubles + without scientific notation. + + + + + Returns a String of repeated characters. + + The character to repeat. + The number of times to repeat the character. + A string of characters. + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Stream to write into + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + + A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + + A Geometry Tagged Text string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process + + + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification). + + + + + Converts a Geometry to <Geometry Tagged Text format, + then appends it to the writer. + + /he Geometry to process. + + /he output writer to append to. + + + + Converts a Coordinate to Point Tagged Text format, + then appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a LineString to <LineString Tagged Text + format, then appends it to the writer. + + The LineString to process. + + The output writer to append to. + + + + Converts a LinearRing to <LinearRing Tagged Text + format, then appends it to the writer. + + The LinearRing to process. + + The output writer to append to. + + + + Converts a Polygon to Polygon Tagged Text format, + then appends it to the writer. + + The Polygon to process. + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Tagged Text + format, then appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to MultiLineString Tagged + Text format, then appends it to the writer. + + The MultiLineString to process. + + The output writer to append to. + + + + Converts a MultiPolygon to MultiPolygon Tagged Text + format, then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollection + Tagged Text format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + Converts a Coordinate to Point Text format, then + appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + Appends the i'th coordinate from the sequence to the writer + the to process + the index of the coordinate to write + writer the output writer to append to + + + + + Converts a Coordinate to Point format, then appends + it to the writer. + + The Coordinate to process. + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a to a . + + The to convert. + + The as a . + + + + Converts a to <LineString Text> format, then appends it to the writer + + + + + Converts a LineString to <LineString Text format, then + appends it to the writer. + + The LineString to process. + + + The output writer to append to. + + + + Converts a Polygon to Polygon Text format, then + appends it to the writer. + + The Polygon to process. + + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Text format, then + appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to <MultiLineString Text + format, then appends it to the writer. + + The MultiLineString to process. + + + The output writer to append to. + + + + Converts a MultiPolygon to <MultiPolygon Text format, + then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollectionText + format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + + + + + + + + + + + + + + + + + Gets/sets whther the output woll be formatted + + + + + Gets/sets the maximum number of coordinates per line written in formatted output. + + If the provided coordinate number is < 0, coordinates will be written all on one line. + + + Gets/sets the tab size to use for indenting. + If the size is non-positive + + + + Extracts the subline of a linear between + two s on the line. + + + + + Computes the subline of a between + two s on the line. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The line to use as the baseline. + The start location. + The end location. + The extracted subline. + + + + Initializes a new instance of the class. + + + + + + Extracts a subline of the input. + If is minor that , + the linear geometry computed will be reversed. + + The start location. + The end location. + A linear geometry. + + + + + + + + + + + Assumes input is valid + (e.g. minor or equals to ). + + + + + + + + Supports linear referencing along a linear + using the length along the line as the index. + Negative length values are taken as measured in the reverse direction + from the end of the geometry. + Out-of-range index values are handled by clamping + them to the valid range of values. + Non-simple lines (i.e. which loop back to cross or touch + themselves) are supported. + + + + + Constructs an object which allows a linear + to be linearly referenced using length as an index. + + The linear geometry to reference along. + + + + Computes the for the point + on the line at the given index. + If the index is out of range the first or last point on the + line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the lies before the , + the computed geometry is reversed. + + + + + + + + + + + + + + + Computes the minimum index for a point on the line. + If the line is not simple (i.e. loops back on itself) + a single point may have more than one possible index. + In this case, the smallest index is returned. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The minimum index of the point. + + + + + Finds the index for a point on the line + which is greater than the given index. + If no such index exists, returns . + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The value the returned index must be greater than. + The index of the point greater than the given minimum index. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline.. + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + + + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line + by clamping the given index to the valid range of index values + + A valid index value + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Finds the nearest index along the linear + to a given after the specified minimum index. + If possible the location returned will be strictly + greater than the . + If this is not possible, the value returned + will equal . + (An example where this is not possible is when + = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + + + + + + + + + + + + + + + + + + Computes the for a given length + along a linear + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + + + + + Computes the for a + given length along a linear . + + The linear geometry to use. + The length index of the location. + The for the length. + + + + Computes the for a + given length along a linear , + with control over how the location + is resolved at component endpoints. + + The linear geometry to use + The length index of the location + If true lengths are resolved to the lowest possible index + + + + Computes the length for a given + on a linear . + + The linear geometry to use. + The index of the location. + The length for the . + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest possible location value. + + The length index. + The corresponding . + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest or highest possible location value, + depending on the value of resolveLower + + The length index + + The corresponding . + + + + + + + + + + + + + + + + + + Builds a linear geometry ( or ) + incrementally (point-by-point). + + + + + Creates an instance of this class. + + The geometry factory to use. + + + + Adds a point to the current line. + + The to add. + + + + Adds a point to the current line. + + The to add. + If true, allows the insertions of repeated points. + + + + Terminate the current . + + + + + + + + + + + + Builds and returns the . + + + + + + Allows invalid lines to be fixed rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + Allows invalid lines to be ignored rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + + + + + + An iterator over the components and coordinates of a linear geometry + (s and s. + + + + + + + + + + + + Invariant: currentLine <> null if the iterator is pointing at a valid coordinate + + + + + Creates an iterator initialized to the start of a linear . + + The linear geometry to iterate over. + if is not + + + + Creates an iterator starting at a on a linear . + + The linear geometry to iterate over. + The location to start at. + if is not + + + + Creates an iterator starting at + a component and vertex in a linear . + + The linear geometry to iterate over. + The component to start at. + The vertex to start at. + if is not + + + + + + + + + Tests whether there are any vertices left to iterator over. + Specifically, HasNext() returns true if the + current state of the iterator represents a valid location + on the linear geometry. + + true if there are more vertices to scan. + + + + Jump to the next element of the iteration. + + + + + Checks whether the iterator cursor is pointing to the + endpoint of a component . + + + + + The component index of the vertex the iterator is currently at. + + + + + The vertex index of the vertex the iterator is currently at. + + + + + Gets the component the iterator is current at. + + + + + Gets the first of the current segment + (the coordinate of the current vertex). + + + + + Gets the second of the current segment + (the coordinate of the next vertex). + If the iterator is at the end of a line, null is returned. + + + + + Represents a location along a or .
+ The referenced geometry is not maintained within this location, + but must be provided for operations which require it. + Various methods are provided to manipulate the location value + and query the geometry it references. +
+
+ + + Gets a location which refers to the end of a linear . + + The linear geometry. + A new LinearLocation. + + + + Computes the of a point a given fraction + along the line segment (p0, p1). + + + + If the fraction is greater than 1.0 the last + point of the segment is returned. + If the fraction is less than or equal to 0.0 the first point + of the segment is returned. + + The Z ordinate is interpolated from the Z-ordinates of the given points, + if they are specified. + + The first point of the line segment. + The last point of the line segment. + The length to the desired point. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + If true, ensures the individual values are locally valid. + + + + Creates a new location equal to a given one. + + A linear location + + + + Ensures the individual values are locally valid. + Does not ensure that the indexes are valid for + a particular linear geometry. + + + + + Ensures the indexes are valid for a given linear . + + A linear geometry. + + + + Snaps the value of this location to + the nearest vertex on the given linear , + if the vertex is closer than . + + A linear geometry. + The minimum allowable distance to a vertex. + + + + Gets the length of the segment in the given + Geometry containing this location. + + A linear geometry. + The length of the segment. + + + + Sets the value of this location to + refer to the end of a linear geometry. + + The linear geometry to use to set the end. + + + + Gets the along the + given linear which is + referenced by this location. + + A linear geometry. + The at the location. + + + + Gets a representing the segment of the given linear which contains this location. + + A linear geometry + the LineSegment containing the location + + + + Tests whether this location refers to a valid + location on the given linear . + + A linear geometry. + true if this location is valid. + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + is not the same type as this instance. + + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + + + Compares this object with the specified index values for order. + + The component index. + The segment index. + The segment fraction. + + A negative integer, zero, or a positive integer as this LineStringLocation + is less than, equal to, or greater than the specified locationValues. + + + + + Compares two sets of location values for order. + + The first component index. + The first segment index. + The first segment fraction. + The second component index. + The second segment index. + The second segment fraction. + + A negative integer, zero, or a positive integer + as the first set of location values is less than, equal to, + or greater than the second set of locationValues. + + + + + Tests whether two locations are on the same segment in the parent . + + A location on the same geometry + true if the locations are on the same segment of the parent geometry + + + + Tests whether this location is an endpoint of + the linear component it refers to. + + The linear geometry referenced by this location + True if the location is a component endpoint + + + + Converts a linear location to the lowest equivalent location index. + The lowest index has the lowest possible component and segment indices. + Specifically: + * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) + * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned + If the location index is already the lowest possible value, the original location is returned. + + The linear geometry referenced by this location. + The lowest equivalent location. + + + + Copies this location. + + A copy of this location. + + + + Gets the component index for this location. + + + + + Gets the segment index for this location. + + + + + Gets the segment fraction for this location. + + + + + Tests whether this location refers to a vertex: + returns true if the location is a vertex. + + + + + Supports linear referencing along a linear + using s as the index. + + + + + Constructs an object which allows linear referencing along + a given linear . + + The linear geometry to reference alo + + + + Computes the for the point on the line at the given index. + If the is out of range, + the first or last point on the line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point + on the line at the given index, offset by the given distance. + If the index is out of range the first or last point on the + line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment + (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The index of the start of the interval. + The index of the end of the interval. + The linear interval between the indices. + + + + Computes the index for a given point on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The index of the point. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline. + + + + Finds the index for a point on the line which is greater than the given index. + If no such index exists, returns . + + + + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + + + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + + A point on the line + The value the returned index must be greater than + The index of the point greater than the given minimum index + + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + A point on the line. + The index of the point. + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line by clamping + the given index to the valid range of index values. + + + A valid index value. + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + Determines the location of a subline along a linear . + The location is reported as a pair of s. + NOTE: Currently this algorithm is not guaranteed to + return the correct substring in some situations where + an endpoint of the test line occurs more than once in the input line. + (However, the common case of a ring is always handled correctly). + + + + + + + + + + + + + Initializes a new instance of the class. + + The linear geom. + + + + + + + + + + + Computes the of the point + on a linear nearest a given . + The nearest point is not necessarily unique; this class + always computes the nearest point closest + to the start of the geometry. + + + + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Find the nearest along the linear + to a given after the specified minimum . + If possible the location returned will be strictly greater than the . + If this is not possible, the value returned will equal . + (An example where this is not possible is when = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + Represents a list of contiguous line segments, + and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + An interface for classes which represent a sequence of contiguous line segments. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + + + + + Gets/Sets the user-defined data for this segment string. + + + + + Points that make up ISegmentString + + + + + Size of Coordinate Sequence + + + + + States whether ISegmentString is closed + + + + + Creates a new segment string from a list of vertices. + + the vertices of the segment string + the user-defined data of this segment string (may be null) + + + + Gets the octant of the segment starting at vertex index + + the index of the vertex starting the segment. Must not be the last index in the vertex list + octant of the segment at the vertex + + + Gets the user-defined data for this segment string. + + + + + Validates that a collection of s is correctly noded. + Indexing is used to improve performance. + + + + In the most common use case, validation stops after a single + non-noded intersection is detected, + but the class can be requested to detect all intersections + by using the property. + + The validator does not check for a-b-a topology collapse situations. + + The validator does not check for endpoint-interior vertex intersections. + This should not be a problem, since the JTS noders should be + able to compute intersections between vertices correctly. + + + The client may either test the condition, + or request that a suitable be thrown. + + + + + + Creates a new noding validator for a given set of linework. + + A collection of s + + + + Returns an error message indicating the segments containing the intersection. + + an error message documenting the intersection location + + + + Checks for an intersection and throws + a TopologyException if one is found. + + if an intersection is found + + + + Gets or sets whether all intersections should be found. + + + + + Gets a list of all intersections found. + + Intersections are represented as s. + List is empty if none were found. + + + + + + Checks for an intersection and reports if one is found. + + + + + An interface for classes which support adding nodes to a segment string. + + + + Adds an intersection node for a given point and segment to this segment string. + + the location of the intersection + the index of the segment containing the intersection + + + + + + + + Creates an intersection finder which tests if there is at least one interior intersection. + Uses short-circuiting for efficient performance. + The intersection found is recorded. + + A line intersector. + A intersection finder which tests if there is at least one interior intersection. + + + + Creates an intersection finder which finds all interior intersections. + The intersections are recorded for later inspection. + + A line intersector. + a intersection finder which finds all interior intersections. + + + + Creates an intersection finder which counts all interior intersections. + The intersections are note recorded to reduce memory usage. + + A line intersector. + a intersection finder which counts all interior intersections. + + + + Creates an intersection finder which finds an interior intersection if one exists + + the LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + Tests whether a segment in a is an end segment. + (either the first or last). + + a segment string + the index of a segment in the segment string + true if the segment is an end segment + + + + Gets/Sets whether all intersections should be computed. + + When this is false (the default value), the value of + is true after the first intersection is found. + Default is false. + + + + + + Gets/Sets whether intersection points are recorded. + + If the only need is to count intersection points, this can be set to false. + Default is true. + + + + + + Gets/Sets whether only end segments should be tested for interior intersection. + This is a performance optimization that may be used if + the segments have been previously noded by an appropriate algorithm. + It may be known that any potential noding failures will occur only in + end segments. + + + + + Tests whether an intersection was found. + + + + + Gets the intersections found. + + A list of . + + + + Gets the count of intersections found. + + The intersection count. + + + + Gets the computed location of the intersection. + Due to round-off, the location may not be exact. + + + + + Gets the endpoints of the intersecting segments. + + + + + Computes the possible intersections between two line segments in s + and adds them to each string + using . + + + + + + + + + + + + These variables keep track of what types of intersections were + found during ALL edges that have been intersected. + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning and end segments. + + + + + + + + + + This method is called by clients + of the class to process + intersections for two segments of the being intersected.
+ Note that some clients (such as MonotoneChain") may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Returns the proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire , since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the . + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this . + + + + + An interior intersection is an intersection which is + in the interior of some segment. + + + + + Always process all intersections + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + This class is obsolete. + Use instead. + + + + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Nodes a set of s completely. + The set of s is fully noded; + i.e. noding is repeated until no further intersections are detected. + + Iterated noding using a precision model is not guaranteed to converge, + due to roundoff error. This problem is detected and an exception is thrown. + Clients can choose to rerun the noding using a lower precision model. + + + + + + Computes all intersections between segments in a set of s. + Intersections found are represented as s and added to the + s in which they occur. + As a final step in the noding a new set of segment strings split at the nodes may be returned. + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Fully nodes a list of s, i.e. peforms noding iteratively + until no intersections are found between segments. + Maintains labelling of edges correctly through the noding. + + A collection of SegmentStrings to be noded. + If the iterated noding fails to converge. + + + + Node the input segment strings once + and create the split edges between the nodes. + + + + + + + Gets/Sets the maximum number of noding iterations performed before + the noding is aborted. Experience suggests that this should rarely need to be changed + from the default. The default is . + + + + + Nodes a set of s using a index based + on s and a . + The used should be something that supports + envelope (range) queries efficiently (such as a Quadtree" + or . + + + + + Base class for s which make a single pass to find intersections. + This allows using a custom + (which for instance may simply identify intersections, rather than insert them). + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Gets/sets the to use with this noder. + A will normally add intersection nodes + to the input segment strings, but it may not - it may + simply record the presence of intersections. + However, some s may require that intersections be added. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The + + + + + + + + + + + + + Validates that a collection of s is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Creates a new validator for the given collection + of s. + + The seg strings. + + + + Checks whether the supplied segment strings + are correctly noded. Throws an exception if they are not. + + + + + Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). + + + + + Checks all pairs of segments for intersections at an interior point of a segment. + + + + + Checks for intersections between an endpoint of a segment string + and an interior vertex of another segment string + + + + + Octants in the Cartesian plane. + Octants are numbered as follows: + + \2|1/ + 3 \|/ 0 + ---+-- + 4 /|\ 7 + /5|6\ + + If line segments lie along a coordinate axis, the octant is the lower of the two possible values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Methods for computing and working with of the Cartesian plane. + + + + + Returns the octant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + + + + + Returns the octant of a directed line segment from p0 to p1. + + + + + + + + Allows comparing arrays in an orientation-independent way. + + + + + Creates a new } + for the given array. + + + + + + Computes the canonical orientation for a coordinate array. + + + + true if the points are oriented forwards
+ or falseif the points are oriented in reverse. +
+
+ + + Compares two s for their relative order. + + + + -1 this one is smaller;
+ 0 the two objects are equal;
+ 1 this one is greater. +
+
+ + + + + + + + + + + + + Wraps a and transforms its input into the integer domain. + This is intended for use with Snap-Rounding noders, + which typically are only intended to work in the integer domain. + Offsets can be provided to increase the number of digits of available precision. + + Clients should be aware that rescaling can involve loss of precision, + which can cause zero-length line segments to be created. + These in turn can cause problems when used to build a planar graph. + This situation should be checked for and collapsed segments removed if necessary. + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an intersection point between two s. + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + -1 this SegmentNode is located before the argument location;
+ 0 this SegmentNode is at the argument location;
+ 1 this SegmentNode is located after the argument location. +
+
+ + + + + + + + + Gets the giving the location of this node. + + + + + + + + + + + A list of the s present along a noded . + + + + + Initializes a new instance of the class. + + The edge. + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + The SegmentIntersection found or added. + + + + Returns an iterator of SegmentNodes. + + An iterator of SegmentNodes. + + + + Adds nodes for the first and last points of the edge. + + + + + Adds nodes for any collapsed edge pairs. + Collapsed edge pairs can be caused by inserted nodes, or they can be + pre-existing in the edge vertex list. + In order to provide the correct fully noded semantics, + the vertex at the base of a collapsed pair must also be added as a node. + + + + + Adds nodes for any collapsed edge pairs + which are pre-existing in the vertex list. + + + + + + Adds nodes for any collapsed edge pairs caused by inserted nodes + Collapsed edge pairs occur when the same coordinate is inserted as a node + both before and after an existing edge vertex. + To provide the correct fully noded semantics, + the vertex must be added as a node as well. + + + + + + + + + + + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the provided argument list + (this is so a single list can be used to accumulate all split edges + for a set of s). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + Gets the list of coordinates for the fully noded segment string, + including all original segment string vertices and vertices + introduced by nodes in this list. + Repeated coordinates are collapsed. + + An array of s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not implemented. + + This method is not implemented. + + + + + + + + + + + + + + + + + + + + Implements a robust method of comparing the relative position of two points along the same segment. + The coordinates are assumed to lie "near" the segment. + This means that this algorithm will only return correct results + if the input coordinates have the same precision and correspond to rounded values + of exact coordinates lying on the segment. + + + + + Compares two s for their relative position along a segment + lying in the specified . + + + + + + -1 if node0 occurs first, or
+ 0 if the two nodes are equal, or
+ 1 if node1 occurs first. +
+
+ + + + + + + + + + + + + + + + + + + Represents a list of contiguous line segments, and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + s can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + Gets the s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A collection of NodedSegmentStrings representing the substrings + + + + Adds the noded s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A list which will collect the NodedSegmentStrings representing the substrings + + + + Creates a new segment string from a list of vertices. + + The vertices of the segment string. + The user-defined data of this segment string (may be null). + + + + + + + + + + + Gets the octant of the segment starting at vertex index. + + + The index of the vertex starting the segment. + Must not be the last index in the vertex list + + The octant of the segment at the vertex + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an for intersection intIndex. + An intersection that falls exactly on a vertex + of the is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + + + + + + + + Gets/Sets the user-defined data for this segment string. + + + + + + + + + + + + + + + + + + + + + + + + + + Dissolves a noded collection of s to produce + a set of merged linework with unique segments. + + + A custom merging strategy + can be supplied. + This strategy will be called when two identical (up to orientation) + strings are dissolved together. + The default merging strategy is simply to discard one of the merged strings. + + A common use for this class is to merge noded edges + while preserving topological labelling. + This requires a custom merging strategy to be supplied + to merge the topology labels appropriately. + + + + + + Creates a dissolver with a user-defined merge strategy. + + + + + + Creates a dissolver with the default merging strategy. + + + + + Dissolve all s in the input . + + + + + + + + + + + + + Dissolve the given . + + + + + + + + + Gets the collection of dissolved (i.e. unique) s + + + + + A merging strategy which can be used to update the context data of s + which are merged during the dissolve process. + + mbdavis + + + + Updates the context data of a + when an identical (up to orientation) one is found during dissolving. + + The segment string to update. + The segment string being dissolved. + + true if the strings are in the same direction, + false if they are opposite. + + + + + Nodes a set of s by + performing a brute-force comparison of every segment to every other one. + This has n^2 performance, so is too slow for use on large numbers of segments. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Nodes the linework in a list of s using Snap-Rounding + to a given . + + The input coordinates are expected to be rounded + to the given precision model. + This class does not perform that function. + GeometryPrecisionReducer" may be used to do this. + + This class does not dissolve the output linework, + so there may be duplicate linestrings in the output. + Subsequent processing (e.g. polygonization) may require + the linework to be unique. Using UnaryUnion is one way + to do this (although this is an inefficient approach). + + + + + Creates a new noder which snap-rounds to a grid specified by the given + + The precision model for the grid to snap-round to. + + + + Nodes the linework of a set of Geometrys using SnapRounding. + + A collection of Geometrys of any type + A list of LineStrings representing the noded linework of the input + + + + Gets or sets whether noding validity is checked after noding is performed. + + + + + Implements a "hot pixel" as used in the Snap Rounding algorithm. + A hot pixel contains the interior of the tolerance square and the boundary + minus the top and right segments. + The hot pixel operations are all computed in the integer domain + to avoid rounding problems. + + + + + Initializes a new instance of the class. + + The coordinate at the center of the hot pixel + The scale factor determining the pixel size + THe intersector to use for testing intersection with line segments + + + + Returns a "safe" envelope that is guaranteed to contain the hot pixel. + The envelope returned will be larger than the exact envelope of the pixel. + + An envelope which contains the pixel + + + + + + + + + + + + + + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + The first coordinate of the line segment to test + The second coordinate of the line segment to test + true if the line segment intersects this hot pixel. + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + + + + + + + + + + + + + + Tests whether the segment p0-p1 intersects the hot pixel tolerance square. + Because the tolerance square point set is partially open (along the + top and right) the test needs to be more sophisticated than + simply checking for any intersection. + However, it can take advantage of the fact that the hot pixel edges + do not lie on the coordinate grid. + It is sufficient to check if any of the following occur: + - a proper intersection between the segment and any hot pixel edge. + - an intersection between the segment and BOTH the left and bottom hot pixel edges + (which detects the case where the segment intersects the bottom left hot pixel corner). + - an intersection between a segment endpoint and the hot pixel coordinate. + + + + + + + + Test whether the given segment intersects + the closure of this hot pixel. + This is NOT the test used in the standard snap-rounding + algorithm, which uses the partially closed tolerance square instead. + This routine is provided for testing purposes only. + + + + + + + + Adds a new node (equal to the snap pt) to the specified segment + if the segment passes through the hot pixel + + + + true if a node was added to the segment + + + + Gets the coordinate this hot pixel is based at. + + + + + "Snaps" all s in a containing + s to a given . + + + + + Initializes a new instance of the class. + + + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + The edge containing the vertex, if applicable, or null. + + true if a node was added for this pixel. + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + true if a node was added for this pixel. + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + Uses Snap Rounding to compute a rounded, + fully noded arrangement from a set of s. + Implements the Snap Rounding technique described in + papers by Hobby, Guibas and Marimont, and Goodrich et al. + Snap Rounding assumes that all vertices lie on a uniform grid; + hence the precision model of the input must be fixed precision, + and all the input vertices must be rounded to that precision. + + This implementation uses a monotone chains and a spatial index to + speed up the intersection tests. + This implementation appears to be fully robust using an integer precision model. + It will function with non-integer precision models, but the + results are not 100% guaranteed to be correctly noded. + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + + Does NOT node the segStrings. + + + + A list of Coordinates for the intersections. + + + + Snaps segments to nodes created by segment intersections. + + + + + + Snaps segments to all vertices + + The list of segment strings to snap together + + + + Snaps segments to the vertices of a Segment String. + + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + A Collection of NodedSegmentStrings representing the substrings + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + A collection of NodedSegmentStrings + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + Does NOT node the segStrings. + + + + A list of s for the intersections. + + + + Computes nodes introduced as a result of snapping segments to snap points (hot pixels). + + + + + + + + + + + + + + Computes nodes introduced as a result of + snapping segments to vertices of other segments. + + The list of segment strings to snap together + + + + Performs a brute-force comparison of every segment in each . + This has n^2 performance. + + + + + + + Computes the boundary of a . + Allows specifying the to be used. + This operation will always return a of the appropriate + dimension for the boundary (even if the input geometry is empty). + The boundary of zero-dimensional geometries (Points) is + always the empty . + + Martin Davis + + + + A map which maintains the edges in sorted order around the node. + + + + + Stores an integer count, for use as a Map entry. + + Martin Davis + + + + Builds the buffer geometry for a given input geometry and precision model. + Allows setting the level of approximation for circular arcs, + and the precision model in which to carry out the computation. + + + When computing buffers in floating point double-precision + it can happen that the process of iterated noding can fail to converge (terminate). + In this case a will be thrown. + Retrying the computation in a fixed precision + can produce more robust results. + + + + Compute the change in depth as an edge is crossed from R to L + + + Creates a new BufferBuilder + + + + Inserted edges are checked to see if an identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + + + + Completes the building of the input subgraphs by depth-labelling them, + and adds them to the PolygonBuilder. + + + The subgraph list must be sorted in rightmost-coordinate order. + + the subgraphs to build + the PolygonBuilder which will build the final polygons + + + + Gets the standard result for an empty buffer. + Since buffer always returns a polygonal result, this is chosen to be an empty polygon. + + The empty result geometry + + + + Sets the precision model to use during the curve computation and noding, + if it is different to the precision model of the Geometry. + + + If the precision model is less than the precision of the Geometry precision model, + the Geometry must have previously been rounded to that precision. + + + + + Sets the to use during noding. + This allows choosing fast but non-robust noding, or slower + but robust noding. + + + + + Simplifies a buffer input line to remove concavities with shallow depth. + + + + The most important benefit of doing this + is to reduce the number of points and the complexity of + shape which will be buffered. + It also reduces the risk of gores created by + the quantized fillet arcs (although this issue + should be eliminated in any case by the + offset curve generation logic). + + + A key aspect of the simplification is that it + affects inside (concave or inward) corners only. + Convex (outward) corners are preserved, since they + are required to ensure that the generated buffer curve + lies at the correct distance from the input geometry. + + + Another important heuristic used is that the end segments + of the input are never simplified. This ensures that + the client buffer code is able to generate end caps faithfully. + + + No attempt is made to avoid self-intersections in the output. + This is acceptable for use for generating a buffer offset curve, + since the buffer algorithm is insensitive to invalid polygonal + geometry. However, + this means that this algorithm + cannot be used as a general-purpose polygon simplification technique. + + + Martin Davis + + + + Simplify the input coordinate list. + If the distance tolerance is positive, + concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, + concavities on the RIGHT side of the line are simplified. + + The coordinate list to simplify + simplification distance tolerance to use + The simplified coordinate list + + + + Simplify the input coordinate list. + + + If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. + + Simplification distance tolerance to use + + The simplified coordinates list + + + + + Uses a sliding window containing 3 vertices to detect shallow angles + in which the middle vertex can be deleted, since it does not + affect the shape of the resulting buffer in a significant way. + + + + + + Finds the next non-deleted index, or the end of the point array if none + + The start index to search from + The next non-deleted index, if any
+ or _inputLine.Length if there are no more non-deleted indices +
+
+ + + Checks for shallowness over a sample of points in the given section. + This helps to prevent the siplification from incrementally + "skipping" over points which are in fact non-shallow. + + A coordinate of section + A coordinate of section + The start index of section + The end index of section + The tolerated distance + + + + Computes the buffer of a geometry, for both positive and negative buffer distances. + + + + In GIS, the positive (or negative) buffer of a geometry is defined as + the Minkowski sum (or difference) of the geometry + with a circle of radius equal to the absolute value of the buffer distance. + In the CAD/CAM world buffers are known as offset curves. + In morphological analysis the + operation of positive and negative buffering + is referred to as erosion and dilation + + + The buffer operation always returns a polygonal result. + The negative or zero-distance buffer of lines and points is always an empty . + + + Since true buffer curves may contain circular arcs, + computed buffer polygons are only approximations to the true geometry. + The user can control the accuracy of the approximation by specifying + the number of linear segments used to approximate arcs. + This is specified via + or . + + + The of a linear buffer may be specified. + The following end cap styles are supported: +
    +
  • - the usual round end caps
  • +
  • - end caps are truncated flat at the line ends
  • +
  • - end caps are squared off at the buffer distance beyond the line ends
  • +
+
+ + The of the corners in a buffer may be specified. + The following join styles are supported: +
    +
  • - the usual round join
  • +
  • - corners are "sharp" (up to a distance limit})
  • +
  • - corners are beveled (clipped off)
  • +
+
+ + The buffer algorithm can perform simplification on the input to increase performance. + The simplification is performed a way that always increases the buffer area + (so that the simplified input covers the original input). + The degree of simplification can be specified with , + with a used otherwise. + Note that if the buffer distance is zero then so is the computed simplify tolerance, + no matter what the simplify factor. + +
+
+ + + A number of digits of precision which leaves some computational "headroom" + for floating point operations. + + + This value should be less than the decimal precision of double-precision values (16). + + + + + Compute a scale factor to limit the precision of + a given combination of Geometry and buffer distance. + The scale factor is determined by + the number of digits of precision in the (geometry + buffer distance), + limited by the supplied value. + + The scale factor is based on the absolute magnitude of the (geometry + buffer distance). + since this determines the number of digits of precision which must be handled. + + the Geometry being buffered + the buffer distance + the max # of digits that should be allowed by + the precision determined by the computed scale factor + + a scale factor for the buffer computation + + + + Computes the buffer of a geometry for a given buffer distance. + + the geometry to buffer + the buffer distance + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the buffer parameters to use + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the end cap style to use + the buffer of the input geometry + + + + Initializes a buffer computation for the given geometry + + the geometry to buffer + + + + Initializes a buffer computation for the given geometry + with the given set of parameters + + the geometry to buffer + the buffer parameters to use + + + + Returns the buffer computed for a geometry for a given buffer distance. + + the buffer distance + the buffer of the input geometry + + + + Specifies the end cap style of the generated buffer. + The styles supported are , , and . + The default is . + + + + + Sets the number of segments used to approximate a angle fillet + + + + + A value class containing the parameters which + specify how a buffer should be constructed. + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + Martin Davis + + + + The default number of facets into which to divide a fillet of 90 degrees. + A value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + + + + + The default mitre limit + Allows fairly pointy mitres. + + + + + The default simplify factor. + Provides an accuracy of about 1%, which matches + the accuracy of the parameter. + + + + + Creates a default set of parameters + + + + + Creates a set of parameters with the given quadrantSegments value. + + The number of quadrant segments to use + + + + Creates a set of parameters with the + given quadrantSegments and endCapStyle values. + + the number of quadrant segments to use + the end cap style to use + + + + Creates a set of parameters with the + given parameter values. + + the number of quadrant segments to use + the end cap style to use + the join style to use + the mitre limit to use + + + + Computes the maximum distance error due to a given level of approximation to a true arc. + + The number of segments used to approximate a quarter-circle + The error of approximation + + + + Gets/sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. + QuadrantSegments = 0joins are beveled + QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| + + For round joins, QuadrantSegments determines the maximum + error in the approximation to the true buffer curve. + The default value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + The error is always less than the buffer distance + (in other words, the computed buffer curve is always inside the true + curve). + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , + , and + . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), + and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + A connected subset of the graph of + DirectedEdges and Nodes. + Its edges will generate either + a single polygon in the complete buffer, with zero or more holes, or + one or more connected holes. + + + + + + + + + + Creates the subgraph consisting of all edges reachable from this node. + Finds the edges in the graph and the rightmost coordinate. + + A node to start the graph traversal from. + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + A node known to be in the subgraph. + + + + Adds the argument node and all its out edges to the subgraph + + The node to add. + The current set of nodes being traversed. + + + + + + + + + + + + + + + Compute depths for all dirEdges via breadth-first traversal of nodes in graph. + + Edge to start processing with. + + + + + + + + + + + + + + + + Find all edges whose depths indicates that they are in the result area(s). + Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + BufferSubgraphs are compared on the x-value of their rightmost Coordinate. + This defines a partial ordering on the graphs such that: + g1 >= g2 - Ring(g2) does not contain Ring(g1) + where Polygon(g) is the buffer polygon that is built from g. + This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to + be built before holes. + + + + + + + + + + + + + + + Gets the rightmost coordinate in the edges of the subgraph. + + + + + Computes the raw offset curve for a + single component (ring, line or point). + A raw offset curve line is not noded - + it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded + to a given . + + + + + This method handles single points as well as LineStrings. + LineStrings are assumed not to be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + The vertices of the line to offset + The offset distance + A Coordinate array representing the curve
+ or null if the curve is empty +
+
+ + + This method handles the degenerate cases of single points and lines, + as well as rings. + + A Coordinate array representing the curve
+ or null if the curve is empty
+
+ + + Computes the distance tolerance to use during input + line simplification. + + The buffer distance + The simplification tolerance + + + + Gets the buffer parameters being used to generate the curve. + + + + + Generates segments which form an offset curve. + Supports all end cap and join options + provided for buffering. + This algorithm implements various heuristics to + produce smoother, simpler curves which are + still within a reasonable tolerance of the + true curve. + + Martin Davis + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + The Closing Segment Length Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + Add last offset point + + + + + Adds the offset points for an outside (convex) turn + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point , terminating a line segment coming from + + + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments + around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. + Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc + between two specified angles. + The start and end point for the fillet are not added - + the caller must add them if required. + + Is -1 for a angle, 1 for a angle + The radius of the fillet + + + + Creates a circle around a point + + + + + Creates a square around a point + + + + + Gets whether the input has a narrow concave angle + (relative to the offset distance). + In this case the generated offset curve will contain self-intersections + and heuristic closing segments. + This is expected behaviour in the case of buffer curves. + For pure offset curves, + the output needs to be further treated + before it can be used. + + + + + A dynamic list of the vertices in a constructed offset curve. + Automatically removes adjacent vertices + which are closer than a given tolerance. + + Martin Davis + + + The distance below which two adjacent points on the curve + are considered to be coincident. + This is chosen to be a small fraction of the offset distance. + + + + Tests whether the given point is redundant + relative to the previous + point in the list (up to tolerance). + + + true if the point is redundant + + + + Computes the raw offset curve for a single component (ring, line or point). + + + A raw offset curve line is not noded - it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded to the required precision model. + + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + Use a value which results in a potential distance error which is + significantly less than the error due to + the quadrant segment discretization. + For QS = 8 a value of 100 is reasonable. + This should produce a maximum of 1% distance error. + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The Closing Segment Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + + This method handles single points as well as lines. + Lines are assumed to not be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + a List of Coordinate[] + + + + This method handles the degenerate cases of single points and lines, as well as rings. + + a List of Coordinate[] + + + Computes the distance tolerance to use during input + line simplification. + + @param distance the buffer distance + @return the simplification tolerance + + + + Adds the offset points for an outside (convex) turn + + + + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Add last offset point + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment () the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point p1, terminating a line segment coming from p0 + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + The base point + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + + + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc between two specified angles. + + + The start and end point for the fillet are not added - the caller must add them if required. + + The point around which to add the fillet points + The start angle (in radians) + The end angle (in radians) + Is -1 for a CW angle, 1 for a CCW angle + The radius of the fillet + + + + Adds a CW circle around a point + + + + + Adds a CW square around a point + + + + + Creates all the raw offset curves for a buffer of a Geometry. + Raw curves need to be noded together and polygonized to form the final buffer area. + + + + + + + + + + + + + Computes the set of raw offset curves for the buffer. + Each offset curve has an attached {Label} indicating + its left and right location. + + A Collection of SegmentStrings representing the raw buffer curves. + + + + Creates a {SegmentString} for a coordinate list which is a raw offset curve, + and adds it to the list of buffer curves. + The SegmentString is tagged with a Label giving the topology of the curve. + The curve may be oriented in either direction. + If the curve is oriented CW, the locations will be: + Left: Location.Exterior. + Right: Location.Interior. + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + + + + + + + + + + + + + Adds an offset curve for a polygon ring. + The side and left and right topological location arguments + assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged and the side flipped. + + The coordinates of the ring (must not contain repeated points). + The distance at which to create the buffer. + The side of the ring on which to construct the buffer line. + The location on the L side of the ring (if it is CW). + The location on the R side of the ring (if it is CW). + + + + The ringCoord is assumed to contain no repeated points. + It may be degenerate (i.e. contain only 1, 2, or 3 points). + In this case it has no area, and hence has a minimum diameter of 0. + + + + + + + + Tests whether a triangular ring would be eroded completely by the given + buffer distance. + This is a precise test. It uses the fact that the inner buffer of a + triangle converges on the inCentre of the triangle (the point + equidistant from all sides). If the buffer distance is greater than the + distance of the inCentre from a side, the triangle will be eroded completely. + This test is important, since it removes a problematic case where + the buffer distance is slightly larger than the inCentre distance. + In this case the triangle buffer curve "inverts" with incorrect topology, + producing an incorrect hole in the buffer. + + + + + + + + A list of the vertices in a constructed offset curve. + + Automatically removes close adjacent vertices. + Martin Davis + + + + Function to add a point + + + The point is only added if evaluates to false. + + The point to add. + + + + Tests whether the given point duplicates the previous point in the list (up to tolerance) + + The point to test + true if the point duplicates the previous point + + + + Automatically closes the ring (if it not alread is). + + + + + Gets/Sets the precision model to use when adding new points. + + + + + The distance below which two adjacent points on the curve are considered to be coincident. + + This is chosen to be a small fraction of the offset distance. + + + + Gets the Coordinates for the curve. + + + + + A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, + and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Locates a subgraph inside a set of subgraphs, + in order to determine the outside depth of the subgraph. + The input subgraphs are assumed to have had depths + already calculated for their edges. + + + + + + + + + + + + + + + + + + Finds all non-horizontal segments intersecting the stabbing line. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + A List of {DepthSegments} intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the list of dirEdges. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the input dirEdge. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + A segment from a directed edge which has been assigned a depth value + for its sides. + + + + + + + + + + + + Defines a comparison operation on DepthSegments + which orders them left to right. + Assumes the segments are normalized. + + The definition of ordering is: + + -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). + 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). + 0 : if the segments are identical + + + + Known Bugs: + + The logic does not obey the contract. + This is acceptable for the intended usage, but may cause problems if used with some + utilities in the .Net standard library (e.g. . + + + A DepthSegment + The comparison value + + + + Compare two collinear segments for left-most ordering. + If segs are vertical, use vertical ordering for comparison. + If segs are equal, return 0. + Segments are assumed to be directed so that the second coordinate is >= to the first + (e.g. up and to the right). + + A segment to compare. + A segment to compare. + + + + + + + + + + Finds the approximate maximum distance from a buffer curve to + the originating geometry. + + The approximate maximum distance is determined by testing + all vertices in the buffer curve, as well + as midpoints of the curve segments. + Due to the way buffer curves are constructed, this + should be a very close approximation. + This is similar to the Discrete Oriented Hausdorff distance + from the buffer curve to the input. + + mbdavis + + + + Validates that a given buffer curve lies an appropriate distance + from the input generating it. + + + Useful only for round buffers (cap and join). + Can be used for either positive or negative distances. + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + mbdavis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + + Checks that two geometries are at least a minumum distance apart. + + A geometry + A geometry + The minimum distance the geometries should be separated by + + + + Checks that the furthest distance from the buffer curve to the input + is less than the given maximum distance. + + + This uses the Oriented Hausdorff distance metric. It corresponds to finding + the point on the buffer curve which is furthest from some point on the input. + + A geometry + A geometry + The maximum distance that a buffer result can be from the input + + + + Gets a geometry which indicates the location and nature of a validation failure. + + The indicator is a line segment showing the location and size + of the distance discrepancy. + + + A geometric error indicator + or null, if no error was found + + + + Validates that the result of a buffer operation + is geometrically correct, within a computed tolerance. + + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + This test may be (much) more expensive than the original buffer computation. + + Martin Davis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + Checks whether the geometry buffer is valid, and returns an error message if not. + + + + + An appropriate error message
+ or nullif the buffer is valid
+ +
+ + + Gets the error message + + + + + Gets the error location + + + + + Gets a geometry which indicates the location and nature of a validation failure. + + If the failure is due to the buffer curve being too far or too close + to the input, the indicator is a line segment showing the location and size + of the discrepancy. + + + A geometric error indicator
+ or null, if no error was found
+
+ + + Computes the Euclidean distance (L2 metric) from a Point to a Geometry. + Also computes two points which are separated by the distance. + + + + + Contains a pair of points and the distance between them. + Provides methods to update with a new point pair with + either maximum or minimum distance. + + + + + Initializes the points, avoiding recomputing the distance. + + The first point + The second point + The distance between and + + + + A wrapper which + projects 3D coordinates into one of the + three Cartesian axis planes, + using the standard orthonormal projection + (i.e. simply selecting the appropriate ordinates into the XY ordinates). + The projected data is represented as 2D coordinates. + + Martin Davis + + + + Creates a wrapper projecting to the XY plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the XZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the YZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Find two points on two 3D s which lie within a given distance, + or else are the nearest points on the geometries (in which case this also + provides the distance between the geometries). + + 3D geometries have vertex Z ordinates defined. + 3D s are assumed to lie in a single plane (which is enforced if not actually the case). + 3D s and s may have any configuration. + + The distance computation also finds a pair of points in the input geometries + which have the minimum distance between them. If a point lies in the interior + of a line segment, the coordinate computed is a close approximation to the + exact point. + + The algorithms used are straightforward O(n^2) comparisons. This worst-case + performance could be improved on by using Voronoi techniques or spatial + indexes. + + 1.13 + + + + Compute the distance between the nearest points of two geometries. + + A geometry + A geometry + The distance between the geometries + + + + Test whether two geometries lie within a given distance of each other. + + A geometry + A geometry + The distance to test + true if g0.distance(g1) <= + + + + Compute the the nearest points of two geometries. The points are + presented in the same order as the input Geometries. + + A geometry + A geometry + The nearest points in the geometries + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + The distance on which to terminate the search + + + + Report the distance between the nearest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty
+ Thrown if either input geometry is null. +
+ + + Report the coordinates of the nearest points in the input geometries. The + points are presented in the same order as the input Geometries. + + A pair of s of the nearest points + + + + Gets the locations of the nearest points in the input geometries. The + locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points + + + + Finds the index of the "most polygonal" input geometry. + This optimizes the computation of the best-fit plane, + since it is cached only for the left-hand geometry. + + The index of the most polygonal geometry + + + + Convenience method to create a Plane3DPolygon + + + + + Computes distance between two polygons. + + + To compute the distance, compute the distance + between the rings of one polygon and the other polygon, + and vice-versa. + If the polygons intersect, then at least one ring must + intersect the other polygon. + Note that it is NOT sufficient to test only the shell rings. + A counter-example is a "figure-8" polygon A + and a simple polygon B at right angles to A, with the ring of B + passing through the holes of A. + The polygons intersect, + but A's shell does not intersect B, and B's shell does not intersect A. + + + Compute distance between a polygon and the rings of another. + + + Computes a point at a distance along a segment + specified by two relatively proportional values. + The fractional distance along the segment is d0/(d0+d1). + + @param p0 + start point of the segment + @param p1 + end point of the segment + @param d0 + proportional distance from start point to computed point + @param d1 + proportional distance from computed point to end point + @return the computed point + + + + Models a polygon lying in a plane in 3-dimensional Cartesian space. + The polygon representation is supplied + by a , + containing coordinates with XYZ ordinates. + 3D polygons are assumed to lie in a single plane. + The plane best fitting the polygon coordinates is + computed and is represented by a . + + Martin Davis + + + + Computes an average normal vector from a list of polygon coordinates. + Uses Newell's method, which is based + on the fact that the vector with components + equal to the areas of the projection of the polygon onto + the Cartesian axis planes is normal. + + @param seq the sequence of coordinates for the polygon + @return a normal vector + + + Computes a point which is the average of all coordinates + in a sequence. + If the sequence lies in a single plane, + the computed point also lies in the plane. + + @param seq a coordinate sequence + @return a Coordinate with averaged ordinates + + + + A ConnectedElementPointFilter extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list. The elements of the list are + com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + Returns a list containing a point from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. The elements of the list + are com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + + + + + + + + + + + + + Extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list + + + + + Returns a list containing a Coordinate from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. + + + + + + + + + + + + + + + + + Computes the distance and + closest points between two Geometrys. + The distance computation finds a pair of points in the input geometries + which have minimum distance between them. These points may + not be vertices of the geometries, but may lie in the interior of + a line segment. In this case the coordinate computed is a close + approximation to the exact point. + The algorithms used are straightforward O(n^2) + comparisons. This worst-case performance could be improved on + by using Voronoi techniques. + + + + + Compute the distance between the closest points of two geometries. + + A Geometry. + Another Geometry. + The distance between the geometries. + + + + Test whether two geometries lie within a given distance of each other. + + + + + + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + The distance on which to terminate the search. + + + + Report the distance between the closest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty.
+ if either input geometry is null +
+ + + Report the coordinates of the closest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the closest points. + + + + Report the locations of the closest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the closest points. + + + + Report the coordinates of the nearest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the nearest points. + + + + Report the locations of the nearest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points. + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes distance between facets (lines and points) of input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a sequence of facets (points or line segments) of a + specified by a subsequence of a . + + Martin Davis + + + + Creates a new section based on a CoordinateSequence. + + The sequence holding the points in the section + The index of the start point + The index of the end point + 1 + + + + Creates a new sequence for a single point from a CoordinateSequence. + + The sequence holding the points in the facet sequence + the index of the point + + + + Gets the coordinate at the given index + + The index + The coordinate at the given index + + + + Computes the distance to another facet sequence + + The other facet sequence + The distance between this and . + + + + Gets the envelope of this facet sequence + + + + + Gets the number of coordinates in this facet sequence + + + + + Tests if this facet sequence consists of only one point + + + + + Utility class to build facet sequencs STRtrees- + + + + + + + + + + + + Creates facet sequences from a given geometry + + The geometry + A list of s + + + + Represents the location of a point on a Geometry. + Maintains both the actual point location + (which may not be exact, if the point is not a vertex) + as well as information about the component + and segment index where the point occurs. + Locations inside area Geometrys will not have an associated segment index, + so in this case the segment index will have the sentinel value of . + + + + + A special value of segmentIndex used for locations inside area geometries. + These locations are not located on a segment, + and thus do not have an associated segment index. + + + + + Constructs a GeometryLocation specifying a point on a point, as well as the + segment that the point is on (or if the point is not on a segment). + + The component of the geometry containing the point + The segment index of the location, or + The coordinate of the location + + + + Constructs a GeometryLocation specifying a point inside an area point. + + The component of the geometry containing the point + The coordinate of the location + + + + Returns the geometry component on (or in) which this location occurs. + + + + + Returns the segment index for this location. If the location is inside an + area, the index will have the value . + + + + + Returns the of this location. + + + + + Tests whether this location represents a point inside an area geometry. + + + + + Computes the distance between the facets (segments and vertices) + of two s + using a Branch-and-Bound algorithm. + The Branch-and-Bound algorithm operates over a + traversal of R-trees built + on the target and possibly also the query geometries. + + This approach provides the following benefits: + + + Performance is improved due to the effects of the R-tree index + and the pruning due to the Branch-and-Bound approach + + The spatial index on the target geometry can be cached + to allow reuse in an incremental query situation. + + Using this technique can be much more performant + than using + when one or both input geometries are large, + or when evaluating many distance computations against + a single geometry. + + + This class is not thread-safe. + + Martin Davis + + + + + Computes the distance between two geometries using the indexed approach. + + + For geometries with many segments or points, + this can be faster than using a simple distance + algorithm. + + A geometry + A geometry + The distance between the two geometries + + + + Creates a new distance-finding instance for a given target . + + + + Distances will be computed to all facets of the input geometry. + The facets of the geometry are the discrete segments and points + contained in its components. + + In the case of and inputs, + this is equivalent to computing the conventional distance. + + In the case of inputs, this is equivalent + to computing the distance to the polygons boundaries. + + + A Geometry, which may be of any type. + + + + Computes the distance from the base geometry to the given geometry. + + The geometry to compute the distance to. + The computed distance + + + * Tests whether the base geometry lies within + * a specified distance of the given geometry. + * + //* @param g the geomtry to test + //* @param maximumDistance the maximum distance to test + //* @return true if the geometry lies with the specified distance + + + + The base class for operations that require s. + + + + + + + + + + The operation args into an array so they can be accessed by index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether a is simple. + In general, the SFS specification of simplicity + follows the rule: + + + A Geometry is simple if and only if the only self-intersections are at boundary points. + + + + + Simplicity is defined for each } subclass as follows: + + Valid geometries are simple by definition, so + IsSimple trivially returns true.
+ (Note: this means that IsSimple cannot be used to test + for (invalid) self-intersections in Polygons. + In order to check if a Polygonal geometry has self-intersections, + use ).
+ geometries are simple if and only if they do not self-intersect at interior points + (i.e. points other than boundary points). + This is equivalent to saying that no two linear components satisfy the SFS + predicate. + Zero-dimensional () geometries are simple if and only if they have no + repeated points. + Empty s are always simple by definition. +
+ For geometries the evaluation of simplicity + can be customized by supplying a + to define how boundary points are determined. + The default is the SFS-standard . + Note that under the Mod-2 rule, closed LineStrings (rings) + will never satisfy the touches predicate at their endpoints, since these are + interior points, not boundary points. + If it is required to test whether a set of LineStrings touch + only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. + For example, this can be used to validate that a set of lines form a topologically valid + linear network. +
+
+ + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + + + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + The geometry to test + + + + Creates a simplicity checker using a given + + The geometry to test + The rule to use + + + + Tests whether the geometry is simple. + + true if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + A MultiPoint is simple if it has no repeated points. + + + + + Computes simplicity for polygonal geometries. + Polygonal geometries are simple if and only if + all of their component rings are simple. + + A Polygonal geometry + true if the geometry is simple + + + Semantics for GeometryCollection is + simple iff all components are simple. + A GeometryCollection + true if the geometry is simple + + + + For all edges, check if there are any intersections which are NOT at an endpoint. + The Geometry is not simple if there are intersections not at endpoints. + + + + + + Tests that no edge intersection is the endpoint of a closed line. + This ensures that closed lines are not touched at their endpoint, + which is an interior point according to the Mod-2 rule + To check this we compute the degree of each endpoint. + The degree of endpoints of closed lines + must be exactly 2. + + + + + Add an endpoint to the map, creating an entry for it if none exists. + + + + + + + + Gets a coordinate for the location where the geometry fails to be simple. + (i.e. where it has a non-boundary self-intersection). + must be called before this location is accessed + + a coordinate for the location of the non-boundary self-intersection + or null if the geometry is simple + + + + + + + + + Creates an instance of this class + + The endpoint + + + + A sequence of LineMergeDirectedEdges forming one of the lines that will + be output by the line-merging process. + + + + + Constructs an EdgeString with the given factory used to convert this EdgeString + to a LineString. + + + + + + Adds a directed edge which is known to form part of this line. + + + + + + Converts this EdgeString into a LineString. + + + + + + + + + + A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. + + + + + Represents a directed edge in a PlanarGraph. A DirectedEdge may or + may not have a reference to a parent Edge (some applications of + planar graphs may not require explicit Edge objects to be created). Usually + a client using a PlanarGraph will subclass DirectedEdge + to add its own application-specific data and methods. + + + + + The base class for all graph component classes. + Maintains flags of use in generic graph algorithms. + Provides two flags: + marked - typically this is used to indicate a state that persists + for the course of the graph's lifetime. For instance, it can be + used to indicate that a component has been logically deleted from the graph. + visited - this is used to indicate that a component has been processed + or visited by an single graph algorithm. For instance, a breadth-first traversal of the + graph might use this to indicate that a node has already been traversed. + The visited flag may be set and cleared many times during the lifetime of a graph. + + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Finds the first + in a set + which has the specified state. + + A to scan. + The state to test. + The first found, or null if none found. + + + + Tests if a component has been visited during the course of a graph algorithm. + + + + + Gets/Sets the visited flag for this component. + + + + + Tests if a component has been marked at some point during the processing + involving this graph. + + + + + Gets/Sets the marked flag for this component. + + + + + Tests whether this component has been removed from its containing graph. + + + + + Gets or sets user defined data for this component + + + + + Returns a List containing the parent Edge (possibly null) for each of the given + DirectedEdges. + + + + + + + Constructs a DirectedEdge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Writes a detailed string representation of this DirectedEdge to the given PrintStream. + + + + + + Removes this directed edge from its containing graph. + + + + + Returns this DirectedEdge's parent Edge, or null if it has none. + Associates this DirectedEdge with an Edge (possibly null, indicating no associated + Edge). + + + + + Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's + orientation lies. + + + + + Returns a point to which an imaginary line is drawn from the from-node to + specify this DirectedEdge's orientation. + + + + + Returns whether the direction of the parent Edge (if any) is the same as that + of this Directed Edge. + + + + + Returns the node from which this DirectedEdge leaves. + + + + + Returns the node to which this DirectedEdge goes. + + + + + Returns the coordinate of the from-node. + + + + + Returns the angle that the start of this DirectedEdge makes with the + positive x-axis, in radians. + + + + + Returns the symmetric DirectedEdge -- the other DirectedEdge associated with + this DirectedEdge's parent Edge. + Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite + direction. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeDirectedEdge connecting the from node to the to node. + + + + + specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the directed edge that starts at this directed edge's end point, or null + if there are zero or multiple directed edges starting there. + + + + + An edge of a LineMergeGraph. The marked field indicates + whether this Edge has been logically deleted from the graph. + + + + + Represents an undirected edge of a {PlanarGraph}. An undirected edge + in fact simply acts as a central point of reference for two opposite + DirectedEdges. + Usually a client using a PlanarGraph will subclass Edge + to add its own application-specific data and methods. + + + + + The two DirectedEdges associated with this Edge. + + + + + Constructs an Edge whose DirectedEdges are not yet set. Be sure to call + SetDirectedEdges(DirectedEdge, DirectedEdge). + + + + + Constructs an Edge initialized with the given DirectedEdges, and for each + DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds + this Edge to its from-Node. + + + + + + + Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the + Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. + + + + + + + Returns one of the DirectedEdges associated with this Edge. + + 0 or 1. + + + + + Returns the DirectedEdge that starts from the given node, or null if the + node is not one of the two nodes associated with this Edge. + + + + + + + If node is one of the two nodes associated with this Edge, + returns the other node; otherwise returns null. + + + + + + + Removes this edge from its containing graph. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeEdge with vertices given by the specified LineString. + + + + + + Returns the LineString specifying the vertices of this edge. + + + + + A planar graph of edges that is analyzed to sew the edges together. The + marked flag on com.vividsolutions.planargraph.Edges + and com.vividsolutions.planargraph.Nodes indicates whether they have been + logically deleted from the graph. + + + + + Represents a directed graph which is embeddable in a planar surface. + This class and the other classes in this package serve as a framework for + building planar graphs for specific algorithms. This class must be + subclassed to expose appropriate methods to construct the graph. This allows + controlling the types of graph components ({DirectedEdge}s, + Edges and Nodes) which can be added to the graph. An + application which uses the graph framework will almost always provide + subclasses for one or more graph components, which hold application-specific + data and graph algorithms. + + + + + + + + + + + + + + + + + + + + Returns the at the given location, or null if no was there. + + The location + The node found
+ or null if this graph contains no node at the location +
+
+ + + Adds a node to the map, replacing any that is already at that location. + Only subclasses can add Nodes, to ensure Nodes are of the right type. + + + The added node. + + + + Adds the Edge and its DirectedEdges with this PlanarGraph. + Assumes that the Edge has already been created with its associated DirectEdges. + Only subclasses can add Edges, to ensure the edges added are of the right class. + + + + + + Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, + to ensure the edges added are of the right class. + + + + + + Returns an IEnumerator over the Nodes in this PlanarGraph. + + + + + + Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they + were added. + + + + + + Returns an Iterator over the Edges in this PlanarGraph, in the order in which they + were added. + + + + + + Removes an Edge and its associated DirectedEdges from their from-Nodes and + from this PlanarGraph. Note: This method does not remove the Nodes associated + with the Edge, even if the removal of the Edge reduces the degree of a + Node to zero. + + + + + + Removes a from its from- and from this PlanarGraph. + + + This method does not remove the s associated with the DirectedEdge, + even if the removal of the DirectedEdge reduces the degree of a Node to zero. + + + + + + Removes a node from the graph, along with any associated DirectedEdges and + Edges. + + + + + + Returns all Nodes with the given number of Edges around it. + + + + + + + Returns the Nodes in this PlanarGraph. + + + + + Returns the Edges that have been added to this PlanarGraph. + + + + + Adds an Edge, DirectedEdges, and Nodes for the given LineString representation + of an edge. + + + + + + + + + + + + Sews together a set of fully noded LineStrings. + + + Sewing stops at nodes of degree 1 + or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, + in which case a node is simply chosen as a starting point. The direction of each + merged LineString will be that of the majority of the LineStrings from which it + was derived. + + Any dimension of Geometry is handled -- the constituent linework is extracted to + form the edges. The edges must be correctly noded; that is, they must only meet + at their endpoints. The LineMerger will still run on incorrectly noded input + but will not form polygons from incorrected noded edges. + + NOTE:once merging has been performed, no more + + + + + Adds a Geometry to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the LineStrings built by the merging process. + + + + + + + + + + + + + + + + + + + + + + + + Builds a sequence from a set of s, + so that they are ordered end to end. + A sequence is a complete non-repeating list of the linear + components of the input. Each linestring is oriented + so that identical endpoints are adjacent in the list. + + + The input linestrings may form one or more connected sets. + The input linestrings should be correctly noded, or the results may + not be what is expected. + The output of this method is a single , + containing the ordered linestrings in the sequence. + + + The sequencing employs the classic 'Eulerian path' graph algorithm. + Since Eulerian paths are not uniquely determined, further rules are used to + make the computed sequence preserve as much as possible of the input ordering. + Within a connected subset of lines, the ordering rules are: + - If there is degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If there is a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + + + Not all arrangements of lines can be sequenced. + For a connected set of edges in a graph, + Euler's Theorem states that there is a sequence containing each edge once + if and only if there are no more than 2 nodes of odd degree. + If it is not possible to find a sequence, the + property will return false. + + + + + + Tests whether a is sequenced correctly. + s are trivially sequenced. + s are checked for correct sequencing. + Otherwise, IsSequenced is defined + to be true for geometries that are not lineal. + + The to test. + + true if the is sequenced or is not lineal. + + + + + Adds a of s to be sequenced. + May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be extracted. + + A of geometries to add. + + + + Adds a to be sequenced. + May be called multiple times. + Any dimension of may be added; + the constituent linework will be extracted. + + + + + + Tests whether the arrangement of linestrings has a valid sequence. + + true if a valid sequence exists. + + + + Returns the or + built by the sequencing process, if one exists. + + The sequenced linestrings, + or null if a valid sequence does not exist. + + + + Tests whether a complete unique path exists in a graph + using Euler's Theorem. + + The containing the edges. + true if a sequence exists. + + + + Finds an for an unvisited edge (if any), + choosing the which preserves orientation, if possible. + + The to examine. + + The found, + or null if none were unvisited. + + + + + Computes a version of the sequence which is optimally + oriented relative to the underlying geometry. + + Heuristics used are: + - If the path has a degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If the path has a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + (NOTE: in this case could orient the sequence according to the majority of the + linestring orientations). + + + A of s. + + A of s oriented appropriately. + + + + + Reverse the sequence. + This requires reversing the order of the s, + and flipping each as well. + + + A enumeration of s, + in sequential order. + + The reversed sequence. + + + + Builds a geometry ( or ) + representing the sequence. + + + An enumeration of s of s + with s as their parent edges. + + + The sequenced geometry, or null if no sequence exists. + + + + + A private implementation for + + + + + Initializes a new instance of the class. + + The sequencer. + + + + Performs an operation with or on + + + A to which the filter is applied. + + + + + Nodes a set of edges. + Takes one or more sets of edges and constructs a + new set of edges consisting of all the split edges created by + noding the input edges together. + + + + + + + + + + + + + + + + + + + + + + Forms NTS LineStrings out of a the graph of DirectedEdges + created by an OverlayOp. + + + + + + + + + + + + + + + + + A list of the LineStrings in the result of the specified overlay operation. + + + + + Find and mark L edges which are "covered" by the result area (if any). + L edges at nodes which also have A edges can be checked by checking + their depth at that node. + L edges at nodes which do not have A edges can be checked by doing a + point-in-polygon test with the previously computed result areas. + + + + + + + + + + + + + + + + + + + Collect edges from Area inputs which should be in the result but + which have not been included in a result area. + This happens ONLY: + during an intersection when the boundaries of two + areas touch in a line segment + OR as a result of a dimensional collapse. + + + + + + + + + + + + + + + + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A ring of edges which may contain nodes of degree > 2. + A MaximalEdgeRing may represent two different spatial entities: + a single polygon possibly containing inversions (if the ring is oriented CW) + a single hole possibly containing exversions (if the ring is oriented CCW) + If the MaximalEdgeRing represents a polygon, + the interior of the polygon is strongly connected. + These are the form of rings used to define polygons under some spatial data models. + However, under the OGC SFS model, MinimalEdgeRings are required. + A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the + BuildMinimalRings() method. + + + + + + + + + + + + + + + + + + + + + + + + + + For all nodes in this EdgeRing, + link the DirectedEdges at the node to form minimalEdgeRings + + + + + + + + + + + A ring of edges with the property that no node + has degree greater than 2. These are the form of rings required + to represent polygons under the OGC SFS spatial data model. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates nodes for use in the PlanarGraphs constructed during + overlay operations. + + + + + + + + + + + + The spatial functions supported by this class. + These operations implement various bool combinations of the resultants of the overlay. + + + + + The code for the Intersection overlay operation + + + + + The code for the Union overlay operation + + + + + The code for the Difference overlay operation + + + + + The code for the Symmetric Difference overlay operation + + + + + Computes the geometric overlay of two s. The overlay + can be used to determine any bool combination of the geometries. + + + + + Computes an overlay operation + for the given geometry arguments. + + The first geometry argument + The second geometry argument + The code for the desired overlay operation + The result of the overlay operation + Thrown if a robustness problem is encountered. + + + + Tests whether a point with a given topological + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + The topological label of the point + The code for the overlay operation to test + true if the label locations correspond to the overlayOpCode + + + + Tests whether a point with given s + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + the code for the location in the first geometry + the code for the location in the second geometry + the code for the overlay operation to test + true if the locations correspond to the overlayOpCode. + + + + Constructs an instance to compute a single overlay operation + for the given geometries. + + The first geometry argument + The second geometry argument + + + + Gets the result of the overlay for a given overlay operation. + + Note: this method can be called once only. + + The code of the overlay operation to perform + The computed result geometry + Thrown if a robustness problem is encountered + + + + Insert an edge from one of the noded input graphs. + Checks edges that are inserted to see if an + identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + The edge to insert + + + + Update the labels for edges according to their depths. + For each edge, the depths are first normalized. + Then, if the depths for the edge are equal, + this edge must have collapsed into a line edge. + If the depths are not equal, update the label + with the locations corresponding to the depths + (i.e. a depth of 0 corresponds to a Location of Exterior, + a depth of 1 corresponds to Interior) + + + + + If edges which have undergone dimensional collapse are found, + replace them with a new edge which is a L edge + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a previously computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Compute initial labelling for all DirectedEdges at each node. + In this step, DirectedEdges will acquire a complete labelling + (i.e. one with labels for both Geometries) + only if they + are incident on a node which has edges for both Geometries + + + + + For nodes which have edges from only one Geometry incident on them, + the previous step will have left their dirEdges with no labelling for the other + Geometry. However, the sym dirEdge may have a labelling for the other + Geometry, so merge the two labels. + + + + + Incomplete nodes are nodes whose labels are incomplete. + (e.g. the location for one Geometry is null). + These are either isolated nodes, + or nodes which have edges from only a single Geometry incident on them. + Isolated nodes are found because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + When each node labelling is completed, the labelling of the incident + edges is updated, to complete their labelling as well. + + + + + Label an isolated node with its relationship to the target point. + + + + + Find all edges whose label indicates that they are in the result area(s), + according to the operation being performed. Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + If both a dirEdge and its sym are marked as being in the result, cancel + them out. + + + + + Tests if a point node should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Line or Area geometry. + + + + Tests if an L edge should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Area geometry. + + + + true if the coord is located in the interior or boundary of + a point in the list. + + + + + Creates an empty result geometry of the appropriate dimension, + based on the given overlay operation and the dimensions of the inputs. + The created geometry is always an atomic geometry, + not a collection. + + The empty result is constructed using the following rules: + + - result has the dimension of the lowest input dimension + - result has the dimension of the highest input dimension + - result has the dimension of the left-hand input + - result has the dimension of the highest input dimension + (since symDifference is the union of the differences). + + + The overlay operation being performed + An input geometry + An input geometry + The geometry factory being used for the operation + An empty atomic geometry of the appropriate dimension + + + + Disable + when an intersection is made (), + so performances are dramatically improved but failures are not managed. + + + Use ay your own risk! + + + + + Gets the graph constructed to compute the overlay. + + + + + Constructs Points from the nodes of an overlay graph. + + + + + + + + + + + + + + + + + A list of the Points in the result of the specified overlay operation. + + + + + + + + + + + + This method simplifies the resultant Geometry by finding and eliminating + "covered" points. + A point is covered if it is contained in another element Geometry + with higher dimension (e.g. a point might be contained in a polygon, + in which case the point can be eliminated from the resultant). + + + + + + + Forms Polygons out of a graph of {DirectedEdge}s. + The edges to use are marked as being in the result Area. + + + + + + + + + + + Add a complete graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + Add a set of edges and nodes, which form a graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + + For all DirectedEdges in result, form them into MaximalEdgeRings. + + + + + + + + + + + + + + + + This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, + and tests whether they form a Polygon. This is the case if there is a single shell + in the list. In this case the shell is returned. + The other possibility is that they are a series of connected holes, in which case + no shell is returned. + + The shell EdgeRing, if there is one
or + null, if all the rings are holes.
+
+ + + This method assigns the holes for a Polygon (formed from a list of + MinimalEdgeRings) to its shell. + Determining the holes for a MinimalEdgeRing polygon serves two purposes: + it is faster than using a point-in-polygon check later on. + it ensures correctness, since if the PIP test was used the point + chosen might lie on the shell, which might return an incorrect result from the + PIP test. + + + + + + + For all rings in the input list, + determine whether the ring is a shell or a hole + and add it to the appropriate list. + Due to the way the DirectedEdges were linked, + a ring is a shell if it is oriented CW, a hole otherwise. + + + + + + + + This method determines finds a containing shell for all holes + which have not yet been assigned to a shell. + These "free" holes should + all be properly contained in their parent shells, so it is safe to use the + findEdgeRingContaining method. + (This is the case because any holes which are NOT + properly contained (i.e. are connected to their + parent shell) would have formed part of a MaximalEdgeRing + and been handled in a previous step). + + + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
or + null if no containing EdgeRing is found.
+
+ + + + + + + + + + Checks the current set of shells (with their associated holes) to + see if any of them contain the point. + + + + + + + + + + + + Snaps the vertices and segments of a + to another Geometry's vertices. + A snap distance tolerance is used to control where snapping is performed. + Snapping one geometry to another can improve + robustness for overlay operations by eliminating + nearly-coincident edges + (which cause problems during noding and intersection calculation). + It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. + Too much snapping can result in invalid topology + beging created, so the number and location of snapped vertices + is decided using heuristics to determine when it + is safe to snap. + This can result in some potential snaps being omitted, however. + + Martin Davis + + + + Estimates the snap tolerance for a Geometry, taking into account its precision model. + + + The estimated snap tolerance + + + + + + + + + + + + + + + + + + + Snaps two geometries together with a given tolerance. + + + + + + + + + Snaps a geometry to itself. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. + + the geometry to snap + the snapping tolerance + whether the result should be made valid + a new snapped + + + + Creates a new snapper acting on the given geometry + + the geometry to snap + + + + Snaps the vertices in the component s + of the source geometry to the vertices of the given snap geometry. + + a geometry to snap the source to + + a new snapped Geometry + + + Snaps the vertices in the component s + of the source geometry to the vertices of the same geometry. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + The snapping tolerance + Whether the result should be made valid + The geometry snapped to itself + + + + + + + + + + + Computes the snap tolerance based on the input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snaps the vertices and segments of a + to a set of target snap vertices. + A snap distance tolerance is used to control where snapping is performed. + The implementation handles empty geometry and empty snap vertex sets. + + + + + Creates a new snapper using the points in the given + as target snap points. + + A LineString to snap (may be empty) + the snap tolerance to use + + + + Creates a new snapper using the given points + as source points to be snapped. + + + + + + + Snaps the vertices and segments of the source LineString + to the given set of snap points. + + the vertices to snap to + list of the snapped points + + + + Snap source vertices to vertices in the target. + + the points to snap + the points to snap to + + + + + + + + + + + + Snap segments of the source to nearby snap vertices. + Source segments are "cracked" at a snap vertex. + A single input segment may be snapped several times + to different snap vertices. + For each distinct snap vertex, at most one source segment + is snapped to. This prevents "cracking" multiple segments + at the same point, which would likely cause + topology collapse when being used on polygonal linework. + + The coordinates of the source linestring to snap + The target snap vertices + + + + Finds a src segment which snaps to (is close to) the given snap point + Only a single segment is selected for snapping. + This prevents multiple segments snapping to the same snap vertex, + which would almost certainly cause invalid geometry + to be created. + (The heuristic approach of snapping used here + is really only appropriate when + snap pts snap to a unique spot on the src geometry) + Also, if the snap vertex occurs as a vertex in the src coordinate list, + no snapping is performed. + + The point to snap to + The source segment coordinates + The index of the snapped segment
+ or -1 if no segment snaps to the snap point.
+
+ + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class only uses snapping + if an error is detected when running the standard JTS overlay code. + Errors detected include thrown exceptions + (in particular, ) + and invalid overlay computations. + + + + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class always uses snapping. + This is less performant than the standard JTS overlay code, + and may even introduce errors which were not present in the original data. + For this reason, this class should only be used + if the standard overlay code fails to produce a correct result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds the most likely of a point relative to + the polygonal components of a geometry, using a tolerance value. + + + If a point is not clearly in the Interior or Exterior, + it is considered to be on the Boundary. + In other words, if the point is within the tolerance of the Boundary, + it is considered to be on the Boundary; otherwise, + whether it is Interior or Exterior is determined directly. + + Martin Davis + + + + Extracts linework for polygonal components. + + The geometry from which to extract + A lineal geometry containing the extracted linework + + + + Extracts the LineStrings in the boundaries of all the polygonal elements in the target . + + Martin Davis + + + + Filters out all linework for polygonal elements + + + + + Gets the list of polygonal linework. + + + + + Generates points offset by a given distance from both sides of the midpoint of all segments in a . + + + + Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. + + + The input geometry may have any orientation for its rings, + but is + only meaningful if the orientation is known. + + + Martin Davis + + + Set the sides on which to generate offset points. + + @param doLeft + @param doRight + + + + Gets the computed offset points. + + + + + Generates the two points which are offset from the + midpoint of the segment (p0, p1) by the offsetDistance + + The first point of the segment to offset from. + The second point of the segment to offset from + + + + + + Validates that the result of an overlay operation is geometrically correct within a determined tolerance. + Uses fuzzy point location to find points which are + definitely in either the interior or exterior of the result + geometry, and compares these results with the expected ones. + + + This algorithm is only useful where the inputs are polygonal. + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + Martin Davis + + + + + Represents a ring of PolygonizeDirectedEdges which form + a ring of a polygon. The ring may be either an outer shell or a hole. + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
+ or null if no containing EdgeRing is found.
+
+ + + Finds a point in a list of points which is not contained in another list of points. + + The Coordinates to test. + An array of Coordinates to test the input points against. + A Coordinate from testPts which is not in pts,
+ or null.
+
+ + + Tests whether a given point is in an array of points. + Uses a value-based test. + + A Coordinate for the test point. + An array of Coordinates to test, + true if the point is in the array. + + + Traverses a ring of DirectedEdges, accumulating them into a list. + This assumes that all dangling directed edges have been removed + from the graph, so that there is always a next dirEdge. + + @param startDE the DirectedEdge to start traversing at + @return a List of DirectedEdges that form a ring + + + + + + + + + + Adds a DirectedEdge which is known to form part of this ring. + + The DirectedEdge to add. + + + + Computes whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + + + + Adds a hole to the polygon formed by this ring. + + The LinearRing forming the hole. + + + + Adds a hole to the polygon formed by this ring. + + the forming the hole. + + + + + + + + + + + + Updates the included status for currently non-included shells + based on whether they are adjacent to an included shell. + + + + + Gets a string representation of this object. + + + + + Tests whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + true if this ring is a hole. + + + + Computes and returns the Polygon formed by this ring and any contained holes. + + + + + Tests if the ring formed by this edge ring is topologically valid. + + true if the ring is valid. + + + + Computes and returns the list of coordinates which are contained in this ring. + The coordinatea are computed once only and cached. + + + + + Gets the coordinates for this ring as a LineString. + Used to return the coordinates in this ring + as a valid point, when it has been detected that the ring is topologically + invalid. + + + + + Returns this ring as a LinearRing, or null if an Exception occurs while + creating it (such as a topology problem). Details of problems are written to + standard output. + + + + + Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. + + + + + Gets a value indicating whether this ring has a shell assigned to it. + + + + + Tests whether this ring is an outer hole. + A hole is an outer hole if it is not contained by a shell. + + + + + Tests whether this ring is an outer shell. + + + + + Gets or sets a value indicating whether this ring has been processed. + + + + + Compares EdgeRings based on their envelope, + using the standard lexicographic ordering. + This ordering is sufficient to make edge ring sorting deterministic. + + mbdavis + + + + A DirectedEdge of a PolygonizeGraph, which represents + an edge of a polygon formed by the graph. + May be logically deleted from the graph by setting the marked flag. + + + + + Constructs a directed edge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the identifier attached to this directed edge. + Attaches an identifier to this directed edge. + + + + + Returns the next directed edge in the EdgeRing that this directed edge is a member of. + Sets the next directed edge in the EdgeRing that this directed edge is a member of. + + + + + Returns the ring of directed edges that this directed edge is + a member of, or null if the ring has not been set. + + + + + Gets/Sets the ring of directed edges that this directed edge is + a member of. + + + + + An edge of a polygonization graph. + + + + + + + + + + + + + + + + Represents a planar graph of edges that can be used to compute a + polygonization, and implements the algorithms to compute the + EdgeRings formed by the graph. + The marked flag on DirectedEdges is used to indicate that a directed edge + has be logically deleted from the graph. + + + + + + + + + + + + + + + + + + + + Deletes all edges at a node. + + + + + + Create a new polygonization graph. + + + + + + Add a LineString forming an edge of the polygon graph. + + The line to add. + + + + + + + + + + + + + + + + Convert the maximal edge rings found by the initial graph traversal + into the minimal edge rings required by NTS polygon topology rules. + + The list of start edges for the edgeRings to convert. + + + + Finds all nodes in a maximal edgering which are self-intersection nodes + + + + + The list of intersection nodes found, + or null if no intersection nodes were found. + + + + + Computes the minimal EdgeRings formed by the edges in this graph. + + A list of the{EdgeRings found by the polygonization process. + + + + Finds and labels all edgerings in the graph. + The edge rings are labeling with unique integers. + The labeling allows detecting cut edges. + + A List of the DirectedEdges in the graph. + A List of DirectedEdges, one for each edge ring found. + + + + Finds and removes all cut edges from the graph. + + A list of the LineStrings forming the removed cut edges. + + + + + + + + + + + + + + + + + Computes the next edge pointers going CCW around the given node, for the + given edgering label. + This algorithm has the effect of converting maximal edgerings into minimal edgerings + + + + + + + + + + + + + + Marks all edges from the graph which are "dangles". + Dangles are which are incident on a node with degree 1. + This process is recursive, since removing a dangling edge + may result in another edge becoming a dangle. + In order to handle large recursion depths efficiently, + an explicit recursion stack is used. + + A List containing the s that formed dangles. + + + + Traverses the polygonized edge rings in the graph + and computes the depth parity (odd or even) + relative to the exterior of the graph. + + If the client has requested that the output + be polygonally valid, only odd polygons will be constructed. + + + + + Traverses all connected edges, computing the depth parity of the associated polygons. + + + + + + Polygonizes a set of s which contain linework that + represents the edges of a planar graph. + + + All types of Geometry are accepted as input; + the constituent linework is extracted as the edges to be polygonized. + The processed edges must be correctly noded; that is, they must only meet + at their endpoints. Polygonization will accept incorrectly noded input + but will not form polygons from non-noded edges, + and reports them as errors. + + The Polygonizer reports the follow kinds of errors: + Dangles - edges which have one or both ends which are not incident on another edge endpoint + Cut Edges - edges which are connected at both ends but which do not form part of polygon + Invalid Ring Lines - edges which form rings which are invalid + (e.g. the component lines contain a self-intersection). + + Polygonization supports extracting only polygons which form a valid polygonal geometry. + The set of extracted polygons is guaranteed to be edge-disjoint. + This is useful for situations where it is known that the input lines form a + valid polygonal geometry. + + + + + + The default polygonizer output behavior + + + + + Default linestring adder. + + + + + Creates a polygonizer with the same + as the input Geometrys. + The output mask is + + + + + + Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. + + true if only polygons which form a valid polygonal geometry are to be extracted + + + + Adds a collection of s to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used. + + A list of Geometrys with linework to be polygonized. + + + + Adds a to the linework to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used + + A Geometry with linework to be polygonized. + + + + Adds a to the graph of polygon edges. + + The to add. + + + + Gets the list of polygons formed by the polygonization. + + + + + Gets a geometry representing the polygons formed by the polygonization. + If a valid polygonal geometry was extracted the result is a geometry. + + A geometry containing the polygons + + + + Gets the list of dangling lines found during polygonization. + + + + + Gets the list of cut edges found during polygonization. + + + + + Gets the list of lines forming invalid rings found during polygonization. + + + + + Performs the polygonization, if it has not already been carried out. + + + + + For each outer hole finds and includes a single outer shell. + This seeds the travesal algorithm for finding only polygonal shells. + + The list of shell EdgeRings + + + + Allows disabling the valid ring checking, + to optimize situations where invalid rings are not expected. + + The default is true + + + + Adds every linear element in a into the polygonizer graph. + + + + + Filters all geometry instances + + The geometry instance + + + + Optimized implementation of spatial predicate "contains" + for cases where the first Geometry is a rectangle. + As a further optimization, + this class can be used directly to test many geometries against a single rectangle. + + + + + + + + + + + + + Create a new contains computer for two geometries. + + A rectangular geometry. + + + + + + + + + + + + + + + + + + + + + + + + + Tests if a point is contained in the boundary of the target rectangle. + + the point to test + true if the point is contained in the boundary + + + + Tests if a linestring is completely contained in the boundary of the target rectangle. + + the linestring to test + true if the linestring is contained in the boundary + + + + Tests if a line segment is contained in the boundary of the target rectangle. + + an endpoint of the segment + an endpoint of the segment + true if the line segment is contained in the boundary + + + I + Implementation of the Intersects spatial predicate + optimized for the case where one is a rectangle. + + + This class works for all input geometries, including s. + + As a further optimization, this class can be used in batch style + to test many geometries against a single rectangle. + + + + + Crossover size at which brute-force intersection scanning + is slower than indexed intersection detection. + Must be determined empirically. Should err on the + safe side by making value smaller rather than larger. + + + + + Tests whether a rectangle intersects a given geometry. + + A rectangular polygon + A geometry of any kind + true if the geometries intersect. + + + + Create a new intersects computer for a rectangle. + + A rectangular polygon. + + + + Tests whether the given Geometry intersects the query rectangle. + + The Geometry to test (may be of any type) + true if an intersection must occur + or false if no conclusion about intersection can be made + + + + Tests whether it can be concluded that a rectangle intersects a geometry, + based on the relationship of the envelope(s) of the geometry. + + Martin Davis + + + + Creates an instance of this class using the provided Envelope + + The query envelope + + + + + + + + + + + + + + + + Reports whether it can be concluded that an intersection occurs, + or whether further testing is required. + + true if an intersection must occur
+ or false if no conclusion about intersection can be made
+
+ + + A visitor which tests whether it can be + concluded that a geometry contains a vertex of + a query geometry. + + Martin Davis + + + + + + + + + + + + + + + + + + + + + + Gets a value indicating whether it can be concluded that a corner point of the rectangle is + contained in the geometry, or whether further testing is required. + + true if a corner point is contained + or false if no conclusion about intersection can be made + + + + + A visitor to test for intersection between the query rectangle and the line segments of the geometry. + + Martin Davis + + + + Creates a visitor for checking rectangle intersection with segments + + the query rectangle + + + Reports whether any segment intersection exists. + true if a segment intersection exists or + false if no segment intersection exists + + + + Tests if any line segments in two sets of intersect. + Optimized for use when at least one input is of small size. + Short-circuited to return as soon an intersection is found. + + + + + + + + + + + + + + + + + + + + + An EdgeEndBuilder creates EdgeEnds for all the "split edges" + created by the intersections determined for an Edge. + Computes the EdgeEnds which arise from a noded Edge. + + + + + + + + + + + + Creates stub edges for all the intersections in this + Edge (if any) and inserts them into the graph. + + + + + + + Create a EdgeStub for the edge before the intersection eiCurr. + The previous intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the previous point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiPrev may be null. + + + + + + + + + Create a StubEdge for the edge after the intersection eiCurr. + The next intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the next point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiNext may be null. + + + + + + + + + A collection of EdgeStubs which obey the following invariant: + They originate at the same node and have the same direction. + Contains all EdgeEnds which start at the same point and are parallel. + + + + + + + + + + + + + + + + + + + + + + + + This computes the overall edge label for the set of + edges in this EdgeStubBundle. It essentially merges + the ON and side labels for each edge. + These labels must be compatible + + + + + + Compute the overall ON location for the list of EdgeStubs. + (This is essentially equivalent to computing the self-overlay of a single Geometry) + edgeStubs can be either on the boundary (eg Polygon edge) + OR in the interior (e.g. segment of a LineString) + of their parent Geometry. + In addition, GeometryCollections use the to determine + whether a segment is on the boundary or not. + Finally, in GeometryCollections it can occur that an edge is both + on the boundary and in the interior (e.g. a LineString segment lying on + top of a Polygon edge.) In this case the Boundary is given precendence. + These observations result in the following rules for computing the ON location: + if there are an odd number of Bdy edges, the attribute is Bdy + if there are an even number >= 2 of Bdy edges, the attribute is Int + if there are any Int edges, the attribute is Int + otherwise, the attribute is Null. + + + + + + + Compute the labelling for each side + + + + + + To compute the summary label for a side, the algorithm is: + FOR all edges + IF any edge's location is Interior for the side, side location = Interior + ELSE IF there is at least one Exterior attribute, side location = Exterior + ELSE side location = Null + Note that it is possible for two sides to have apparently contradictory information + i.e. one edge side may indicate that it is in the interior of a point, while + another edge side may indicate the exterior of the same point. This is + not an incompatibility - GeometryCollections may contain two Polygons that touch + along an edge. This is the reason for Interior-primacy rule above - it + results in the summary label having the Geometry interior on both sides. + + + + + + + Update the IM with the contribution for the computed label for the EdgeStubs. + + + + + + + + + + + + + + + + + An ordered list of EdgeEndBundles around a RelateNode. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + Insert a EdgeEnd in order in the list. + If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is + added to the bundle. Otherwise, a new EdgeEndBundle is created + to contain the EdgeEnd. + + + + + + Update the IM with the contribution for the EdgeStubs around the node. + + + + + + Computes the topological relationship between two Geometries. + RelateComputer does not need to build a complete graph structure to compute + the IntersectionMatrix. The relationship between the geometries can + be computed by simply examining the labelling of edges incident on each node. + RelateComputer does not currently support arbitrary GeometryCollections. + This is because GeometryCollections can contain overlapping Polygons. + In order to correct compute relate on overlapping Polygons, they + would first need to be noded and merged (if not explicitly, at least + implicitly). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + For all intersections on the edges of a Geometry, + label the corresponding node IF it doesn't already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + If the Geometries are disjoint, we need to enter their dimension and + boundary dimension in the Ext rows in the IM + + + + + + + + + + + Update the IM with the sum of the IMs for each component. + + + + + + Processes isolated edges by computing their labelling and adding them + to the isolated edges list. + Isolated edges are guaranteed not to touch the boundary of the target (since if they + did, they would have caused an intersection to be computed and hence would + not be isolated). + + + + + + + Label an isolated edge of a graph with its relationship to the target point. + If the target has dim 2 or 1, the edge can either be in the interior or the exterior. + If the target has dim 0, the edge must be in the exterior. + + + + + + + + Isolated nodes are nodes whose labels are incomplete + (e.g. the location for one Geometry is null). + This is the case because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A RelateNode is a Node that maintains a list of EdgeStubs + for the edges that are incident on it. + + + + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + Update the IM with the contribution for the EdgeEnds incident on this node. + + + + + + Used by the NodeMap in a RelateNodeGraph to create RelateNodes. + + + + + + + + + + + + Implements the simple graph of Nodes and EdgeEnd which is all that is + required to determine topological relationships between Geometries. + Also supports building a topological graph of a single Geometry, to + allow verification of valid topology. + It is not necessary to create a fully linked + PlanarGraph to determine relationships, since it is sufficient + to know how the Geometries interact locally around the nodes. + In fact, this is not even feasible, since it is not possible to compute + exact intersection points, and hence the topology around those nodes + cannot be computed robustly. + The only Nodes that are created are for improper intersections; + that is, nodes which occur at existing vertices of the Geometries. + Proper intersections (e.g. ones which occur between the interior of line segments) + have their topology determined implicitly, without creating a Node object + to represent them. + + + + + + + + + + + + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + Precondition: edge intersections have been computed. + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule). + + + + + + + + + + + + + Implements the SFS relate() generalized spatial predicate on two s. +
+ The class supports specifying a custom + to be used during the relate computation. +
+ + If named spatial predicates are used on the result + of the RelateOp, the result may or not be affected by the + choice of BoundaryNodeRule, depending on the exact nature of the pattern. + For instance, is insensitive + to the choice of BoundaryNodeRule, + whereas is affected by the rule chosen. + + Note: custom Boundary Node Rules do not (currently) + affect the results of other methods (such + as . The results of + these methods may not be consistent with the relationship computed by + a custom Boundary Node Rule. + +
+ + + Computes the for the spatial relationship + between two s, using the default (OGC SFS) Boundary Node Rule + + A geometry to test + A geometry to test + The IntersectonMatrix for the spatial relationship between the geometries + + + + Computes the for the spatial relationship + between two s, using the specified Boundary Node Rule + + A geometry to test + A geometry to test + The Boundary Node Rule to use + The IntersectonMatrix for the spatial relationship between the geometries + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + The Boundary Node Rule to use + + + + Gets the IntersectionMatrix for the spatial relationship + between the input geometries. + + + + + Provides an efficient method of unioning a collection of + geometrys. + The geometries are indexed using a spatial index, + and unioned recursively in index order. + For geometries with a high degree of overlap, + this has the effect of reducing the number of vertices + early in the process, which increases speed + and robustness. + + This algorithm is faster and more robust than + the simple iterated approach of + repeatedly unioning each polygon to a result geometry. + + The buffer(0) trick is sometimes faster, but can be less robust and + can sometimes take a long time to complete. + This is particularly the case where there is a high degree of overlap + between the polygons. In this case, buffer(0) is forced to compute + with all line segments from the outset, + whereas cascading can eliminate many segments + at each stage of processing. + The best situation for using buffer(0) is the trivial case + where there is no overlap between the input geometries. + However, this case is likely rare in practice. + + Martin Davis + + + + The effectiveness of the index is somewhat sensitive + to the node capacity. + Testing indicates that a smaller capacity is better. + For an STRtree, 4 is probably a good number (since + this produces 2x2 "squares"). + + + + Computes the union of + a collection of s. + + A collection of s. + + + + + Creates a new instance to union + the given collection of s. + + A collection of s + + + + Computes the union of the input geometries. + + + + This method discards the input geometries as they are processed. + In many input cases this reduces the memory retained + as the operation proceeds. + Optimal memory usage is achieved + by disposing of the original input collection + before calling this method. + + The union of the input geometries, + or null if no input geometries were provided + + if this method is called more than once + + + + Unions a list of geometries + by treating the list as a flattened binary tree, + and performing a cascaded union on the tree. + + The list of geometries to union + The union of the list + + + + Unions a section of a list using a recursive binary union on each half + of the section. + + The list of geometries containing the section to union + The start index of the section + The index after the end of the section + The union of the list section + + + + Gets the element at a given list index, or + null if the index is out of range. + + The list of geometries + The index + The geometry at the given index or + null if the index is out of range + + + + Reduces a tree of geometries to a list of geometries + by recursively unioning the subtrees in the list. + + A tree-structured list of geometries + A list of Geometrys + + + + Computes the union of two geometries, + either or both of which may be null. + + A Geometry + A Geometry + The union of the input(s) or + null if both inputs are null + + + + Unions two polygonal geometries, restricting computation + to the envelope intersection where possible. + The case of MultiPolygons is optimized to union only + the polygons which lie in the intersection of the two geometry's envelopes. + Polygons outside this region can simply be combined with the union result, + which is potentially much faster. + This case is likely to occur often during cascaded union, and may also + occur in real world data (such as unioning data for parcels on different street blocks). + + A polygonal geometry + A polygonal geometry + The intersection of the envelopes of the inputs + The union of the inputs + + + + Encapsulates the actual unioning of two polygonal geometries. + + + + Computes a containing only components. + Extracts the s from the input + and returns them as an appropriate geometry. + + If the input is already Polygonal, it is returned unchanged. + + A particular use case is to filter out non-polygonal components + returned from an overlay operation. + + The geometry to filter + A polygonal geometry + + + + Computes the union of a geometry with + another arbitrary . + Does not copy any component geometries. + + + + + + + + Unions a Collection of s or a single Geometry (which may be a ) together. + + + + By using this special-purpose operation over a collection of geometries + it is possible to take advantage of various optimizations to improve performance. + + + Heterogeneous s are fully supported. + + + The result obeys the following contract: + + Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). + Unioning a set of s has the effect of fully noding + and dissolving the input linework. + In this context "fully noded" means that there will be + an endpoint or node in the result + for every endpoint or line segment crossing in the input. + "Dissolved" means that any duplicate (e.g. coincident) line segments or portions + of line segments will be reduced to a single line segment in the output. + This is consistent with the semantics of the + operation. + If merged linework is required, the class can be used. + Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). + + + UnaryUnion always operates on the individual components of MultiGeometries. + So it is possible to use it to "clean" invalid self-intersecting MultiPolygons + (although the polygon components must all still be individually valid.) + + + + mbdavis + + + + + Computes the geometric union of a + + A collection of geometries + The union of the geometries, + or null if the input is empty + + + + Computes the geometric union of a + If no input geometries were provided but a was provided, + an empty is returned. + + A collection of geometries + The geometry factory to use if the collection is empty + The union of the geometries + or an empty GEOMETRYCOLLECTION + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + The union of the elements of the geometry + or an empty GEOMETRYCOLLECTION + + + + Constructs a unary union operation for an enumeration + of s, using the + of the input geometries. + + An enumeration of geometries + + + + Constructs a unary union operation for an enumeration + of s. + If no input geometries were provided but a was provided, + + An enumeration of geometries + The geometry factory to use if the enumeration is empty + + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + + + + Gets the union of the input geometries. + If no input geometries were provided but a was provided, + an empty is returned. + Otherwise, the return value is null + + + A Geometry containing the union + or an empty if no geometries were provided in the input, + or null if not GeometryFactory was provided + + + + + Computes the union of two geometries, either of both of which may be null. + + + + + The union of the input(s) + or null if both inputs are null + + + + + Computes a unary union with no extra optimization, and no short-circuiting. + + + Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. + + A geometry + The union of the input geometry + + + + Experimental code to union MultiPolygons with processing limited to the elements which actually interact. + + Not currently used, since it doesn't seem to offer much of a performance advantage. + mbdavis + + + + This class tests that the interior of an area + ( or ) + is connected. An area Geometry is invalid if the interior is disconnected. + This can happen if: + - a shell self-intersects, + - one or more holes form a connected chain touching a shell at two different points, + - one or more holes form a ring around a subset of the interior. + If a disconnected situation is found the location of the problem is recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form s in graph into Minimal EdgeRings. + (Minimal Edgerings must be used, because only they are guaranteed to provide + a correct isHole computation). + + + + + + + Mark all the edges for the edgeRings corresponding to the shells of the input polygons. + Only ONE ring gets marked for each shell - if there are others which remain unmarked + this indicates a disconnected interior. + + + + + + + + + + + + + + + + + + + + Check if any shell ring has an unvisited edge. + A shell ring is a ring which is not a hole and which has the interior + of the parent area on the RHS. + (Note that there may be non-hole rings with the interior on the LHS, + since the interior of holes will also be polygonized into CW rings + by the LinkAllDirectedEdges() step). + + + true if there is an unvisited edge in a non-hole ring. + + + + + + + + + Checks that a {GeometryGraph} representing an area + (a Polygon or MultiPolygon ) + is consistent with the SFS semantics for area geometries. + Checks include: + Testing for rings which self-intersect (both properly and at nodes). + Testing for duplicate rings. + If an inconsistency if found the location of the problem is recorded. + + + + + + + + + + + Returns the intersection point, or null if none was found. + + + + + + + + + + Check all nodes to see if their labels are consistent. + If any are not, return false. + + + + + Checks for two duplicate rings in an area. + Duplicate rings are rings that are topologically equal + (that is, which have the same sequence of points up to point order). + If the area is topologically consistent (determined by calling the + isNodeConsistentArea, + duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. + (This is because topologically consistent areas cannot have two rings sharing + the same line segment, unless the rings are equal). + The start point of one of the equal rings will be placed in invalidPoint. + Returns true if this area Geometry is topologically consistent but has two duplicate rings. + + + + Tests whether any of a set of {@link LinearRing}s are + nested inside another ring in the set, using a spatial + index to speed up the comparisons. + + @version 1.7 + + + + Implements the algorithsm required to compute the + method for s. + See the documentation for the various geometry types for a specification of validity. + + + + + Checks whether a coordinate is valid for processing. + Coordinates are valid iff their x and y ordinates are in the + range of the floating point representation. + + The coordinate to validate. + true if the coordinate is valid. + + + + Find a point from the list of testCoords + that is NOT a node in the edge for the list of searchCoords. + + + + + The point found, or null if none found. + + + If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). + + + + + + + + + + + + + + + + Checks validity of a Point. + + + + + + Checks validity of a MultiPoint. + + + + + + Checks validity of a LineString. + Almost anything goes for lineStrings! + + + + + + Checks validity of a LinearRing. + + + + + + Checks the validity of a polygon and sets the validErr flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there is no ring which self-intersects (except of course at its endpoints). + This is required by OGC topology rules (but not by other models + such as ESRI SDE, which allow inverted shells and exverted holes). + + + + + + Check that a ring does not self-intersect, except at its endpoints. + Algorithm is to count the number of times each node along edge occurs. + If any occur more than once, that must be a self-intersection. + + + + + Tests that each hole is inside the polygon shell. + This routine assumes that the holes have previously been tested + to ensure that all vertices lie on the shell or inside it. + A simple test of a single point in the hole can be used, + provide the point is chosen such that it does not lie on the + boundary of the shell. + + The polygon to be tested for hole inclusion. + A GeometryGraph incorporating the polygon. + + + + Tests that no hole is nested inside another hole. + This routine assumes that the holes are disjoint. + To ensure this, holes have previously been tested + to ensure that: + They do not partially overlap + (checked by checkRelateConsistency). + They are not identical + (checked by checkRelateConsistency). + + + + + Tests that no element polygon is wholly in the interior of another element polygon. + Preconditions: + Shells do not partially overlap. + Shells do not touch along an edge. + No duplicate rings exists. + This routine relies on the fact that while polygon shells may touch at one or + more vertices, they cannot touch at ALL vertices. + + + + + Check if a shell is incorrectly nested within a polygon. This is the case + if the shell is inside the polygon shell, but not inside a polygon hole. + (If the shell is inside a polygon hole, the nesting is valid.) + The algorithm used relies on the fact that the rings must be properly contained. + E.g. they cannot partially overlap (this has been previously checked by + CheckRelateConsistency). + + + + + This routine checks to see if a shell is properly contained in a hole. + It assumes that the edges of the shell and hole do not + properly intersect. + + + + + + null if the shell is properly contained, or + a Coordinate which is not inside the hole if it is not. + + + + + + + + + + + + Gets/Sets whether polygons using Self-Touching Rings to form + holes are reported as valid. + If this flag is set, the following Self-Touching conditions + are treated as being valid: + - The shell ring self-touches to create a hole touching the shell. + - A hole ring self-touches to create two holes touching at a point. + + + The default (following the OGC SFS standard) + is that this condition is not valid (false). + + + This does not affect whether Self-Touching Rings + disconnecting the polygon interior are considered valid + (these are considered to be invalid under the SFS, and many other + spatial models as well). + This includes "bow-tie" shells, + which self-touch at a single point causing the interior to be disconnected, + and "C-shaped" holes which self-touch at a single point causing an island to be formed. + + + States whether geometry with this condition is valid. + + + + Computes the validity of the geometry, + and returns true if it is valid. + + + + + Computes the validity of the geometry, + and if not valid returns the validation error for the geometry, + or null if the geometry is valid. + + The validation error, if the geometry is invalid
+ or null if the geometry is valid
+
+ + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a Quadtree + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the appropriate checks for repeated points + (consecutive identical coordinates) as defined in the + NTS spec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a simple O(n^2) + comparison. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a SweepLineIndex + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about the nature and location of + a validation error. + + + + + Not used. + + + + + No longer used: + repeated points are considered valid as per the SFS. + + + + + Indicates that a hole of a polygon lies partially + or completely in the exterior of the shell. + + + + + Indicates that a hole lies + in the interior of another hole in the same polygon. + + + + + Indicates that the interior of a polygon is disjoint + (often caused by set of contiguous holes splitting + the polygon into two parts). + + + + + Indicates that two rings of a polygonal geometry intersect. + + + + + Indicates that a ring self-intersects. + + + + + Indicates that a polygon component of a + lies inside another polygonal component. + + + + + Indicates that a polygonal geometry + contains two rings which are identical. + + + + + Indicates that either: + - A contains a single point. + - A contains 2 or 3 points. + + + + + Indicates that the X or Y ordinate of + a is not a valid + numeric value (e.g. ). + + + + + Indicates that a ring is not correctly closed + (the first and the last coordinate are different). + + + + + Contains information about the nature and location of a Geometry + validation error. + + + + + These messages must synch up with the indexes above + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds all connected s of a . + + + + + Initializes a new instance of the class. + + The . + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + + + + + + Adds the argument node and all its out edges to the subgraph. + + + + + + + + A sorted collection of DirectedEdges which leave a Node + in a PlanarGraph. + + + + + The underlying list of outgoing DirectedEdges. + + + + + Adds a new member to this DirectedEdgeStar. + + + + + + Drops a member of this DirectedEdgeStar. + + + + + + Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the zero-based index of the given DirectedEdge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the remainder when i is divided by the number of edges in this + DirectedEdgeStar. + + + + + + + Returns the on the left-hand + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + + + Returns the on the right-hand (CW) + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + Returns the number of edges around the Node associated with this DirectedEdgeStar. + + + + + Returns the coordinate for the node at wich this star is based. + + + + + Returns the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + A node in a PlanarGraph is a location where 0 or more Edges + meet. A node is connected to each of its incident Edges via an outgoing + DirectedEdge. Some clients using a PlanarGraph may want to + subclass Node to add their own application-specific + data and methods. + + + + + Returns all Edges that connect the two nodes (which are assumed to be different). + + + + + + + + The location of this Node. + + + + + The collection of DirectedEdges that leave this Node. + + + + + Constructs a Node with the given location. + + + + + + Constructs a Node with the given location and collection of outgoing DirectedEdges. + + + + + + + Adds an outgoing DirectedEdge to this Node. + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Removes a incident on this node. Does not change the state of the directed edge. + + + + + Removes this node from its containing graph. + + + + + + + + + + + Returns the location of this Node. + + + + + Returns the collection of DirectedEdges that leave this Node. + + + + + Returns the number of edges around this Node. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + Adds a node to the map, replacing any that is already at that location. + + + The added node. + + + + Removes the Node at the given location, and returns it (or null if no Node was there). + + + + + + + Returns the Node at the given location, or null if no Node was there. + + + + + + + Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the number of Nodes in this NodeMap. + + + + + A subgraph of a . + A subgraph may contain any subset of s + from the parent graph. + It will also automatically contain all s + and s associated with those edges. + No new objects are created when edges are added - + all associated components must already exist in the parent graph. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new subgraph of the given . + + + + + + Gets the which this subgraph is part of. + + + + + + Adds an to the subgraph. + The associated s and s are also added. + + The to add. + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph. + + + + + + Tests whether an is contained in this subgraph. + + The to test. + true if the is contained in this subgraph. + + + + Determines the maximum number of common most-significant + bits in the mantissa of one or numbers. + Can be used to compute the double-precision number which + is represented by the common bits. + If there are no common bits, the number computed is 0.0. + + + + + Computes the bit pattern for the sign and exponent of a + double-precision number. + + + The bit pattern for the sign and exponent. + + + + This computes the number of common most-significant bits in the mantissas + of two double-precision numbers. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + /// + The number of common most-significant mantissa bits. + + + + Zeroes the lower n bits of a bitstring. + + The bitstring to alter. + the number of bits to zero. + The zeroed bitstring. + + + + Extracts the i'th bit of a bitstring. + + The bitstring to extract from. + The bit to extract. + The value of the extracted bit. + + + + + + + + + + A representation of the Double bits formatted for easy readability + + + + + + + + + + + + Provides versions of Geometry spatial functions which use + common bit removal to reduce the likelihood of robustness problems. + In the current implementation no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + Client classes should check the validity of the returned result themselves. + + + + + Creates a new instance of class, which reshifts result Geometrys. + + + + + Creates a new instance of class, specifying whether + the result Geometrys should be reshifted. + + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry, to be subtracted from the first. + The Geometry representing the set-theoretic difference of the input Geometries. + + + Computes the set-theoretic symmetric difference of two geometries, + using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer a point, using enhanced precision. + + The Geometry to buffer. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + If required, returning the result to the orginal precision if required. + In this current implementation, no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + + The result Geometry to modify. + The result Geometry with the required precision. + + + + Computes a copy of the input Geometry with the calculated common bits + removed from each coordinate. + + The Geometry to remove common bits from. + A copy of the input Geometry with common bits removed. + + + + Computes a copy of each input Geometrys with the calculated common bits + removed from each coordinate. + + A Geometry to remove common bits from. + A Geometry to remove common bits from. + + An array containing copies + of the input Geometry's with common bits removed. + + + + + Removes common most-significant mantissa bits + from one or more s. + + The CommonBitsRemover "scavenges" precision + which is "wasted" by a large displacement of the geometry + from the origin. + For example, if a small geometry is displaced from the origin + by a large distance, + the displacement increases the significant figures in the coordinates, + but does not affect the relative topology of the geometry. + Thus the geometry can be translated back to the origin + without affecting its topology. + In order to compute the translation without affecting + the full precision of the coordinate values, + the translation is performed at the bit level by + removing the common leading mantissa bits. + + If the geometry envelope already contains the origin, + the translation procedure cannot be applied. + In this case, the common bits value is computed as zero. + + If the geometry crosses the Y axis but not the X axis + (and mutatis mutandum), + the common bits for Y are zero, + but the common bits for X are non-zero. + + + + + Add a point to the set of geometries whose common bits are + being computed. After this method has executed the + common coordinate reflects the common bits of all added + geometries. + + A Geometry to test for common bits. + + + + Removes the common coordinate bits from a Geometry. + The coordinates of the Geometry are changed. + + The Geometry from which to remove the common coordinate bits. + The shifted Geometry. + + + + Adds the common coordinate bits back into a Geometry. + The coordinates of the Geometry are changed. + + The Geometry to which to add the common coordinate bits. + + + + The common bits of the Coordinates in the supplied Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate sequence + + + + Reduces the precision of the s in a + to match the supplied . + + + Uses . + The input is modified in-place, so + it should be cloned beforehand if the + original should not be modified. + + mbdavis + + + + Creates a new precision reducer filter. + + The PrecisionModel to use + + + + Rounds the Coordinates in the sequence to match the PrecisionModel + + + + + Always runs over all geometry components. + + + + + Always reports that the geometry has changed + + + + + Provides versions of Geometry spatial functions which use + enhanced precision techniques to reduce the likelihood of robustness problems. + + + + + Only static methods! + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic difference of the input Geometries. + + + + Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer of a Geometry, using enhanced precision. + This method should no longer be necessary, since the buffer algorithm + now is highly robust. + + The first Geometry. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + Reduces the precision of a + according to the supplied , + ensuring that the result is topologically valid. + + + + + Convenience method for doing precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + and preserving polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Convenience method for doing pointwise precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + but NOT preserving valid polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Duplicates a geometry to one that uses a different PrecisionModel, + without changing any coordinate values. + + The geometry to duplicate + The precision model to use + The geometry value with a new precision model + + + Gets or sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + The default is to remove collapsed components. + + + + + /// Gets or sets whether the of the new reduced Geometry + will be changed to be the supplied to + specify the precision reduction. + + The default is to not change the precision model + + + + + Gets or sets whether the precision reduction will be done + in pointwise fashion only. + Pointwise precision reduction reduces the precision + of the individual coordinates only, but does + not attempt to recreate valid topology. + This is only relevant for geometries containing polygonal components. + + + + + Computes the Minimum Clearance of a . + + The Minimum Clearance is a measure of + what magnitude of perturbation of + the vertices of a geometry can be tolerated + before the geometry becomes topologically invalid. + The smaller the Minimum Clearance distance, + the less vertex pertubation the geometry can tolerate + before becoming invalid. + + + The concept was introduced by Thompson and Van Oosterom + [TV06], based on earlier work by Milenkovic [Mi88]. + + The Minimum Clearance of a geometry G + is defined to be the value r + such that "the movement of all points by a distance + of r in any direction will + guarantee to leave the geometry valid" [TV06]. + An equivalent constructive definition [Mi88] is that + r is the largest value such: + + No two distinct vertices of G are closer than r. + No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint + + The following image shows an example of the Minimum Clearance + of a simple polygon. + +
+ + If G has only a single vertex (i.e. is a + ), the value of the minimum clearance + is . + + If G is a or geometry, + then in fact no amount of perturbation + will render the geometry invalid. + In this case a Minimum Clearance is still computed + based on the vertex and segment distances + according to the constructive definition. + + It is possible for no Minimum Clearance to exist. + For instance, a with all members identical + has no Minimum Clearance + (i.e. no amount of perturbation will cause + the member points to become non-identical). + Empty geometries also have no such distance. + The lack of a meaningful MinimumClearance distance is detected + and suitable values are returned by + and . + + The computation of Minimum Clearance utilizes + the + method to provide good performance even for + large inputs. + + An interesting note is that for the case of s, + the computed Minimum Clearance line + effectively determines the Nearest Neighbours in the collection. +

References

+ + [Mi88] Milenkovic, V. J., + Verifiable implementations of geometric algorithms + using finite precision arithmetic. + in Artificial Intelligence, 377-401. 1988 + [TV06] Thompson, Rod and van Oosterom, Peter, + Interchange of Spatial Data-Inhibiting Factors, + Agile 2006, Visegrad, Hungary. 2006 + +
+ /// Martin Davis +
+ + + Computes the Minimum Clearance distance for + the given Geometry. + + The input geometry + The minimum clearance + + + + Gets a LineString containing two points + which are at the Minimum Clearance distance + for the given Geometry. + + The input geometry + The value of the minimum clearance distance
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + Creates an object to compute the Minimum Clearance for the given Geometry + + The input geometry + + + + Gets the Minimum Clearance distance. + If no distance exists + (e.g. in the case of two identical points) + is returned. + + + The value of the minimum clearance distance
+ or if no Minimum Clearance distance exists +
+
+ + + Gets a LineString containing two points + which are at the Minimum Clearance distance. + If no distance could be found + (e.g. in the case of two identical points) + LINESTRING EMPTY is returned. + + The value of the minimum clearance distance,
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + + Reduces the precision of the coordinates of a Geometry + according to the supplied {PrecisionModel}, without + attempting to preserve valid topology. + + + In case of geometries, + the topology of the resulting geometry may be invalid if + topological collapse occurs due to coordinates being shifted. + It is up to the client to check this and handle it if necessary. + Collapses may not matter for some uses. An example + is simplifying the input to the buffer algorithm. + The buffer algorithm does not depend on the validity of the input point. + + + + + Convenience method for doing precision reduction on a single geometry, + with collapses removed and keeping the geometry precision model the same. + + The reduced geometry + + + + + + + + + + + + + + + + + Sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + + + + + Gets/Sets whether the PrecisionModel of the new reduced Geometry + will be changed to be the PrecisionModel supplied to + specify the precision reduction. + The default is to not change the precision model. + + + + + + + + + + + + + + + + + + + + + + + + Computes the minimum clearance of a geometry or + set of geometries. + The Minimum Clearance is a measure of + what magnitude of perturbation of its vertices can be tolerated + by a geometry before it becomes topologically invalid. + + This class uses an inefficient O(N^2) scan. + It is primarily for testing purposes. + + + Martin Davis + + + + Gets or sets the total number of points in the created . + The created geometry will have no more than this number of points, + unless more are needed to create a valid geometry. + + + + + The height of an equilateral triangle of side one + + + + + Creates random point sets contained in a + region defined by either a rectangular or a polygonal extent. + + mbdavis + + + + Create a shape factory which will create shapes using the default + . + + + + + Create a shape factory which will create shapes using the given + + + The factory to use + + + + Sets a polygonal mask. + + if the mask is not polygonal + + + + Creates random point sets where the points + are constrained to lie in the cells of a grid. + + mbdavis + + + + Create a builder which will create shapes using the default + . + + + + + Create a builder which will create shapes using the given + . + + The factory to use + + + + Gets the containing the generated point + + A MultiPoint + + + + Gets or sets whether generated points are constrained to lie + within a circle contained within each grid cell. + This provides greater separation between points + in adjacent cells. + + The default is to not be constrained to a circle. + + + + + Gets or sets the fraction of the grid cell side which will be treated as + a gutter, in which no points will be created. + + The provided value is clamped to the range [0.0, 1.0]. + + + + + Simplifies a line (sequence of points) using + the standard Douglas-Peucker algorithm. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a using the Douglas-Peucker algorithm. + + + Ensures that any polygonal geometries returned are valid. + Simple lines are not guaranteed to remain simple after simplification. + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + Note that in general D-P does not preserve topology - + e.g. polygons can be split, collapse to lines or disappear + holes can be created or disappear, + and lines can cross. + To simplify point while preserving topology use TopologySafeSimplifier. + (However, using D-P is significantly faster). + + KNOWN BUGS: + In some cases the approach used to clean invalid simplified polygons + can distort the output geometry severely. + + + + + + Simplifies a geometry using a given tolerance. + + The geometry to simplify. + The tolerance to use. + A simplified version of the geometry. + + + + Creates a simplifier for a given geometry. + + The geometry to simplify. + + + + Gets the simplified geometry. + + The simplified geometry. + + + + The distance tolerance for the simplification. + + + All vertices in the simplified geometry will be within this + distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" + to have valid topology. + + + The caller may choose to disable this because: + + valid topology is not required + fixing topology is a relative expensive operation + in some pathological cases the topology fixing operation may either fail or run for too long + + The default is to fix polygon topology. + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a polygon, fixing it if required. + + + + + + + + Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. + + null if the simplification results in a degenerate ring + + + + + + + + + + + + Creates a valid area point from one that possibly has + bad topology (i.e. self-intersections). + Since buffer can handle invalid topology, but always returns + valid point, constructing a 0-width buffer "corrects" the + topology. + Note this only works for area geometries, since buffer always returns + areas. This also may return empty geometries, if the input + has no actual area. + + An area point possibly containing self-intersections. + A valid area point. + + + + An index of LineSegments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemVisitor subclass to reduce volume of query results. + + + + + + + + + + + + + + + + + + + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + A LineSegment which is tagged with its location in a Geometry. + Used to index the segments in a point and recover the segment locations + from the index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a collection of TaggedLineStrings, preserving topology + (in the sense that no new intersections are introduced). + This class is essentially just a container for the common + indexes used by . + + + + + Simplifies a collection of TaggedLineStrings. + + The collection of lines to simplify. + + + + Gets or sets the distance tolerance for the simplification.
+ Points closer than this tolerance to a simplified segment may + be removed. +
+
+ + + Represents a which can be modified to a simplified shape. + This class provides an attribute which specifies the minimum allowable length + for the modified result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a TaggedLineString, preserving topology + (in the sense that no new intersections are introduced). + Uses the recursive Douglas-Peucker algorithm. + + + + + Simplifies the given + using the distance tolerance specified. + + The linestring to simplify. + + + + Flattens a section of the line between + indexes and , + replacing them with a line between the endpoints. + The input and output indexes are updated + to reflect this. + + The start index of the flattened section. + The end index of the flattened section. + The new segment created. + + + + Tests whether a segment is in a section of a . + + + + + + + + + Remove the segs in the section of the line. + + + + + + + + Sets the distance tolerance for the simplification. + All vertices in the simplified geometry will be within this + distance of the original geometry. + + + + + Simplifies a point and ensures that + the result is a valid point having the + same dimension and number of components as the input, + and with the components having the same topological + relationship. + + If the input is a polygonal geometry + ( or ): + + The result has the same number of shells and holes as the input, + with the same topological structure + The result rings touch at no more than the number of touching points in the input + (although they may touch at fewer points). + The key implication of this statement is that if the + input is topologically valid, so is the simplified output. + + For linear geometries, if the input does not contain + any intersecting line segments, this property + will be preserved in the output. + + For all geometry types, the result will contain + enough vertices to ensure validity. For polygons + and closed linear geometries, the result will have at + least 4 vertices; for open linestrings the result + will have at least 2 vertices. + + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + The simplification uses a maximum-distance difference algorithm + similar to the Douglas-Peucker algorithm. + + +

KNOWN BUGS

+ + May create invalid topology if there are components which are small + relative to the tolerance value. + In particular, if a small hole is very near an edge, + it is possible for the edge to be moved by a relatively large tolerance value + and end up with the hole outside the result shell (or inside another hole). + Similarly, it is possible for a small polygon component to end up inside + a nearby larger polygon. + A workaround is to test for this situation in post-processing and remove + any invalid holes or polygons. + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A filter to add linear geometries to the linestring map + with the appropriate minimum size constraint. + Closed s (including s + have a minimum output size constraint of 4, + to ensure the output is valid. + For all other linestrings, the minimum size is 2 points. + + Martin Davis + + + + Filters linear geometries. + + A geometry of any type + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a using the Visvalingam-Whyatt area-based algorithm. + Ensures that any polygonal geometries returned are valid. Simple lines are not + guaranteed to remain simple after simplification. All geometry types are + handled. Empty and point geometries are returned unchanged. Empty geometry + components are deleted. + The simplification tolerance is specified as a distance. + This is converted to an area tolerance by squaring it. + + Known Bugs + * Not yet optimized for performance. + * Does not simplify the endpoint of rings. + To Do + * Allow specifying desired number of vertices in the output. + + + + Note that in general this algorithm does not preserve topology - e.g. polygons can be split, + collapse to lines or disappear holes can be created or disappear, and lines + can cross. + + 1.7 + + + + Simplifies a using a given tolerance. + + The to simplify. + The tolerance to use. + A simplified version of the . + + + + Creates a simplifier for a given . + + The to simplify. + + + + Gets the semplified . + + The semplified . + + + + Sets the distance tolerance for the simplification. All vertices in the + simplified will be within this distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" to have valid + topology. The caller may choose to disable this because: + * valid topology is not required. + * fixing topology is a relative expensive operation. + * in some pathological cases the topology fixing operation may either + fail or run for too long. + + The default is to fix polygon topology. + + + + Simplifies a , fixing it if required. + + + + + + + + Simplifies a . If the simplification results in a degenerate + ring, remove the component. + + + + null if the simplification results in a degenerate ring. + + + + Simplifies a , fixing it if required. + + + + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections. + A valid area geometry. + + + + A utility class which creates Conforming Delaunay Trianglulations + from collections of points and linear constraints, and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Sets the sites (point or vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + The site vertices do not have to contain the constraint + vertices as well; any site vertices which are + identical to a constraint vertex will be removed + from the site vertex set. + + The geometry from which the sites will be extracted. + + + + Gets the QuadEdgeSubdivision which models the computed triangulation. + + The subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + The geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the linear constraints to be conformed to. + All linear components in the input will be used as constraints. + The constraint vertices do not have to be disjoint from + the site vertices. + The constraints must not contain duplicate segments (up to orientation). + + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + + Creates a Conforming Delaunay Triangulation based on the given + unconstrained initial vertices. The initial vertex set should not contain + any vertices which appear in the constraint set. + + a collection of + the distance tolerance below which points are considered identical + + + + Sets the constraints to be conformed to by the computed triangulation. + The constraints must not contain duplicate segments (up to orientation). + The unique set of vertices (as es) + forming the constraints must also be supplied. + Supplying it explicitly allows the ConstraintVertexes to be initialized + appropriately(e.g. with external data), and avoids re-computing the unique set + if it is already available. + + list of the constraint {@link Segment}s + the set of unique es referenced by the segments + + + + Creates a vertex on a constraint segment + + the location of the vertex to create + the constraint segment it lies on + the new constraint vertex + + + + Inserts all sites in a collection + + a collection of ConstraintVertex + + + + Inserts a site into the triangulation, maintaining the conformal Delaunay property. + This can be used to further refine the triangulation if required + (e.g. to approximate the medial axis of the constraints, + or to improve the grading of the triangulation). + + the location of the site to insert + + + + Computes the Delaunay triangulation of the initial sites. + + + + + Enforces the supplied constraints into the triangulation. + + + if the constraints cannot be enforced + + + + Given a set of points stored in the kd-tree and a line segment defined by + two points in this set, finds a in the circumcircle of + the line segment, if one exists. This is called the Gabriel point - if none + exists then the segment is said to have the Gabriel condition. Uses the + heuristic of finding the non-Gabriel point closest to the midpoint of the + segment. + + the line segment + + A point which is non-Gabriel, + or null if no point is non-Gabriel + + + + + Gets or sets the to be + used during constraint enforcement. + Different splitting strategies may be appropriate + for special situations. + + the ConstraintSplitPointFinder to be used + + + + Gets the tolerance value used to construct the triangulation. + + a tolerance value + + + + Gets and sets the used to create new constraint vertices at split points. + + Allows the setting of a custom {@link ConstraintVertexFactory} to be used + to allow vertices carrying extra information to be created. + + + + + Gets the which represents the triangulation. + + + + + Gets the which contains the vertices of the triangulation. + + + + + Gets the sites (vertices) used to initialize the triangulation. + + + + + Gets the s which represent the constraints. + + + + + Gets the convex hull of all the sites in the triangulation, + including constraint vertices. + Only valid after the constraints have been enforced. + + the convex hull of the sites + + + + Indicates a failure during constraint enforcement. + + Martin Davis + 1.0 + + + + Creates a new instance with a given message. + + a string + + + + Creates a new instance with a given message and approximate location. + + a string + the location of the error + + + + Gets the approximate location of this error. + + a location + + + + An interface for strategies for determining the location of split points on constraint segments. + The location of split points has a large effect on the performance and robustness of enforcing a + constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, + especially at narrow constraint angles, since the split point will end up encroaching on the + segment containing the original encroaching point. With detailed knowledge of the geometry of the + constraints, it is sometimes possible to choose better locations for splitting. + + mbdavis + + + + Finds a point at which to split an encroached segment to allow the original segment to appear + as edges in a constrained Delaunay triangulation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + A vertex in a Constrained Delaunay Triangulation. + The vertex may or may not lie on a constraint. + If it does it may carry extra information about the original constraint. + + Martin Davis + + + + Models a site (node) in a . + The sites can be points on a line string representing a + linear site. + The vertex can be considered as a vector with a norm, length, inner product, cross + product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle + defined by this point and two others, etc.) are also defined in this class. + + It is common to want to attach user-defined data to + the vertices of a subdivision. + One way to do this is to subclass Vertex + to carry any desired information. + + David Skea + Martin Davis + + + + Creates an instance of this class using the given x- and y-ordinate valuse + + x-ordinate value + y-ordinate value + + + + Creates an instance of this class using the given x-, y- and z-ordinate values + + x-ordinate value + y-ordinate value + z-ordinate value + + + + Creates an instance of this class using a clone of the given . + + The coordinate + + + + Computes the cross product k = u X v. + + a vertex + returns the magnitude of u X v + + + + Computes the inner or dot product + + A vertex + The dot product u.v + + + + Computes the scalar product c(v) + + A vertex + The scaled vector + + + + Tests if this is inside the circle defined by the points a, b, c. This test uses simple + double-precision arithmetic, and thus may not be robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + true if this vertex is inside the circumcircle (a, b, c) + + + + Tests whether the triangle formed by this vertex and two + other vertices is in CCW orientation. + + a vertex + a vertex + true if the triangle is oriented CCW + + + + Computes the value of the ratio of the circumradius to shortest edge. If smaller than some + given tolerance B, the associated triangle is considered skinny. For an equal lateral + triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: + circumRadius/shortestEdge = 1/(2sin(theta)). + + second vertex of the triangle + third vertex of the triangle + ratio of circumradius to shortest edge. + + + + returns a new vertex that is mid-way between this vertex and another end point. + + the other end point. + the point mid-way between this and that. + + + + Computes the centre of the circumcircle of this vertex and two others. + + + + the Coordinate which is the circumcircle of the 3 points. + + + + For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate + a z value from the surrounding vertices. + + + + + Interpolates the Z-value (height) of a point enclosed in a triangle + whose vertices all have Z values. + The containing triangle must not be degenerate + (in other words, the three vertices must enclose a + non-zero area). + + The point to interpolate the Z value of + A vertex of a triangle containing the + A vertex of a triangle containing the + A vertex of a triangle containing the + The interpolated Z-value (height) of the point + + + + Computes the interpolated Z-value for a point p lying on the segment p0-p1 + + The point to interpolate the Z value of + A vertex of the segment is lying on + A vertex of the segment is lying on + The interpolated Z-value (height) of the point + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + Gets the z-ordinate value + + + + + Gets the coordinate + + + + + Creates a new constraint vertex + + the location of the vertex + + + + Merges the constraint data in the vertex other into this vertex. + This method is called when an inserted vertex is + very close to an existing vertex in the triangulation. + + the constraint vertex to merge + + + + Gets or sets whether this vertex lies on a constraint. + + true if the vertex lies on a constraint + + + + Gets or sets the external constraint object + + object which carries information about the constraint this vertex lies on + + + + An interface for factories which create a {@link ConstraintVertex} + + Martin Davis + + + + A utility class which creates Delaunay Trianglulations + from collections of points and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Extracts the unique s from the given . + + the geometry to extract from + a List of the unique Coordinates + + + + Converts all s in a collection to es. + + the coordinates to convert + a List of Vertex objects + + + + Computes the of a collection of s. + + a List of Coordinates + the envelope of the set of coordinates + + + + Sets the sites (vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + + the geometry from which the sites will be extracted. + + + + Sets the sites (vertices) which will be triangulated + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed triangulation. + + the subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + the geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + Computes a Delauanay Triangulation of a set of es, using an + incrementatal insertion algorithm. + + Martin Davis + 1.0 + + + + Creates a new triangulator using the given . + The triangulator uses the tolerance of the supplied subdivision. + + a subdivision in which to build the TIN + + + + Inserts all sites in a collection. The inserted vertices MUST be + unique up to the provided tolerance value. (i.e. no two vertices should be + closer than the provided tolerance value). They do not have to be rounded + to the tolerance grid, however. + + a Collection of Vertex + if the location algorithm fails to converge in a reasonable number of iterations + + + + Inserts a new point into a subdivision representing a Delaunay + triangulation, and fixes the affected edges so that the result is still a + Delaunay triangulation. + + a quadedge containing the inserted vertex + + + + A simple split point finder which returns the midpoint of the split segment. This is a default + strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. + Other points which could be used are: +
    +
  • The projection of the encroaching point on the segment
  • +
  • A point on the segment which will produce two segments which will not be further encroached
  • +
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • + point +
+
+ Martin Davis +
+ + + Gets the midpoint of the split segment + + + + + A strategy for finding constraint split points which attempts to maximise the length of the split + segments while preventing further encroachment. (This is not always possible for narrow angles). + + Martin Davis + + + + A basic strategy for finding split points when nothing extra is known about the geometry of + the situation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a split point which is the projection of the encroaching point on the segment + + The segment + The enchroaching point + A split point on the segment + + + + A framework to visit sets of edge-connected s in breadth-first order + + Martin Davis + 1.0 + + + + Called to initialize the traversal queue with a given set of s + + a collection of QuadEdgeTriangle + + + + Subclasses call this method to perform the visiting process. + + + + + An interface for classes which locate an edge in a + which either contains a given V + or is an edge of a triangle which contains V. + Implementors may utilized different strategies for + optimizing locating containing edges/triangles. + + Martin Davis + + + + Interface for classes which process triangles visited during travesals of a + + + Martin Davis + + + + Visits a triangle during a traversal of a . An implementation of + this method may perform processing on the current triangle. It must also decide whether a + neighbouring triangle should be added to the queue so its neighbours are visited. Often it + will perform processing on the neighbour triangle as well, in order to mark it as processed + (visited) and/or to determine if it should be visited. Note that choosing not to + visit the neighbouring triangle is the terminating condition for many traversal algorithms. + In particular, if the neighbour triangle has already been visited, it should not be visited + again. + + the current triangle being processed + the index of the edge in the current triangle being traversed + a neighbouring triangle next in line to visit + true if the neighbour triangle should be visited + + + + An interface for algorithms which process the triangles in a . + + Martin Davis + 1.0 + + + + + Locates s in a , + optimizing the search by starting in the + locality of the last edge found. + + Martin Davis + + + + Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. + The search starts from the last located edge amd proceeds on the general direction of v. + + + + + A class that represents the edge data structure which implements the quadedge algebra. + The quadedge algebra was described in a well-known paper by Guibas and Stolfi, + "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", + ACM Transactions on Graphics, 4(2), 1985, 75-123. + + Each edge object is part of a quartet of 4 edges, + linked via their Rot references. + Any edge in the group may be accessed using a series of operations. + Quadedges in a subdivision are linked together via their Next references. + The linkage between the quadedge quartets determines the topology + of the subdivision. + + + The edge class does not contain separate information for vertice or faces; a vertex is implicitly + defined as a ring of edges (created using the Next field). + + + David Skea + Martin Davis + + + + Creates a new QuadEdge quartet from o to d. + + the origin Vertex + the destination Vertex + the new QuadEdge quartet + + + + Creates a new QuadEdge connecting the destination of a to the origin of + b, in such a way that all three have the same left face after the + connection is complete. Additionally, the data pointers of the new edge + are set. + + the connected edge + + + + Splices two edges together or apart. + Splice affects the two edge rings around the origins of a and b, and, independently, the two + edge rings around the left faces of a and b. + In each case, (i) if the two rings are distinct, + Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it + into two separate pieces. Thus, Splice can be used both to attach the two edges together, and + to break them apart. + + an edge to splice + an edge to splice + + + + Turns an edge counterclockwise inside its enclosing quadrilateral. + + the quadedge to turn + + + + Quadedges must be made using {@link makeEdge}, + to ensure proper construction. + + + + + Gets the primary edge of this quadedge and its sym. + The primary edge is the one for which the origin + and destination coordinates are ordered + according to the standard ordering + + the primary quadedge + + + + Marks this quadedge as being deleted. + This does not free the memory used by + this quadedge quartet, but indicates + that this edge no longer participates + in a subdivision. + + + + + Sets the connected edge + + edge + + + + Tests if this quadedge and another have the same line segment geometry, + regardless of orientation. + + a quadege + true if the quadedges are based on the same line segment regardless of orientation + + + + Tests if this quadedge and another have the same line segment geometry + with the same orientation. + + a quadege + true if the quadedges are based on the same line segment + + + + Creates a representing the + geometry of this edge. + + a LineSegment + + + + Converts this edge to a WKT two-point LINESTRING indicating + the geometry of this edge. + + a String representing this edge's geometry + + + + Gets or sets the external data value for this edge. + + + an object containing external data + + + + + Tests whether this edge has been deleted. + + true if this edge has not been deleted. + + + + Gets the dual of this edge, directed from its right to its left. + + Gets or Sets the rotated edge + + + + Gets the dual of this edge, directed from its left to its right. + + Gets the inverse rotated edge. + + + + Gets the edge from the destination to the origin of this edge. + + Gets the sym of the edge. + + + + Gets the next CCW edge around the origin of this edge. + + Gets the next linked edge. + + + + Gets the next CW edge around (from) the origin of this edge. + + Gets the previous edge. + + + + Gets the next CCW edge around (into) the destination of this edge. + + Get the next destination edge. + + + + Gets the next CW edge around (into) the destination of this edge. + + Get the previous destination edge. + + + + Gets the CCW edge around the left face following this edge. + + Gets the next left face edge. + + + + Gets the CCW edge around the left face before this edge. + + Get the previous left face edge. + + + + Gets the edge around the right face ccw following this edge. + + Gets the next right face edge. + + + + Gets the edge around the right face ccw before this edge. + + Gets the previous right face edge. + + + + Gets or sets the vertex for the edge's origin + + Gets the origin vertex + + + + Gets or sets the vertex for the edge's destination + + Gets the destination vertex + + + + Gets the length of the geometry of this quadedge. + + Gets the length of the quadedge + + + + A class that contains the s representing a planar + subdivision that models a triangulation. + The subdivision is constructed using the + quadedge algebra defined in the classs . + All metric calculations + are done in the class. + In addition to a triangulation, subdivisions + support extraction of Voronoi diagrams. + This is easily accomplished, since the Voronoi diagram is the dual + of the Delaunay triangulation. + + Subdivisions can be provided with a tolerance value. Inserted vertices which + are closer than this value to vertices already in the subdivision will be + ignored. Using a suitable tolerance value can prevent robustness failures + from happening during Delaunay triangulation. + + + Subdivisions maintain a frame triangle around the client-created + edges. The frame is used to provide a bounded "container" for all edges + within a TIN. Normally the frame edges, frame connecting edges, and frame + triangles are not included in client processing. + + + David Skea + Martin Davis + + + + Gets the edges for the triangle to the left of the given . + + + + if the edges do not form a triangle + + + + Creates a new instance of a quad-edge subdivision based on a frame triangle + that encloses a supplied bounding box. A new super-bounding box that + contains the triangle is computed and stored. + + the bouding box to surround + the tolerance value for determining if two sites are equal + + + + Gets the collection of base s (one for every pair of + vertices which is connected). + + a collection of QuadEdges + + + + Sets the to use for locating containing triangles + in this subdivision. + + a QuadEdgeLocator + + + + Creates a new quadedge, recording it in the edges list. + + The origin vertex + The destination vertex + A new quadedge + + + + Creates a new QuadEdge connecting the destination of a to the origin of b, + in such a way that all three have the same left face after the connection + is complete. The quadedge is recorded in the edges list. + + A quadedge + A quadedge + A quadedge + + + + Deletes a quadedge from the subdivision. Linked quadedges are updated to + reflect the deletion. + + the quadedge to delete + + + + Locates an edge of a triangle which contains a location + specified by a Vertex v. + The edge returned has the + property that either v is on e, or e is an edge of a triangle containing v. + The search starts from startEdge amd proceeds on the general direction of v. + + + This locate algorithm relies on the subdivision being Delaunay. For + non-Delaunay subdivisions, this may loop for ever. + + the location to search for + an edge of the subdivision to start searching at + a QuadEdge which contains v, or is on the edge of a triangle containing v + + if the location algorithm fails to converge in a reasonable + number of iterations + + + + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the vertex to locate + a quadedge on the edge of a triangle which touches or contains the location
+ or null if no such triangle exists +
+
+ + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the Coordinate to locate + a quadedge on the edge of a triangle which touches or contains the location, + or null if no such triangle exists + + + + + Locates the edge between the given vertices, if it exists in the + subdivision. + + a coordinate + another coordinate + the edge joining the coordinates, if present, + or null if no such edge exists + + + + + Inserts a new site into the Subdivision, connecting it to the vertices of + the containing triangle (or quadrilateral, if the split point falls on an + existing edge). + + + + This method does NOT maintain the Delaunay condition. If desired, this must + be checked and enforced by the caller. + + + This method does NOT check if the inserted vertex falls on an edge. This + must be checked by the caller, since this situation may cause erroneous + triangulation + + + the vertex to insert + a new quad edge terminating in v + + + + Tests whether a QuadEdge is an edge incident on a frame triangle vertex. + + the edge to test + true if the edge is connected to the frame triangle + + + + Tests whether a QuadEdge is an edge on the border of the frame facets and + the internal facets. E.g. an edge which does not itself touch a frame + vertex, but which touches an edge which does. + + the edge to test + true if the edge is on the border of the frame + + + + Tests whether a vertex is a vertex of the outer triangle. + + the vertex to test + true if the vertex is an outer triangle vertex + + + + Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a + tolerance determined by the subdivision tolerance. + + a QuadEdge + a point + true if the vertex lies on the edge + + + + Tests whether a is the start or end vertex of a + , up to the subdivision tolerance distance. + + + + true if the vertex is a endpoint of the edge + + + + Gets the unique es in the subdivision, + including the frame vertices if desired. + + true if the frame vertices should be included + a collection of the subdivision vertices + + + + + Gets a collection of s whose origin + vertices are a unique set which includes + all vertices in the subdivision. + The frame vertices can be included if required. + + + This is useful for algorithms which require traversing the + subdivision starting at all vertices. + Returning a quadedge for each vertex + is more efficient than + the alternative of finding the actual vertices + using and then locating + quadedges attached to them. + + true if the frame vertices should be included + a collection of QuadEdge with the vertices of the subdivision as their origins + + + + Gets all primary quadedges in the subdivision. + A primary edge is a + which occupies the 0'th position in its array of associated quadedges. + These provide the unique geometric edges of the triangulation. + + true if the frame edges are to be included + a List of QuadEdges + + + + The quadedges forming a single triangle. + Only one visitor is allowed to be active at a + time, so this is safe. + + + + + Stores the edges for a visited triangle. Also pushes sym (neighbour) edges + on stack to visit later. + + + + + + the visited triangle edges,
+ or null if the triangle should not be visited (for instance, if it is outer) +
+
+ + + Gets a list of the triangles + in the subdivision, specified as + an array of the primary quadedges around the triangle. + + true if the frame triangles should be included + a List of QuadEdge[3] arrays + + + + Gets a list of the triangles in the subdivision, + specified as an array of the triangle es. + + true if the frame triangles should be included + a List of Vertex[3] arrays + + + + Gets the coordinates for each triangle in the subdivision as an array. + + true if the frame triangles should be included + a list of Coordinate[4] representing each triangle + + + + Gets the geometry for the edges in the subdivision as a + containing 2-point lines. + + the GeometryFactory to use + a IMultiLineString + + + + Gets the geometry for the triangles in a triangulated subdivision as a + of triangular s. + + the GeometryFactory to use + a GeometryCollection of triangular Polygons + + + + Gets the cells in the Voronoi diagram for this triangulation. + The cells are returned as a of s + + + The userData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a GeometryCollection of Polygons + + + + Gets a List of s for the Voronoi cells + of this triangulation. + + + The UserData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a List of Polygons + + + + Gets the Voronoi cell around a site specified + by the origin of a QuadEdge. + + + The userData of the polygon is set to be the + of the site. This allows attaching external + data associated with the site to this cell polygon. + + a quadedge originating at the cell site + a factory for building the polygon + a polygon indicating the cell extent + + + + Gets the vertex-equality tolerance value + used in this subdivision + + Gets the tolerance value + + + + Gets the envelope of the Subdivision (including the frame). + + Gets the envelope + + + + A TriangleVisitor which computes and sets the + circumcentre as the origin of the dual + edges originating in each triangle. + + mbdavis + + + + Models a triangle formed from s in a + which forms a triangulation. The class provides methods to access the + topological and geometric properties of the triangle and its neighbours in + the triangulation. Triangle vertices are ordered in CCW orientation in the + structure. + + + QuadEdgeTriangles support having an external data attribute attached to them. + Alternatively, this class can be subclassed and attributes can + be defined in the subclass. Subclasses will need to define + their own BuilderVisitor class + and CreateOn method. + + Martin Davis + 1.0 + + + + Creates s for all facets of a + representing a triangulation. + The data attributes of the s in the subdivision + will be set to point to the triangle which contains that edge. + This allows tracing the neighbour triangles of any given triangle. + + The QuadEdgeSubdivision to create the triangles on. + A List of the created QuadEdgeTriangles + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 Vertexes + the point to test + true if the point is contained in the triangle + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 QuadEdges + the point to test + true if the point is contained in the triangle + + + + Creates a new triangle from the given edges. + + An array of the edges of the triangle in CCW order + + + + Gets the vertices for this triangle. + + a new array containing the triangle vertices + + + + Gets the index for the given edge of this triangle + + a QuadEdge + the index of the edge in this triangle,
+ or -1 if the edge is not an edge of this triangle +
+
+ + + Gets the index for the edge that starts at vertex v. + + the vertex to find the edge for + the index of the edge starting at the vertex,
+ or -1 if the vertex is not in the triangle +
+
+ + + Tests whether this triangle is adjacent to the outside of the subdivision. + + true if the triangle is adjacent to the subdivision exterior + + + + Gets the triangles which are adjacent (include) to a + given vertex of this triangle. + + The vertex to query + A list of the vertex-adjacent triangles + + + + Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is + null + + an array containing the 3 neighbours of this triangle + + + + Gets or sets the external data value for this triangle. + + + + + Gets all edges which are incident on the origin of the given edge. + + the edge to start at + a List of edges which have their origin at the origin of the given + edge + + + + Algorithms for computing values and predicates + associated with triangles. + + + For some algorithms extended-precision + implementations are provided, which are more robust + (i.e. they produce correct answers in more cases). + Also, some more robust formulations of + some algorithms are provided, which utilize + normalization to the origin. + + Martin Davis + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + However, by using normalization to the origin + it provides improved robustness and increased performance. + Based on code by J.R.Shewchuk. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the + triangle is oriented counterclockwise. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This method uses more robust computation. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness, but a faster approach. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + a vertex of the triangle + a vertex of the triangle + a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + + + + + + + + + + + Computes the inCircle test using distance from the circumcentre. + Uses standard double-precision arithmetic. + + + In general this doesn't + appear to be any more robust than the standard calculation. However, there + is at least one case where the test point is far enough from the + circumcircle that this test gives the correct answer. +
+            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
+            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
+            
+
+ A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + The area of a triangle defined by the points a, b and c +
+ + + Checks if the computed value for isInCircle is correct, using + double-double precision arithmetic. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + + + + + Creates a new instance for the given ordinates. + + + + + Creates a new instance for the given ordinates, with associated external data. + + + + + Creates a new instance for the given points, with associated external data. + + the start point + the end point + an external data object + + + + Creates a new instance for the given points. + + the start point + the end point + + + + Determines whether two segments are topologically equal. + I.e. equal up to orientation. + + a segment + true if the segments are topologically equal + + + + Computes the intersection point between this segment and another one. + + a segment + the intersection point, or null if there is none + + + + Computes a string representation of this segment. + + a string + + + + Gets the start coordinate of the segment + + a Coordinate + + + + Gets the end coordinate of the segment + + a Coordinate + + + + Gets the start X ordinate of the segment + + the X ordinate value + + + + Gets the start Y ordinate of the segment + + the Y ordinate value + + + + Gets the start Z ordinate of the segment + + the Z ordinate value + + + + Gets the end X ordinate of the segment + + the X ordinate value + + + + Gets the end Y ordinate of the segment + + he Y ordinate value + + + + Gets the end Z ordinate of the segment + + the Z ordinate value + + + + Gets a LineSegment modelling this segment. + + a LineSegment + + + + Gets or sets the external data associated with this segment + + a data object + + + + Models a constraint segment which can be split in two in various ways, + according to certain geometric constraints. + + Martin Davis + + + + Computes the {@link Coordinate} that lies a given fraction along the line defined by the + reverse of the given segment. A fraction of 0.0 returns the end point of the + segment; a fraction of 1.0 returns the start point of the segment. + + the LineSegment + the fraction of the segment length along the line + the point at that distance + + + + Creates a map between the vertex s of a + set of s, + and the parent geometry, and transfers the source geometry + data objects to geometry components tagged with the coordinates. + + + This class can be used in conjunction with + to transfer data objects from the input site geometries + to the constructed Voronoi polygons. + + Martin Davis + + + + + Input is assumed to be a multiGeometry + in which every component has its userData + set to be a Coordinate which is the key to the output data. + The Coordinate is used to determine + the output data object to be written back into the component. + + + + + + A utility class which creates Voronoi Diagrams + from collections of points. + The diagram is returned as a of s, + representing the faces of the Voronoi diagram. + /// The faces are clipped to the larger of: + + + an envelope supplied by . + + + an envelope determined by the input sites. + + + The userData attribute of each face Polygon is set to + the Coordinate of the corresponding input site. + This allows using a Map to link faces to data associated with sites. + + Martin Davis + + + + Sets the sites (point or vertices) which will be diagrammed. + All vertices of the given geometry will be used as sites. + + geom the geometry from which the sites will be extracted. + + + + Sets the sites (point or vertices) which will be diagrammed + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed diagram. + + the subdivision containing the triangulation + + + + Gets the faces of the computed diagram as a + of s, clipped as specified. + + The attribute of each face is set to + the Coordinate of the corresponding input site. + This allows using a to link faces to data associated with sites. + + the geometry factory to use to create the output + a containg the face s of the diagram + + + + Sets the envelope to clip the diagram to. + The diagram will be clipped to the larger + of this envelope or an envelope surrounding the sites. + + the clip envelope. + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + tolerance the tolerance distance to use + + + + An alternative implementation of the priority queue abstract data type. + This allows us to do more than , which we + got from JTS. Ultimately, this queue enables scenarios that have more + favorable execution speed characteristics at the cost of less favorable + memory and usability characteristics. + + + The type of the priority for each queue node. + + + The type of data stored in the queue. + + + When enumerating over the queue, note that the elements will not be in + sorted order. To get at the elements in sorted order, use the copy + constructor and repeatedly elements from it. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to + copy from. + + + is . + + + + + Removes all nodes from this queue. + + + + + Determines whether the given node is contained within this queue. + + + The node to locate in the queue. + + + if is found in the + queue, otherwise . + + + + + Adds a given node to the queue with the given priority. + + + The node to add to the queue. + + + The priority for the node. + + + is . + + + + + Removes and returns the head of the queue. + + + The removed element. + + + + + Changes the priority of the given node. + + + The node whose priority to change. + + + The new priority for the node. + + + is . + + + + + Removes the given node from this queue if it is present. + + + The node to remove if present. + + + A value indicating whether the node was removed. + + + + + + + + + + + Gets the number of nodes currently stored in this queue. + + + + + Gets the node at the head of the queue. + This is the node whose compares + less than or equal to the priority of all other nodes in the queue. + + + + + A container for a prioritized node that sites in an + . + + + The type to use for the priority of the node in the queue. + + + The type to use for the data stored by the node in the queue. + + + + + Initializes a new instance of the class. + + + The to store in this node. + + + + + Gets the that is stored in this node. + + + + + Gets the of this node in the queue. + + + The queue may update this priority while the node is still in the queue. + + + + + Gets or sets the index of this node in the queue. + + + This should only be read and written by the queue itself. + It has no "real" meaning to anyone else. + + + + + A utility for making programming assertions. + + + + + + + + + + + + + + + + + + + + + A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. + + + + + + + + + + + + + + + + + + + Static utility class for casting objects + + + + + Cast function from arbitrary-type to + + The output type + The sequence of items to cast. + as an enumerable of + Thrown if cast cannot be performed + + + + Cast function from sub-type to super-type + + The output (super/base) type + The input (sub/derived) type + The sequence of items to cast. + as an enumerable of + + + + Cast function from super-type to sub-type + + The input (sub/derived) type + The output (super/base) type + The sequence of items to cast. + as an enumerable of + + + + Executes a transformation function on each element of a collection + and returns the results in a new List. + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Copies s in an array to an object array + + + + the source array + An array of objects + + + + + + + + + + + + + + + + + + + + + A CoordinateFilter that creates an array containing every coordinate in a Geometry. + + + + + Constructs a CoordinateArrayFilter. + + The number of points that the CoordinateArrayFilter will collect. + + + + + + + + + + Returns the Coordinates collected by this CoordinateArrayFilter. + + + + + CoordinateCompare is used in the sorting of arrays of Coordinate objects. + Implements a lexicographic comparison. + + + + + Compares two object and returns a value indicating whether one is less than, equal to or greater + than the other. + + First Coordinate object to compare. + Second Coordinate object to compare. + + <table cellspacing="0" class="dtTABLE"> + <TR VALIGN="top"> + <TH width=50%>Value</TH> + <TH width=50%>Condition</TH> + </TR> + <TR VALIGN="top"> + <TD width=50%>Less than zero</TD> + <TD width=50%><I>a</I> is less than <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Zero</TD> + <TD width=50%><I>a</I> equals <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Greater than zero</TD> + <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> + </TR> + </table> + + If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b + implements IComparable, then b. CompareTo (a) is returned. + Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not + generate an exception when using IComparable. When sorting, a null reference (Nothing) is + considered to be less than any other object. + + + + + A CoordinateFilter that counts the total number of coordinates + in a Geometry. + + + + + + + + + + + Returns the result of the filtering. + + + + + Converts degrees to radians. + + + + + Converts degrees to radians. + + The angle in degrees. + The angle in radians. + + + + + + + + + Only static methods! + + + + + Convert the given numeric value (passed as string) of the base specified by baseIn + to the value specified by baseOut. + + Numeric value to be converted, as string. + Base of input value. + Base to use for conversion. + Converted value, as string. + + + + + + + + + + + + + + + + + + + + + + + + + Utility functions to report memory usage. + + mbdavis + + + + A priority queue over a set of objects. + + Objects to add + Martin Davis + + + Insert into the priority queue. Duplicates are allowed. + + The item to insert. + + + + Test if the priority queue is logically empty. + + true if empty, false otherwise. + + + + Make the priority queue logically empty. + + + + + Remove the smallest item from the priority queue. + + The smallest item, or default(T) if empty. + + + + Returns size. + + + + + Converts radians to degress. + + + + + Converts radians to degress. + + Angle in radians. + The angle in degrees. + + + + + + + + + + + + + + + + + Buffer for characters. This approximates StringBuilder + but is designed to be faster for specific operations. + This is about 30% faster for the operations I'm interested in + (Append, Clear, Length, ToString). + This trades off memory for speed. + + + To make Remove from the head fast, this is implemented + as a ring buffer. + This uses head and tail indices into a fixed-size + array. This will grow the array as necessary. + + + + + Default constructor. + + + + + Construct with a specific capacity. + + + + + + Reallocate the buffer to be larger. For the new size, this + uses the max of the requested length and double the current + capacity. + This does not shift, meaning it does not change the head or + tail indices. + + The new requested length. + + + + Ensure that we're set for the requested length by + potentially growing or shifting contents. + + + + + + Move the buffer contents such that headIndex becomes 0. + + + + + Overwrite this object's underlying buffer with the specified + buffer. + + The character array. + The number of characters to consider filled + in the input buffer. + + + + Append a character to this buffer. + + + + + + Append a string to this buffer. + + The string to append. + + + + Append a string to this buffer. + + The string to append. + + + + Remove a character at the specified index. + + The index of the character to remove. + + + + + Remove a specified number of characters at the specified index. + + The index of the characters to remove. + The number of characters to remove. + + + + Find the first instance of a character in the buffer, and + return its index. This returns -1 if the character is + not found. + + The character to find. + The index of the specified character, or -1 + for not found. + + + + Empty the buffer. + + + + + Return the current contents as a string. + + The new string. + + + + Gets/Sets the number of characters in the character buffer. + Increasing the length this way provides indeterminate results. + + + + + Returns the capacity of this character buffer. + + + + + Indexer. + + + + + Exception class for unterminated tokens. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated quotes. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated block comments. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Bitwise enumeration for character types. + + + + word characters (usually alpha, digits, and domain specific) + + + # or something for line comments + + + whitespace + + + ' or " type + + + usually 0 to 9 + + + usually 0 to 9, a-f and A-F + + + eof char + + + + This contains the settings that control the behavior of the tokenizer. + This is separated from the StreamTokenizer so that common settings + are easy to package and keep together. + + + + + Default constructor. + + + + + Copy constructor. + + + + + Sets this object to be the same as the specified object. + Note that some settings which are entirely embodied by the character + type table. + + + + + Setup default parse behavior. + This resets to same behavior as on construction. + + bool - true for success. + + + + Apply settings which are commonly used for code parsing + C-endCapStyle code, including C++, C#, and Java. + + + + + + Clear the character type settings. This leaves them unset, + as opposed to the default. Use SetDefaults() for default + settings. + + + + + Specify that a particular character is a word character. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + The character. + + + + Specify that a range of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + First character. + Last character. + + + + Specify that a string of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + + + + + Specify that a character is a whitespace character. + Character table type manipulation method. + This type is exclusive with other types. + + The character. + + + + Specify that a range of characters are whitespace characters. + Character table type manipulation method. + This adds the characteristic to the char(s), rather + than overwriting other characteristics. + + First character. + Last character. + + + + Remove other type settings from a range of characters. + Character table type manipulation method. + + + + + + + Remove other type settings from a character. + Character table type manipulation method. + + + + + + Specify that a particular character is a comment-starting character. + Character table type manipulation method. + + + + + + Specify that a particular character is a quote character. + Character table type manipulation method. + + + + + + Return a string representation of a character type setting. + Since the type setting is bitwise encoded, a character + can have more than one type. + + The character type byte. + The string representation of the type flags. + + + + Check whether the specified char type byte has a + particular type flag set. + + The char type byte. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + This is the character type table. Each byte is bitwise encoded + with the character attributes, such as whether that character is + word or whitespace. + + + + + Whether or not to return whitespace tokens. If not, they're ignored. + + + + + Whether or not to return EolTokens on end of line. Eol tokens will not + break up other tokens which can be multi-line. For example block comments + and quotes will not be broken by Eol tokens. Therefore the number of + Eol tokens does not give you the line count of a stream. + + + + + Whether or not to look for // comments + + + + + Whether or not to look for /* */ block comments. + + + + + Whether or not to return comments. + + + + + Whether or not to check for unterminated quotes and block comments. + If true, and one is encoutered, an exception is thrown of the appropriate type. + + + + + Whether or not digits are specified as Digit type in the + character table. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + This setting may become incorrect if you modify the character + types table directly. + + + + + Whether or not to parse Hex (0xABCD...) numbers. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + + + + + A StreamTokenizer similar to Java's. This breaks an input stream + (coming from a TextReader) into Tokens based on various settings. The settings + are stored in the TokenizerSettings property, which is a + StreamTokenizerSettings instance. + + + + This is configurable in that you can modify TokenizerSettings.CharTypes[] array + to specify which characters are which type, along with other settings + such as whether to look for comments or not. + + + WARNING: This is not internationalized. This treats all characters beyond + the 7-bit ASCII range (decimal 127) as Word characters. + + + There are two main ways to use this: 1) Parse the entire stream at + once and get an ArrayList of Tokens (see the Tokenize* methods), + and 2) call NextToken() successively. + This reads from a TextReader, which you can set directly, and this + also provides some convenient methods to parse files and strings. + This returns an Eof token if the end of the input is reached. + + + Here's an example of the NextToken() endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer(); + tokenizer.GrabWhitespace = true; + tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging + tokenizer.TextReader = File.OpenText(fileName); + Token token; + while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); + + + + Here's an example of the Tokenize... endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer("some string"); + ArrayList tokens = new ArrayList(); + if (!tokenizer.Tokenize(tokens)) + { + // error handling + } + foreach (Token t in tokens) Console.WriteLine("t = {0}", t); + + + + Comment delimiters are hardcoded (// and /*), not affected by char type table. + + + This sets line numbers in the tokens it produces. These numbers are normally + the line on which the token starts. + There is one known caveat, and that is that when GrabWhitespace setting + is true, and a whitespace token contains a newline, that token's line number + will be set to the following line rather than the line on which the token + started. + + + + + + This is the number of characters in the character table. + + + + + Default constructor. + + + + + Construct and set this object's TextReader to the one specified. + + The TextReader to read from. + + + + Construct and set a string to tokenize. + + The string to tokenize. + + + + Utility function, things common to constructors. + + + + + Clear the stream settings. + + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + The state. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + Exclude this state from the possible next state. + The state. + + + + Read the next character from the stream, or from backString + if we backed up. + + The next character. + + + + Get the next token. The last token will be an EofToken unless + there's an unterminated quote or unterminated block comment + and Settings.DoUntermCheck is true, in which case this throws + an exception of type StreamTokenizerUntermException or sub-class. + + The output token. + bool - true for success, false for failure. + + + + Starting from current stream location, scan forward + over an int. Determine whether it's an integer or not. If so, + push the integer characters to the specified CharBuffer. + If not, put them in backString (essentially leave the + stream as it was) and return false. + + If it was an int, the stream is left 1 character after the + end of the int, and that character is output in the thisChar parameter. + + The formats for integers are: 1, +1, and -1 + The + and - signs are included in the output buffer. + + The CharBuffer to append to. + Whether or not to consider + to be part + of an integer. + The last character read by this method. + true for parsed an int, false for not an int + + + + Parse the rest of the stream and put all the tokens + in the input ArrayList. This resets the line number to 1. + + The ArrayList to append to. + bool - true for success + + + + Parse all tokens from the specified TextReader, put + them into the input ArrayList. + + The TextReader to read from. + The ArrayList to append to. + bool - true for success, false for failure. + + + + Parse all tokens from the specified file, put + them into the input ArrayList. + + The file to read. + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Tokenize a file completely and return the tokens in a Token[]. + + The file to tokenize. + A Token[] with all tokens. + + + + Parse all tokens from the specified string, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Parse all tokens from the specified Stream, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + This is the TextReader that this object will read from. + Set this to set the input reader for the parse. + + + + + The settings which govern the behavior of the tokenization. + + + + + The states of the state machine. + + + + + Token class used by StreamTokenizer. + This represents a single token in the input stream. + This is subclassed to provide specific token types, + such as CharToken, FloatToken, etc. + + + + + The line number in the input stream where this token originated. + This is base-1. + + + + + A storage object for the data of this token. + + + + + Backer for UntermError. + + + + An error message associated with unterm error. + + + + Construct a Token with the specified line number. + + The line number where this + token comes from. + + + + Equals override. + + The object to compare to. + bool - true for equals, false otherwise. + + + + Equals overload. + + The string to compare to. + bool + + + + Equals overload. + + The char to compare to. + bool + + + + Operator== overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator!= overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator== overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator!= overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator== overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Operator!= overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Override. Returns the ToString().GetHashCode(). + + The hash code. + + + + Produce a string which includes the line number. + + + + + + Produce a string which includes the token type. + + + + + + Create an object of the specified type corresponding to + this token. + + The type of object to create. + The new object, or null for error. + + + + The line number where this token was found. This is base-1. + + + + + The Object stored by this token. This will be + a primitive C# type. + + + + + Whether or not there was an unterminated token problem + when creating this token. See UntermErrorMessage for + a message associated with the problem. + + + + + The error message if there was an unterminated token error + creating this token. + + + + + Return this token's value as a string. + + This token's value as a string. + + + + Represents end-of-lines (line separator characters). + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Represents end of file/stream. + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Abstract base class for string tokens. + + + + Default constructor. + + + Constructor with the specified value + and line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for words, meaning sequences of word + characters. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for Quotes such as "this is a quote". + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for comments, including line and block + comments. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for whitespace such as spaces and tabs. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for characters, meaning non-word characters. + + + + Constructor with the specified value + and line number. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for floating point numbers, stored internally as a Double. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value and line number. + + + + + Constructor with the specified value and line number. + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Token type for integer tokens. This handles both Int32 and Int64. + + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + Constructor with the specified value + and line number. + + + + Constructor for a 64 bit int + + + + + Parse a string known to be a hex string. This is faster + than Parse which doesn't assume the number is Hex. This will + throw an exception if the input number isn't hex. + + The hex number as a string. + The line where this token was found. + A new IntToken set to the value in the input string. + + + + Convert the input string to an integer, if possible + + The string to parse. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + This enumerates verbosity levels. + + + + For error messages. + + + For warn messages. + + + For info messages. + + + For debug messages. + + + + Framework replacement for string.IsNullOrWhitespace + + The string to test + A value indicating if is null, empty or only contains whitespace characters + + + + A CoordinateFilter that builds a set of Coordinates. + The set of coordinates contains no duplicate points. + + + + + Convenience method which allows running the filter over an array of s. + + an array of coordinates + an array of the unique coordinates + + + + + + + + + + Returns the gathered s. + + + + + An algorithm for computing a distance metric + which is an approximation to the Hausdorff Distance + based on a discretization of the input . + + + + The algorithm computes the Hausdorff distance restricted to discrete points + for one of the geometries. + The points can be either the vertices of the geometries (the default), + or the geometries with line segments densified by a given fraction. + Also determines two points of the Geometries which are separated by the computed distance. + + + This algorithm is an approximation to the standard Hausdorff distance. + Specifically, + + for all geometries a, b: DHD(a, b) <= HD(a, b) + + The approximation can be made as close as needed by densifying the input geometries. + In the limit, this value will approach the true Hausdorff distance: + + DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 + + The default approximation is exact or close enough for a large subset of useful cases. + + + Examples of these are: + + + computing distance between Linestrings that are roughly parallel to each other, + and roughly equal in length. This occurs in matching linear networks. + + Testing similarity of geometries. + + + + An example where the default approximation is not close is: + + A = LINESTRING (0 0, 100 0, 10 100, 10 100) + B = LINESTRING (0 100, 0 10, 80 10) + + DHD(A, B) = 22.360679774997898 + HD(A, B) ~= 47.8 + + + + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The Discrete Hausdorff Distance + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The densify fraction. A value of 0 indicates, that no densification should take place + The Discrete Hausdorff Distance + + + Value of 0.0 indicates that no densification should take place + + + + Gets/sets the fraction by which to densify each segment. + + + Each segment will be (virtually) split into a number of equal-length + subsegments, whose fraction of the total length is closest + to the given fraction. + + +
+
Index: packages/NetTopologySuite.1.14/lib/net45/PowerCollections.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/net45/PowerCollections.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/net45/PowerCollections.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/net45/PowerCollections.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,11141 @@ + + + + PowerCollections + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Makes a deep clone of this Deque. A new Deque is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the Deque takes time O(N), where N is the number of items in the Deque. + The cloned Deque. + T is a reference type that does not implement ICloneable. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Serialize the hash table. Called from the serialization infrastructure. + + + + + Called on deserialization. We cannot deserialize now, because hash codes + might not be correct now. We do real deserialization in the OnDeserialization call. + + + + + Deserialize the hash table. Called from the serialization infrastructure when + the object graph has finished deserializing. + + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N log N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Makes a deep clone of this BigList. A new BigList is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then this method is the same as Clone. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + +
+
Index: packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.Bootstrapper.NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.Bootstrapper.NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.Bootstrapper.NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/GeoAPI.Bootstrapper.NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,18 @@ + + + + GeoAPI.Bootstrapper.NetTopologySuite + + + + + A utility class to register NTS as GeoAPI implementation to use + + + + + Method to register NTS as GeoAPI implementation to use. + + + + Index: packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/NetTopologySuite.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/NetTopologySuite.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/NetTopologySuite.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/NetTopologySuite.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,34076 @@ + + + + NetTopologySuite + + + + + Delegate to convert from a to a + + The coordinate sequence + The converted coordinate sequence + + + + Utility class for storing coordinates + + + This class may be useful for other IO classes as well + + + + + Creates an instance of this class + + + + + Creates an instance of this class with defining the values that should be treated as null. + + The value that should be treated as null. + This optional parameter controls whether a value has to be less than to be considered null + + + + Creates an instance of this class with an inital + + The inital capacity of the buffer. + + + + Creates an instance of this class with an inital + + The inital capacity of the buffer. + The value that should be treated as null. + This optional parameter controls whether a value has to be less than to be considered null + + + + Updates the flags + + The z-Ordinate + The m-Ordinate + + + + Adds a coordinate made up of the ordinates (x, y, z, m) to the buffer. + + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully added. + + + + Method to add a marker + + + + + Inserts a coordinate made up of the ordinates (, , , ) at index to the buffer. + + The index at which to insert the ordinate. + The x-Ordinate + The y-Ordinate + The (optional) z-Ordinate + The (optional) m-Ordinate + Allows repated coordinates to be added + true if the coordinate was successfully inserted. + + + + Clears the contents of this buffer + + + + + Convertes the contents of the buffer to an array of s + + An array of s + + + + Converts the contents of this to a coordinate sequence using the provided . + + The converter to use + A coordinate sequence + + + + Converts the contents of this to a coordinate sequence. + + A coordinate sequence + + + + Converts the contents of this to a coordinate sequence. + + A coordinate sequence + + + + Sets a z-value at the provided + + The index + The value + + + + Sets a m-value at the provided + + The index + The value + + + + Converts the contents of this to an array of and values. + + An array of s + + + + Converts the contents of this to an array of and values. + Additionally an array of values is supplied if this instance property is true + + An array of s + + + + Converts the contents of this to an array of and values. + Additionally an array of values is supplied if this instance property is true + + An array of s + + + + Converts the contents of this to an array of and values. + Additionally an array of and one of values is supplied if this instance and or property is true + + An array of s + + + + Converts the contents of this to an array of values. + + The number of dimensions and an array of s + + + + Converts the contents of this to an array of values. + + The number of dimensions and an array of s + + + + Checks of is equal to this. + + The coordinate buffer to test. + true if the coordinates in this buffer match those of other. + + + + Checks a coordinate sequence for equality with this + + The coordinate sequence to test + true if the coordinates in the coordinate sequence are equal to those in this buffer. + + + + Creates a coordinate sequence, that has all possibly repeated points removed + + Controls if z- and m-values are to be considered in the equality check. + A coordinate buffer without repeated points + + + + Gets or sets the used to create a coordinate sequence from the coordinate data in the buffer. + + + + + Gets the number of coordinates added to the buffer + + + + + Gets the defined ordinates in this buffer + + + + + Gets the number of dimension a coordinate sequence must provide + + + + + Gets a value indicating if this buffer contains any z-ordinate values + + + + + Gets a value indicating if this buffer contains any m-ordinate values + + + + + Gets the (current) capacity of the buffer + + + + + Utility to check values for a defined null/no-data-value + + + + + Initializes this stucture with a + + The value that is to be treated as null + This optional parameter controls whether a value has to be less than to be considered null + + + + Checks if doesn't satisfy null-check + + The value to check + true if is not equal to + + + + Checks if does satisfy null-check + + The value to check + true if is equal to + + + + Gets the defined null value + + + + + Base class for all ICRSObject implementing types + + + + + Base Interface for CRSBase Object types. + + + + + Gets the CRS type. + + + + + Gets the type of the CRSBase object. + + + + + Gets the properties. + + + + + Defines the GeoJSON Coordinate Reference System Objects (CRS) types as defined in the geojson.org v1.0 spec. + + + + + Defines the Named CRS type. + + + + + Defines the Linked CRS type. + + + + + Defines the Linked CRS type. + + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Initializes a new instance of the class. + + The mandatory href member must be a dereferenceable URI. + The optional type member will be put in the properties Dictionary as specified in the GeoJSON spec. + + + + Defines the Named CRS type. + + + + + Initializes a new instance of the class. + + + The mandatory name + member must be a string identifying a coordinate reference system. OGC CRS URNs such as + 'urn:ogc:def:crs:OGC:1.3:CRS84' shall be preferred over legacy identifiers such as 'EPSG:4326'. + + + + + A graph containing s. + + + + + A graph comprised of s. + It supports tracking the vertices in the graph + via edges incident on them, + to allow efficient lookup of edges and vertices. + + + This class may be subclassed to use a + different subclass of HalfEdge, + by overriding . + If additional logic is required to initialize + edges then + can be overridden as well. + + + + + Creates a single HalfEdge. + Override to use a different HalfEdge subclass. + + the origin location + a new with the given origin + + + + Adds an edge between the coordinates orig and dest + to this graph. + + + Only valid edges can be added (in particular, zero-length segments cannot be added) + + the edge origin location + the edge destination location + The created edge + null if the edge was invalid and not added + + + + + Test if an the coordinates for an edge form a valid edge (with non-zero length) + + The start coordinate + The end coordinate + true of the edge formed is valid + + + + Inserts an edge not already present into the graph. + + the edge origin location + the edge destination location + an existing edge with same orig (if any) + the created edge + + + + Finds an edge in this graph with the given origin + and destination, if one exists. + + the origin location + the destination location + an edge with the given orig and dest, or null if none exists + + + + A HalfEdge which carries information + required to support . + + + + + A which supports + marking edges with a boolean flag. + Useful for algorithms which perform graph traversals. + + + + + Represents a directed component of an edge in an . + HalfEdges link vertices whose locations are defined by s. + HalfEdges start at an origin vertex, + and terminate at a destination vertex. + HalfEdges always occur in symmetric pairs, with the method + giving access to the oppositely-oriented component. + HalfEdges and the methods on them form an edge algebra, + which can be used to traverse and query the topology + of the graph formed by the edges. + + + By design HalfEdges carry minimal information + about the actual usage of the graph they represent. + They can be subclassed to carry more information if required. + + + HalfEdges form a complete and consistent data structure by themselves, + but an is useful to allow retrieving edges + by vertex and edge location, as well as ensuring + edges are created and linked appropriately. + + + + + Creates a HalfEdge pair representing an edge + between two vertices located at coordinates p0 and p1. + + a vertex coordinate + a vertex coordinate + the HalfEdge with origin at p0 + + + + Initialize a symmetric pair of HalfEdges. + Intended for use by subclasses. + The edges are initialized to have each other + as the edge, and to have pointers + which point to edge other. + This effectively creates a graph containing a single edge. + + a HalfEdge + a symmetric HalfEdge + the initialized edge e0 + + + + Creates an edge originating from a given coordinate. + + the origin coordinate + + + + Finds the edge starting at the origin of this edge + with the given dest vertex, if any. + + the dest vertex to search for + + the edge with the required dest vertex, + if it exists, or null + + + + + Tests whether this edge has the given orig and dest vertices. + + the origin vertex to test + the destination vertex to test + true if the vertices are equal to the ones of this edge + + + + Inserts an edge + into the ring of edges around the origin vertex of this edge. + The inserted edge must have the same origin as this edge. + + the edge to insert + + + + Insert an edge with the same origin after this one. + Assumes that the inserted edge is in the correct + position around the ring. + + the edge to insert (with same origin) + + + + Compares edges which originate at the same vertex + based on the angle they make at their origin vertex with the positive X-axis. + This allows sorting edges around their origin vertex in CCW order. + + + + + Implements the total order relation. + The angle of edge a is greater than the angle of edge b, + where the angle of an edge is the angle made by + the first segment of the edge with the positive x-axis. + When applied to a list of edges originating at the same point, + this produces a CCW ordering of the edges around the point. + Using the obvious algorithm of computing the angle is not robust, + since the angle calculation is susceptible to roundoff error. + + + A robust algorithm is: + 1. compare the quadrants the edge vectors lie in. + If the quadrants are different, + it is trivial to determine which edge has a greater angle. + 2. If the vectors lie in the same quadrant, the + function + can be used to determine the relative orientation of the vectors. + + + + + Computes a string representation of a HalfEdge. + + + + + Computes the degree of the origin vertex. + The degree is the number of edges + originating from the vertex. + + the degree of the origin vertex + + + + Finds the first node previous to this edge, if any. + If no such node exists (i.e the edge is part of a ring) + then null is returned. + + + an edge originating at the node prior to this edge, if any, + or null if no node exists + + + + + Gets the origin coordinate of this edge. + + + + + Gets the destination coordinate of this edge. + + + + + Gets the symmetric pair edge of this edge. + + + + + Gets the next edge CCW around the + destination vertex of this edge. + If the vertex has degree 1 then this is the sym edge. + + + + + Returns the edge previous to this one + (with dest being the same as this orig). + + + + + The X component of the distance between the orig and dest vertices. + + + + + The Y component of the distance between the orig and dest vertices. + + + + + Sets the mark for the given edge pair to a boolean value. + + an edge of the pair to update + the mark value to set + + + + Marks the edges in a pair. + + an edge of the pair to mark + + + + Creates a new marked edge. + + the coordinate of the edge origin + + + + Marks this edge. + + + + + Sets this edge to be the start segment of an input LineString. + + + + + Tests whether this edge is the starting segment + in a LineString being dissolved. + + true if this edge is a start segment + + + + Dissolves the linear components + from a collection of s. + into a set of maximal-length s + in which every unique segment appears once only. + The output linestrings run between node vertices + of the input, which are vertices which have + either degree 1, or degree 3 or greater. + + + Use cases for dissolving linear components + include generalization + (in particular, simplifying polygonal coverages), + and visualization + (in particular, avoiding symbology conflicts when + depicting shared polygon boundaries). + + + This class does NOT node the input lines. + If there are line segments crossing in the input, + they will still cross in the output. + + + + + Dissolves the linear components in a geometry. + + the geometry to dissolve + the dissolved lines + + + + Adds a to be dissolved. + Any number of geometries may be adde by calling this method multiple times. + Any type of Geometry may be added. The constituent linework will be + extracted to be dissolved. + + geometry to be line-merged + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + the geometries to be line-merged + + + + Gets the dissolved result as a . + + the dissolved lines + + + + For each edge in stack + (which must originate at a node) + extracts the line it initiates. + + + + + Updates the tracked ringStartEdge + if the given edge has a lower origin + (using the standard ordering). + + + Identifying the lowest starting node meets two goals: + * It ensures that isolated input rings are created using the original node and orientation. + * For isolated rings formed from multiple input linestrings, + it provides a canonical node and orientation for the output + (rather than essentially random, and thus hard to test). + + + + + + Builds a line starting from the given edge. + The start edge origin is a node (valence = 1 or >= 3), + unless it is part of a pure ring. + + + A pure ring has no other incident lines. + In this case the start edge may occur anywhere on the ring. + + + The line is built up to the next node encountered, + or until the start edge is re-encountered + (which happens if the edges form a ring). + + + + + + Adds edges around this node to the stack. + + + + + + Builds an edge graph from geometries containing edges. + + + + + Adds the edges of a Geometry to the graph. + May be called multiple times. + Any dimension of Geometry may be added; the constituent edges are extracted. + + geometry to be added + + + + Adds the edges in a collection of s to the graph. + May be called multiple times. + Any dimension of may be added. + + the geometries to be added + + + + Represents a feature collection. + + + + + Initializes a new instance of the class. + + The features. + + + + Initializes a new instance of the class. + + + + + Adds the specified feature. + + The feature. + + + + Removes the specified feature. + + The feature. + true if item is successfully removed; otherwise, false. This method also returns + false if item was not found in the collection. + + + + Removes the element at the specified index of the collection. + + The index. + + + + Gets the features. + + The features. + + + + Gets the (mandatory) type of the GeoJSON Object. + + + The type of the object. + + + + + Gets or sets the (optional) Coordinate Reference System Object. + + + The Coordinate Reference System Objects. + + + + + Returns the indexTh element in the collection. + + + + + + Returns the number of features contained by this . + + + + + A visitor for s in a index. + + 1.7 + + + + Visits a node. + + The node to visit + + + + Reads a sequence of s in WKT format from a text file. + + The geometries in the file may be separated by any amount of whitespace and newlines. + + Martin Davis + + + + + Creates a new , given a to read from. + + The stream to read from + The geometry reader to use + + + + Creates a new , given a to read with. + + The stream reader of the file to read from + The geometry reader to use + + + + Reads a sequence of geometries. + + + + If an offset is specified, geometries read up to the offset count are skipped. + If a limit is specified, no more than geometries are read. + + The list of geometries read + + + + Tests if reader is at EOF. + + + + + Gets/Sets the maximum number of geometries to read. + + + + + Gets/Sets the number of geometries to skip before reading. + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + + + + Processes possible intersections detected by a . + + + + The is passed to a . + + The + method is called whenever the + detects that two s might intersect. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + This class is an example of the Strategy pattern. + + This class may be used either to find all intersections, or + to detect the presence of an intersection. In the latter case, + Noders may choose to short-circuit their computation by calling the + property. + + + + + + This method is called by clients + of the interface to process + intersections for two segments of the s being intersected. + + + + + + + + + Reports whether the client of this class needs to continue testing + all intersections in an arrangement. + + if there is no need to continue testing segments + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a linestring (sequence of points) using the + Visvalingam-Whyatt algorithm. + The Visvalingam-Whyatt algorithm simplifies geometry + by removing vertices while trying to minimize the area changed. + + 1.7 + + + + Simplifies a using the Visvalingam-Whyatt area-based algorithm. + Ensures that any polygonal geometries returned are valid. Simple lines are not + guaranteed to remain simple after simplification. All geometry types are + handled. Empty and point geometries are returned unchanged. Empty geometry + components are deleted. + The simplification tolerance is specified as a distance. + This is converted to an area tolerance by squaring it. + + Known Bugs + * Not yet optimized for performance. + * Does not simplify the endpoint of rings. + To Do + * Allow specifying desired number of vertices in the output. + + + + Note that in general this algorithm does not preserve topology - e.g. polygons can be split, + collapse to lines or disappear holes can be created or disappear, and lines + can cross. + + 1.7 + + + + Simplifies a using a given tolerance. + + The to simplify. + The tolerance to use. + A simplified version of the . + + + + Creates a simplifier for a given . + + The to simplify. + + + + Gets the semplified . + + The semplified . + + + + Sets the distance tolerance for the simplification. All vertices in the + simplified will be within this distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" to have valid + topology. The caller may choose to disable this because: + * valid topology is not required. + * fixing topology is a relative expensive operation. + * in some pathological cases the topology fixing operation may either + fail or run for too long. + + The default is to fix polygon topology. + + + + A framework for processes which transform an input Geometry into + an output , possibly changing its structure and type(s). + + + + This class is a framework for implementing subclasses + which perform transformations on + various different Geometry subclasses. + + + It provides an easy way of applying specific transformations + to given point types, while allowing unhandled types to be simply copied. + Also, the framework handles ensuring that if subcomponents change type + the parent geometries types change appropriately to maintain valid structure. + Subclasses will override whichever TransformX methods + they need to to handle particular Geometry types. + + + A typically usage would be a transformation that may transform Polygons into + Polygons, LineStrings or Points, depending on the geometry of the input + (For instance, a simplification operation). + This class would likely need to override the + method to ensure that if input Polygons change type the result is a GeometryCollection, + not a MultiPolygon. + + The default behaviour of this class is simply to recursively transform + each Geometry component into an identical object by deep copying down + to the level of, but not including, coordinates. + + + Note that all TransformXXX methods may return null, + to avoid creating empty point objects. This will be handled correctly + by the transformer. TransformXXX methods should always return valid + geometry - if they cannot do this they should return null + (for instance, it may not be possible for a transformLineString implementation + to return at least two points - in this case, it should return null). + The method itself will always + return a non-null Geometry object (but this may be empty). + > + + + + + + + + + true if empty geometries should not be included in the result. + + + + + true if a homogenous collection result + from a GeometryCollection should still + be a general GeometryCollection. + + + + + true if the type of the input should be preserved. + + + + + + + + + + + + Convenience method which provides standard way of + creating a CoordinateSequence. + + The coordinate array to copy. + A coordinate sequence for the array. + + + + Convenience method which provides statndard way of copying {CoordinateSequence}s + + The sequence to copy. + A deep copy of the sequence. + + + + Transforms a . + This method should always return a valid coordinate list for + the desired result type. (E.g. a coordinate list for a LineString + must have 0 or at least 2 points). + If this is not possible, return an empty sequence - + this will be pruned out. + + The coordinates to transform + The parent geometry + The transformed coordinates + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Makes the input geometry available + + + + + Simplifies a , fixing it if required. + + + + + + + + Simplifies a . If the simplification results in a degenerate + ring, remove the component. + + + + null if the simplification results in a degenerate ring. + + + + Simplifies a , fixing it if required. + + + + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections. + A valid area geometry. + + + + An alternative implementation of the priority queue abstract data type. + This allows us to do more than , which we + got from JTS. Ultimately, this queue enables scenarios that have more + favorable execution speed characteristics at the cost of less favorable + memory and usability characteristics. + + + The type of the priority for each queue node. + + + The type of data stored in the queue. + + + When enumerating over the queue, note that the elements will not be in + sorted order. To get at the elements in sorted order, use the copy + constructor and repeatedly elements from it. + + + + + Initializes a new instance of the + class. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + + + Initializes a new instance of the + class. + + + The initial queue capacity. + + + The to use to compare priority values, + or to use the default comparer for the type. + + + is less than 1. + + + + + Initializes a new instance of the + class. + + + The to + copy from. + + + is . + + + + + Removes all nodes from this queue. + + + + + Determines whether the given node is contained within this queue. + + + The node to locate in the queue. + + + if is found in the + queue, otherwise . + + + + + Adds a given node to the queue with the given priority. + + + The node to add to the queue. + + + The priority for the node. + + + is . + + + + + Removes and returns the head of the queue. + + + The removed element. + + + + + Changes the priority of the given node. + + + The node whose priority to change. + + + The new priority for the node. + + + is . + + + + + Removes the given node from this queue if it is present. + + + The node to remove if present. + + + A value indicating whether the node was removed. + + + + + + + + + + + Gets the number of nodes currently stored in this queue. + + + + + Gets the node at the head of the queue. + This is the node whose compares + less than or equal to the priority of all other nodes in the queue. + + + + + A container for a prioritized node that sites in an + . + + + The type to use for the priority of the node in the queue. + + + The type to use for the data stored by the node in the queue. + + + + + Initializes a new instance of the class. + + + The to store in this node. + + + + + Gets the that is stored in this node. + + + + + Gets the of this node in the queue. + + + The queue may update this priority while the node is still in the queue. + + + + + Gets or sets the index of this node in the queue. + + + This should only be read and written by the queue itself. + It has no "real" meaning to anyone else. + + + + + Token class used by StreamTokenizer. + This represents a single token in the input stream. + This is subclassed to provide specific token types, + such as CharToken, FloatToken, etc. + + + + + The line number in the input stream where this token originated. + This is base-1. + + + + + A storage object for the data of this token. + + + + + Backer for UntermError. + + + + An error message associated with unterm error. + + + + Construct a Token with the specified line number. + + The line number where this + token comes from. + + + + Equals override. + + The object to compare to. + bool - true for equals, false otherwise. + + + + Equals overload. + + The string to compare to. + bool + + + + Equals overload. + + The char to compare to. + bool + + + + Operator== overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator!= overload. Compare a token and an object. + + The token to compare. + The other object. + bool + + + + Operator== overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator!= overload. Compare a token and a char. + + The token to compare. + The char. + bool + + + + Operator== overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Operator!= overload. Compare a token and a string. + + The token to compare. + The string. + bool + + + + Override. Returns the ToString().GetHashCode(). + + The hash code. + + + + Produce a string which includes the line number. + + + + + + Produce a string which includes the token type. + + + + + + Create an object of the specified type corresponding to + this token. + + The type of object to create. + The new object, or null for error. + + + + The line number where this token was found. This is base-1. + + + + + The Object stored by this token. This will be + a primitive C# type. + + + + + Whether or not there was an unterminated token problem + when creating this token. See UntermErrorMessage for + a message associated with the problem. + + + + + The error message if there was an unterminated token error + creating this token. + + + + + Return this token's value as a string. + + This token's value as a string. + + + + Represents end-of-lines (line separator characters). + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Represents end of file/stream. + + + + Default constructor. + + + Constructor that takes line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Abstract base class for string tokens. + + + + Default constructor. + + + Constructor with the specified value + and line number. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for words, meaning sequences of word + characters. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for Quotes such as "this is a quote". + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for comments, including line and block + comments. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for whitespace such as spaces and tabs. + + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + + Token type for characters, meaning non-word characters. + + + + Constructor with the specified value + and line number. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Token type for floating point numbers, stored internally as a Double. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value. + + + + + Constructor with the specified value and line number. + + + + + Constructor with the specified value and line number. + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Override, see base + + + + + Token type for integer tokens. This handles both Int32 and Int64. + + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value. + + + Constructor with the specified value + and line number. + + + Constructor with the specified value + and line number. + + + + Constructor for a 64 bit int + + + + + Parse a string known to be a hex string. This is faster + than Parse which doesn't assume the number is Hex. This will + throw an exception if the input number isn't hex. + + The hex number as a string. + The line where this token was found. + A new IntToken set to the value in the input string. + + + + Convert the input string to an integer, if possible + + The string to parse. + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + Override, see base + + + + Angle orientation + + + + Constant representing no orientation + + + Constant representing straight orientation + + + Constant representing counterclockwise orientation + + + Constant representing left orientation + + + Constant representing clockwise orientation + + + Constant representing right orientation + + + + Utility functions for working with angles. + Unless otherwise noted, methods in this class express angles in radians. + + + + + Converts from radians to degrees. + + An angle in radians + The angle in degrees + + + + Converts from degrees to radians. + + An angle in degrees + The angle in radians + + + + Returns the angle of the vector from p0 to p1, relative to the positive X-axis. + + The angle is normalized to be in the range [ -Pi, Pi ]. + The start-point + The end-point + The normalized angle (in radians) that p0-p1 makes with the positive X-axis + + + + Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. + + + The angle is normalized to be in the range ( -Pi, Pi ]. + + The point + The normalized angle (in radians) that (0,0)-p makes with the positive X-axis. + + + + Tests whether the angle between p0-p1-p2 is acute. + + + An angle is acute if it is less than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Tests whether the angle between p0-p1-p2 is obtuse + + + An angle is obtuse if it is greater than 90 degrees. + Note: this implementation is not precise (deterministic) for angles very close to 90 degrees. + + An endpoint of the angle + The base of the angle + Another endpoint of the angle + + + + Returns the unoriented smallest angle between two vectors. + + + The computed angle will be in the range [0, Pi). + + The tip of one vector + The tail of each vector + The tip of the other vector + + + + Returns the oriented smallest angle between two vectors. + The computed angle will be in the range (-Pi, Pi]. + A positive result corresponds to a rotation (CCW) from v1 to v2; + a negative result corresponds to a (CW) rotation; + a zero result corresponds to no rotation. + + The tip of v1 + The tail of each vector + The tip of v2 + The angle between v1 and v2, relative to v1 + + + + Computes the interior angle between two segments of a ring. + The ring is assumed to be oriented in a clockwise direction. + + The computed angle will be in the range [0, 2Pi] + A point of the ring + The next point of the ring + The next point of the ring + The interior angle based at p1 + + + + Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. + + An angle (in radians) + An angle (in radians) + Whether a1 must turn , or to overlap a2. + + + + Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. + + The angle to normalize + An equivalent angle in the range (-Pi, Pi] + + + + Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). + + E.g. + + + NormalizePositive(0.0) = 0.0 + NormalizePositive(-PI) = + NormalizePositive(-2PI) = 0.0 + NormalizePositive(-3PI) = + NormalizePositive(-4PI) = 0 + NormalizePositive(PI) = + NormalizePositive(2PI) = 0.0 + NormalizePositive(3PI) = + NormalizePositive(4PI) = 0.0 + + + + + The angle to normalize, in radians. + An equivalent positive angle + + + + Computes the unoriented smallest difference between two angles. + + + + The angles are assumed to be normalized to the range [-Pi, Pi]. + The result will be in the range [0, Pi]. + + + The angle of one vector (in [-Pi, Pi] ) + The angle of the other vector (in range [-Pi, Pi] ) + The angle (in radians) between the two vectors (in range [0, Pi] ) + + + + An interface for rules which determine whether node points + which are in boundaries of geometry components + are in the boundary of the parent geometry collection. + The SFS specifies a single kind of boundary node rule, + the rule. + However, other kinds of Boundary Node Rules are appropriate + in specific situations (for instance, linear network topology + usually follows the .) + Some JTS operations + (such as , and ) + allow the BoundaryNodeRule to be specified, + and respect the supplied rule when computing the results of the operation. + + An example use case for a non-SFS-standard Boundary Node Rule is + that of checking that a set of s have + valid linear network topology, when turn-arounds are represented + as closed rings. In this situation, the entry road to the + turn-around is only valid when it touches the turn-around ring + at the single (common) endpoint. This is equivalent + to requiring the set of LineStrings to be + simple under the . + The SFS-standard is not + sufficient to perform this test, since it + states that closed rings have no boundary points. + + This interface and its subclasses follow the Strategy design pattern. + + Martin Davis + + + + + + + + Tests whether a point that lies in boundaryCount + geometry component boundaries is considered to form part of the boundary + of the parent geometry. + + boundaryCount the number of component boundaries that this point occurs in + true if points in this number of boundaries lie in the parent boundary + + + + Provides access to static instances of common s. + + + + + The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS). + + + + + The Endpoint Boundary Node Rule. + + + + The MultiValent Endpoint Boundary Node Rule. + + + + The Monovalent Endpoint Boundary Node Rule. + + + + + The Boundary Node Rule specified by the OGC Simple Features Specification, + which is the same as the Mod-2 rule. + + + + + + A specifies that points are in the + boundary of a lineal geometry iff + the point lies on the boundary of an odd number + of components. + Under this rule s and closed + s have an empty boundary. + + + This is the rule specified by the OGC SFS, + and is the default rule used in JTS. + + Martin Davis + + + + A which specifies that any points which are endpoints + of lineal components are in the boundary of the + parent geometry. + This corresponds to the "intuitive" topological definition + of boundary. + Under this rule s have a non-empty boundary + (the common endpoint of the underlying LineString). + + + This rule is useful when dealing with linear networks. + For example, it can be used to check + whether linear networks are correctly noded. + The usual network topology constraint is that linear segments may touch only at endpoints. + In the case of a segment touching a closed segment (ring) at one point, + the Mod2 rule cannot distinguish between the permitted case of touching at the + node point and the invalid case of touching at some other interior (non-node) point. + The EndPoint rule does distinguish between these cases, + so is more appropriate for use. + + Martin Davis + + + + A which determines that only + endpoints with valency greater than 1 are on the boundary. + This corresponds to the boundary of a + being all the "attached" endpoints, but not + the "unattached" ones. + + Martin Davis + + + + A which determines that only + endpoints with valency of exactly 1 are on the boundary. + This corresponds to the boundary of a + being all the "unattached" endpoints. + + Martin Davis + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + It is also a reasonable strategy for cases where the + endpoint of one segment lies on or almost on the interior of another one. + Taking the most central endpoint ensures that the computed intersection + point lies in the envelope of the segments. + Also, by always returning one of the input points, this should result + in reducing segment fragmentation. + Intended to be used as a last resort for + computing ill-conditioned intersection situations which + cause other methods to fail. + + + WARNING: in some cases this algorithm makes a poor choice of endpoint. + It has been replaced by a better heuristic in . + + + + + Computes an approximate intersection of two line segments + by taking the most central of the endpoints of the segments. + This is effective in cases where the segments are nearly parallel + and should intersect at an endpoint. + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + + Creates an instance of this class using the provided input coordinates + + The 1st coordinate of the 1st line segement. + The 2nd coordinate of the 1st line segemen. + The 1st coordinate of the 2nd line segement. + The 2nd coordinate of the 2nd line segement. + + + + Determines a point closest to the given point. + + + + + Gets the intersection point + + + + + Computes the centroid of a of any dimension. + If the geometry is nominally of higher dimension, + but has lower effective dimension + (i.e. contains only components + having zero length or area), + the centroid will be computed as for the equivalent lower-dimension geometry. + If the input geometry is empty, a + null Coordinate is returned. + +

Algorithm

+ + Dimension 2 - the centroid ic computed + as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + Holes and multipolygons are handled correctly. + See http://www.faqs.org/faqs/graphics/algorithms-faq/ + for further details of the basic approach. + Dimension 1 - Computes the average of the midpoints + of all line segments weighted by the segment length. + Zero-length lines are treated as points. + + Dimension 0 - Compute the average coordinate over all points. + Repeated points are all included in the average + + + If the input geometries are empty, a null Coordinate is returned. +
+ 1.7 +
+ + + Computes the centroid point of a geometry. + + The geometry to use + + The centroid point, or null if the geometry is empty + + + + + the point all triangles are based at + + + + + temporary variable to hold centroid of triangle + + + + + Partial area sum + + + + + partial centroid sum + + + + + Creates a new instance for computing the centroid of a geometry + + + + + Adds a to the centroid total. + + >The to add. + + + + Gets the computed centroid. + + The computed centroid, or null if the input is empty + + + + Computes three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3. + The area is positive if the triangle is oriented CCW, and negative if CW. + + + + + Adds the line segments defined by an array of coordinates + to the linear centroid accumulators. + + An array of s + + + + Adds a point to the point centroid accumulator. + + A + + + + Computes the centroid of an area point. + + + Algorithm: + + Based on the usual algorithm for calculating + the centroid as a weighted sum of the centroids + of a decomposition of the area into (possibly overlapping) triangles. + + The algorithm has been extended to handle holes and multi-polygons. + See + for further details of the basic approach. + + + The code has also be extended to handle degenerate (zero-area) polygons. + In this case, the centroid of the line segments in the polygon + will be returned. + + + + + + Adds the area defined by a Geometry to the centroid total. + If the point has no area it does not contribute to the centroid. + + The point to add. + + + + Adds the area defined by an array of + coordinates. The array must be a ring; + i.e. end with the same coordinate as it starts with. + + An array of Coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns three times the centroid of the triangle p1-p2-p3. + The factor of 3 is + left in to permit division to be avoided until later. + + + + + Returns twice the signed area of the triangle p1-p2-p3, + positive if a,b,c are oriented ccw, and negative if cw. + + + + + Adds the linear segments defined by an array of coordinates + to the linear centroid accumulators. + This is done in case the polygon(s) have zero-area, + in which case the linear centroid is computed instead. + + an array of s + + + + + + + + + + + + + + Computes the centroid of a linear point. + Algorithm: + Compute the average of the midpoints + of all line segments weighted by the segment length. + + + + + Adds the linear components of by a Geometry to the centroid total. + If the geometry has no linear components it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by an array of coordinates. + + An array of Coordinates. + + + + + + + + + Computes the centroid of a point point. + Algorithm: + Compute the average of all points. + + + + + Adds the point(s) defined by a Geometry to the centroid total. + If the point is not of dimension 0 it does not contribute to the centroid. + + The point to add. + + + + Adds the length defined by a coordinate. + + A coordinate. + + + + + + + + + Specifies and implements various fundamental Computational Geometric algorithms. + The algorithms supplied in this class are robust for double-precision floating point. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of clockwise, or a right turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of counterclockwise, or a left turn. + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + A value that indicates an orientation of collinear, or no turn (straight). + + + + + Returns the index of the direction of the point q + relative to a vector specified by p1-p2. + + The origin point of the vector. + The final point of the vector. + The point to compute the direction to. + + 1 if q is counter-clockwise (left) from p1-p2, + -1 if q is clockwise (right) from p1-p2, + 0 if q is collinear with p1-p2. + + + + + Tests whether a point lies inside or on a ring. + + + The ring may be oriented in either direction. + A point lying exactly on the ring boundary is considered to be inside the ring. + This method does not first check the point against the envelope + of the ring. + + Point to check for ring inclusion. + An array of s representing the ring (which must have first point identical to last point) + true if p is inside ring. + + + + + Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. + + + The ring may be oriented in either direction. + This method does not first check the point against the envelope of the ring. + + Point to check for ring inclusion + An array of coordinates representing the ring (which must have first point identical to last point) + The of p relative to the ring + + + + Tests whether a point lies on the line segments defined by a + list of coordinates. + + + + true if the point is a vertex of the line + or lies in the interior of a line segment in the linestring + + + + + Computes whether a ring defined by an array of s is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + An array of s froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes whether a ring defined by a coordinate sequence is oriented counter-clockwise. + > + + + The list of points is assumed to have the first and last points equal. + This will handle coordinate lists which contain repeated points. + + This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct. + + A coordinate sequence froming a ring + true if the ring is oriented + If there are too few points to determine orientation (<4) + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + The first vertex of the line segment + The second vertex of the line segment + The point to compute the relative orientation of + + 1 if q is counter-clockwise from p1-p2, + or -1 if q is clockwise from p1-p2, + or 0 if q is collinear with p1-p2 + + + + + Computes the distance from a point p to a line segment AB. + Note: NON-ROBUST! + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The distance from p to line segment AB. + + + + Computes the perpendicular distance from a point p + to the (infinite) line containing the points AB + + The point to compute the distance for. + One point of the line. + Another point of the line (must be different to A). + The perpendicular distance from p to line AB. + + + + Computes the distance from a point to a sequence of line segments. + + A point + A sequence of contiguous line segments defined by their vertices + The minimum distance between the point and the line segments + If there are too few points to make up a line (at least one?) + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates of the ring + The signed area of the ring + + + + Computes the signed area for a ring. + + + The signed area is + + + positiveif the ring is oriented CW + negativeif the ring is oriented CCW + zeroif the ring is degenerate or flat + + + + The coordinates forming the ring + The signed area of the ring + + + + Computes the length of a linestring specified by a sequence of points. + + The points specifying the linestring + The length of the linestring + + + Basic computational geometry algorithms + for geometry and coordinates defined in 3-dimensional Cartesian space. + + @author mdavis + + + + Computes the distance between two 3D segments. + + @param A the start point of the first segment + @param B the end point of the first segment + @param C the start point of the second segment + @param D the end point of the second segment + @return the distance between the segments + + + + Implements basic computational geometry algorithms using arithmetic. + + Martin Davis + + + + A value which is safely greater than the + relative round-off error in double-precision numbers + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + Computes the sign of the determinant of the 2x2 matrix + with the given entries. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is 0. + + + + + + A filter for computing the orientation index of three coordinates. + + If the orientation can be computed safely using standard DP + arithmetic, this routine returns the orientation index. + Otherwise, a value i > 1 is returned. + In this case the orientation index must + be computed using some other more robust method. + The filter is fast to compute, so can be used to + avoid the use of slower robust methods except when they are really needed, + thus providing better average performance. + + Uses an approach due to Jonathan Shewchuk, which is in the public domain. + + + + The orientation index if it can be computed safely + > 1 if the orientation index cannot be computed safely> + + + + + + Computes an intersection point between two lines + using DD arithmetic. + Currently does not handle case of parallel lines. + + A point of 1st segment + Another point of 1st segment + A point of 2nd segment + Another point of 2nd segment + + + + + Computes the convex hull of a . + The convex hull is the smallest convex Geometry that contains all the + points in the input Geometry. + Uses the Graham Scan algorithm. + + + + + Create a new convex hull construction for the input Geometry. + + + + + + Create a new convex hull construction for the input array. + + + + + + + + + + + + + + Returns a Geometry that represents the convex hull of the input point. + The point will contain the minimal number of points needed to + represent the convex hull. In particular, no more than two consecutive + points will be collinear. + + + If the convex hull contains 3 or more points, a Polygon; + 2 points, a LineString; + 1 point, a Point; + 0 points, an empty GeometryCollection. + + + + + Uses a heuristic to reduce the number of points scanned to compute the hull. + The heuristic is to find a polygon guaranteed to + be in (or on) the hull, and eliminate all points inside it. + A quadrilateral defined by the extremal points + in the four orthogonal directions + can be used, but even more inclusive is + to use an octilateral defined by the points in the 8 cardinal directions. + Note that even if the method used to determine the polygon vertices + is not 100% robust, this does not affect the robustness of the convex hull. + + To satisfy the requirements of the Graham Scan algorithm, + the returned array has at least 3 entries. + + + The coordinates to reduce + The reduced array of coordinates + + + + Pre sorts the coordinates + + + + + + + + + + + + + + + + + + + + Whether the three coordinates are collinear + and c2 lies between c1 and c3 inclusive. + + + + + + + + + + + + + + + + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + A 2-vertex LineString if the vertices are collinear; + otherwise, a Polygon with unnecessary (collinear) vertices removed. + + + + + + The vertices of a linear ring, which may or may not be flattened (i.e. vertices collinear). + The coordinates with unnecessary (collinear) vertices removed. + + + + Compares s for their angle and distance + relative to an origin. + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + An algorithm for computing a distance metric + which is an approximation to the Hausdorff Distance + based on a discretization of the input . + + + + The algorithm computes the Hausdorff distance restricted to discrete points + for one of the geometries. + The points can be either the vertices of the geometries (the default), + or the geometries with line segments densified by a given fraction. + Also determines two points of the Geometries which are separated by the computed distance. + + + This algorithm is an approximation to the standard Hausdorff distance. + Specifically, + + for all geometries a, b: DHD(a, b) <= HD(a, b) + + The approximation can be made as close as needed by densifying the input geometries. + In the limit, this value will approach the true Hausdorff distance: + + DHD(A, B, densifyFactor) -> HD(A, B) as densifyFactor -> 0.0 + + The default approximation is exact or close enough for a large subset of useful cases. + + + Examples of these are: + + + computing distance between Linestrings that are roughly parallel to each other, + and roughly equal in length. This occurs in matching linear networks. + + Testing similarity of geometries. + + + + An example where the default approximation is not close is: + + A = LINESTRING (0 0, 100 0, 10 100, 10 100) + B = LINESTRING (0 100, 0 10, 80 10) + + DHD(A, B) = 22.360679774997898 + HD(A, B) ~= 47.8 + + + + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The Discrete Hausdorff Distance + + + + Computes the Discrete Hausdorff Distance of two s. + + A geometry + A geometry + The densify fraction. A value of 0 indicates, that no densification should take place + The Discrete Hausdorff Distance + + + Value of 0.0 indicates that no densification should take place + + + + Gets/sets the fraction by which to densify each segment. + + + Each segment will be (virtually) split into a number of equal-length + subsegments, whose fraction of the total length is closest + to the given fraction. + + + + + Computes the Euclidean distance (L2 metric) from a to a . + + + Also computes two points on the geometry which are separated by the distance found. + + + + + Contains a pair of points and the distance between them. + + + Provides methods to update with a new point pair with either maximum or minimum distance. + + + + + Initializes to null. + + + + + Initializes the points. + + 1st coordinate + 2nd coordinate + + + + Initializes the points, avoiding recomputing the distance. + + 1st coordinate + 2nd coordinate + the distance between and + + + + The distance between the paired coordinates + + + + + Returns an array containing the paired points + + + + + Represents a homogeneous coordinate in a 2-D coordinate space. + In NTS s are used as a clean way + of computing intersections between line segments. + + David Skea + + + + Computes the (approximate) intersection point between two line segments using homogeneous coordinates. + + + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + 1st Coordinate of 1st linesegment + 2nd Coordinate of 1st linesegment + 1st Coordinate of 2nd linesegment + 2nd Coordinate of 2nd linesegment + + + + Computes the (approximate) intersection point between two line segments + using homogeneous coordinates. + Note that this algorithm is + not numerically stable; i.e. it can produce intersection points which + lie outside the envelope of the line segments themselves. In order + to increase the precision of the calculation input points should be normalized + before passing them to this routine. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a homogeneous coordinate which is the intersection of the lines s. + define by the homogenous coordinates represented by two + + A coordinate + A coordinate + + + + Direct access to x private field + + + + + Direct access to y private field + + + + + Direct access to w private field + + + + + + + + + + Computes a point in the interior of an areal geometry. + + +

Algorithm:

+ + Find a Y value which is close to the centre of + the geometry's vertical extent but is different + to any of it's Y ordinates. + Create a horizontal bisector line using the Y value + and the geometry's horizontal extent + Find the intersection between the geometry + and the horizontal bisector line. + The intersection is a collection of lines and points. + Pick the midpoint of the largest intersection geometry + +

KNOWN BUGS

+ + If a fixed precision model is used, + in some cases this method may return a point + which does not lie in the interior.
+
+ + + + + + + + + + + Creates a new interior point finder + for an areal geometry. + + An areal geometry + + + + Tests the interior vertices (if any) + defined by an areal Geometry for the best inside point. + If a component Geometry is not of dimension 2 it is not tested. + + The point to add. + + + + Finds an interior point of a Polygon. + + The geometry to analyze. + + + + If point is a collection, the widest sub-point; otherwise, + the point itself. + + + + + + + + + + + + Returns the centre point of the envelope. + + The envelope to analyze. + The centre of the envelope. + + + + Gets the computed interior point. + + + + + Finds a safe bisector Y ordinate + by projecting to the Y axis + and finding the Y-ordinate interval + which contains the centre of the Y extent. + The centre of this interval is returned as the bisector Y-ordinate. + + Martin Davis + + + + Computes a point in the interior of an linear point. + Algorithm: + Find an interior vertex which is closest to + the centroid of the linestring. + If there is no interior vertex, find the endpoint which is + closest to the centroid. + + + + + + + + + + + Tests the interior vertices (if any) + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + Tests the endpoint vertices + defined by a linear Geometry for the best inside point. + If a Geometry is not of dimension 1 it is not tested. + + The point to add. + + + + + + + + + + + + + + + + + + + + + Computes a point in the interior of an point point. + Algorithm: + Find a point which is closest to the centroid of the point. + + + + + + + + + + + Tests the point(s) defined by a Geometry for the best inside point. + If a Geometry is not of dimension 0 it is not tested. + + The point to add. + + + + + + + + + + + + + + + An interface for classes which determine the of points in a + + Martin Davis + + + + Determines the of a point in the . + + The point to test + the location of the point in the geometry + + + + An interface for classes which test whether a Coordinate lies inside a ring. + + + + + + + + + + + + + A LineIntersector is an algorithm that can both test whether + two line segments intersect and compute the intersection point(s) + if they do. + + There are three possible outcomes when determining whether two line segments intersect: + + - the segments do not intersect + - the segments intersect in a single point + - the segments are collinear and they intersect in a line segment + + + + For segments which intersect in a single point, the point may be either an endpoint + or in the interior of each segment. + If the point lies in the interior of both segments, + this is termed a proper intersection. + The property test for this situation. + + The intersection point(s) may be computed in a precise or non-precise manner. + Computing an intersection point precisely involves rounding it + via a supplied . + + LineIntersectors do not perform an initial envelope intersection test + to determine if the segments are disjoint. + This is because this class is likely to be used in a context where + envelope overlap is already known to occur (or be likely). + + + + + These are deprecated, due to ambiguous naming + + + + Indicates that line segments do not intersect + + + + + Indicates that line segments intersect in a single point + + + + + Indicates that line segments intersect in a line segment + + + + + Computes the "edge distance" of an intersection point p along a segment. + The edge distance is a metric of the point along the edge. + The metric used is a robust and easy to compute metric function. + It is not equivalent to the usual Euclidean metric. + It relies on the fact that either the x or the y ordinates of the + points in the edge are unique, depending on whether the edge is longer in + the horizontal or vertical direction. + NOTE: This function may produce incorrect distances + for inputs where p is not precisely on p1-p2 + (E.g. p = (139,9) p1 = (139,10), p2 = (280,1) produces distanct 0.0, which is incorrect. + My hypothesis is that the function is safe to use for points which are the + result of rounding points which lie on the line, but not safe to use for truncated points. + + + + + This function is non-robust, since it may compute the square of large numbers. + Currently not sure how to improve this. + + + + + The indexes of the endpoints of the intersection lines, in order along + the corresponding line + + + + + If MakePrecise is true, computed intersection coordinates will be made precise + using Coordinate.MakePrecise. + + + + + Gets an endpoint of an input segment. + + the index of the input segment (0 or 1) + the index of the endpoint (0 or 1) + The specified endpoint + + + + Compute the intersection of a point p and the line p1-p2. + This function computes the bool value of the hasIntersection test. + The actual value of the intersection (if there is one) + is equal to the value of p. + + + + + Computes the intersection of the lines p1-p2 and p3-p4. + This function computes both the bool value of the hasIntersection test + and the (approximate) value of the intersection point itself (if there is one). + + + + + Returns the intIndex'th intersection point. + + is 0 or 1. + The intIndex'th intersection point. + + + + Test whether a point is a intersection point of two line segments. + Note that if the intersection is a line segment, this method only tests for + equality with the endpoints of the intersection segment. + It does not return true if the input point is internal to the intersection segment. + + true if the input point is one of the intersection points. + + + + Tests whether either intersection point is an interior point of one of the input segments. + + + true if either intersection point is in the interior of one of the input segment. + + + + + Tests whether either intersection point is an interior point of the specified input segment. + + + true if either intersection point is in the interior of the input segment. + + + + + Computes the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The intIndex'th intersection point in the direction of the specified input line segment. + + + + + Computes the index (order) of the intIndex'th intersection point in the direction of + a specified input line segment. + + is 0 or 1. + is 0 or 1. + + The index of the intersection point along the segment (0 or 1). + + + + + Computes the intersection line index + + The segment index + + + + Computes the "edge distance" of an intersection point along the specified input line segment. + + is 0 or 1. + is 0 or 1. + The edge distance of the intersection point. + + + + Alias the [0] for ease of reference + + + + + Alias the [1] for ease of reference + + + + + Force computed intersection to be rounded to a given precision model + + + + + Force computed intersection to be rounded to a given precision model. + No getter is provided, because the precision model is not required to be specified. + + + + + Tests whether the input geometries intersect. + + true if the input geometries intersect. + + + + Returns the number of intersection points found. This will be either 0, 1 or 2. + + The number of intersection points found (0, 1, or 2) + + + + Tests whether an intersection is proper. + The intersection between two line segments is considered proper if + they intersect in a single point in the interior of both segments + (e.g. the intersection is a single point and is not equal to any of the endpoints). + The intersection between a point and a line segment is considered proper + if the point lies in the interior of the segment (e.g. is not equal to either of the endpoints). + + true if the intersection is proper. + + + + Determines the location of s relative to + a geometry, using indexing for efficiency. + This algorithm is suitable for use in cases where + many points will be tested against a given area. + + Thread-safe and immutable. + + Martin Davis + + + + An interface for classes which determine the of + points in areal geometries. + + Martin Davis + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + Creates a new locator for a given . + + the Geometry to locate in + + + + Determines the of a point in an areal . + + The point to test + The location of the point in the geometry + + + + + A visitor for items in an index. + + + + + + + + + + + Static methods for classes + + + + + Convenience method to test a point for intersection with a geometry + + The geometry is wrapped in a class. + + The locator to use. + The coordinate to test. + true if the point is in the interior or boundary of the geometry. + + + Computes the location of points relative to an areal , using a simple O(n) algorithm. + This algorithm is suitable for use in cases where only one or a few points will be tested against a given area. + + The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry. + + + + Determines the of a point in an areal . Currently this will never return a value of . + + The point to test + The areal geometry to test + The Location of the point in the geometry + + + + Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible. + + The point to test + A linear ring + true if the point lies inside the ring + + + + Measures the degree of similarity between two s + using the area of intersection between the geometries. + The measure is normalized to lie in the range [0, 1]. + Higher measures indicate a great degree of similarity. + + + NOTE: Currently experimental and incomplete. + + mbdavis + + + + An interface for classes which measures the degree of similarity between two {@link Geometry}s. + + + The computed measure lies in the range [0, 1]. + Higher measures indicate a great degree of similarity. + A measure of 1.0 indicates that the input geometries are identical + A measure of 0.0 indicates that the geometries have essentially no similarity. + The precise definition of "identical" and "no similarity" may depend on the exact algorithm being used. + + mbdavis + + + + Function to measure the similarity between two s. + + A geometry + A geometry + The similarity value between two s + + + + Measures the degree of similarity between two s using the Hausdorff distance metric. + + + + The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity. + + + The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing + this by dividing it by the diagonal distance across the envelope of the combined geometries. + + + mbdavis + + + + + + + + + + + Provides methods to mathematically combine values. + + Martin Davis + + + + + + + + + + + + Implements IPointInRing + using a MonotoneChains and a BinTree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The action for the internal iterator for performing + envelope select queries on a MonotoneChain. + + + + + These envelopes are used during the MonotoneChain search process. + + + + + + + + + + This method is overridden to process a segment + in the context of the parent chain. + + The parent chain + The index of the start vertex of the segment being processed + + + + This is a convenience method which can be overridden to obtain the actual + line segment which is selected. + + + + + + + + + + + + + + + + + + + Computes the Minimum Bounding Circle (MBC) for the points in a . + The MBC is the smallest circle which covers all the input points + (this is also sometimes known as the Smallest Enclosing Circle). + This is equivalent to computing the Maximum Diameter of the input point set. + + + + The computed circle can be specified in two equivalent ways, + both of which are provide as output by this class: + + As a centre point and a radius + By the set of points defining the circle. + + Depending on the number of points in the input + and their relative positions, this + will be specified by anywhere from 0 to 3 points. + + 0 or 1 points indicate an empty or trivial input point arrangment. + 2 or 3 points define a circle which contains + all the input points. + + + + + The class can also output a which approximates the + shape of the MBC (although as an approximation it is not + guaranteed to cover all the input points.) + + Martin Davis + + + The algorithm used is based on the one by Jon Rokne in + the article "An Easy Bounding Circle" in Graphic Gems II. + + + + Creates a new object for computing the minimum bounding circle for the + point set defined by the vertices of the given geometry. + + The geometry to use to obtain the point set + + + + Gets a geometry which represents the Minimum Bounding Circle. + + + + If the input is degenerate (empty or a single unique point), + this method will return an empty geometry or a single Point geometry. + Otherwise, a Polygon will be returned which approximates the + Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.) + + + A Geometry representing the Minimum Bounding Circle. + + + + Gets a geometry representing a line between the two farthest points + in the input. + These points will be two of the extremal points of the Minimum Bounding Circle. + They also lie on the convex hull of the input. + + A LineString between the two farthest points of the input + An empty LineString if the input is empty + A Point if the input is a point + + + + Gets a geometry representing the diameter of the computed Minimum Bounding Circle. + + + + the diameter line of the Minimum Bounding Circle + an empty line if the input is empty + a Point if the input is a point + + + + + + Gets the extremal points which define the computed Minimum Bounding Circle. + + + There may be zero, one, two or three of these points, + depending on the number of points in the input + and the geometry of those points. + + The points defining the Minimum Bounding Circle + + + + Gets the centre point of the computed Minimum Bounding Circle. + + the centre point of the Minimum Bounding Circle, null if the input is empty + + + + Gets the radius of the computed Minimum Bounding Circle. + + The radius of the Minimum Bounding Circle + + + + Computes the minimum diameter of a . + + + + The minimum diameter is defined to be the + width of the smallest band that contains the point, + where a band is a strip of the plane defined + by two parallel lines. + This can be thought of as the smallest hole that the point can be + moved through, with a single rotation. + + + The first step in the algorithm is computing the convex hull of the Geometry. + If the input Geometry is known to be convex, a hint can be supplied to + avoid this computation. + + + This class can also be used to compute a line segment representing + the minimum diameter, the supporting line segment of the minimum diameter, + and a minimum rectangle enclosing the input geometry. + This rectangle will + have width equal to the minimum diameter, and have one side + parallel to the supporting segment. + + + + + + + Gets the minimum rectangle enclosing a geometry. + + The geometry + The minimum rectangle enclosing the geometry + + + + Gets the minimum diameter enclosing a geometry. + + The geometry + The length of the minimum diameter of the geometry + + + + Compute a minimum diameter for a given . + + a Geometry. + + + + Compute a minimum diameter for a giver Geometry, + with a hint if + the Geometry is convex + (e.g. a convex Polygon or LinearRing, + or a two-point LineString, or a Point). + + a Geometry which is convex. + true if the input point is convex. + + + + + + + + + + + + + + + Compute the width information for a ring of Coordinates. + Leaves the width information in the instance variables. + + + + + + + + + + + + + + + + + + + + + + + Gets the minimum rectangular which encloses the input geometry. + + + + The rectangle has width equal to the minimum diameter, and a longer length. + If the convex hull of the input is degenerate (a line or point) a or is returned. + + + The minimum rectangle can be used as an extremely generalized representation for the given geometry. + + + The minimum rectangle enclosing the input (or a line or point if degenerate) + + + + Gets the length of the minimum diameter of the input Geometry. + + The length of the minimum diameter. + + + + Gets the Coordinate forming one end of the minimum diameter. + + A coordinate forming one end of the minimum diameter. + + + + Gets the segment forming the base of the minimum diameter. + + The segment forming the base of the minimum diameter. + + + + Gets a LineString which is a minimum diameter. + + A LineString which is a minimum diameter. + + + + Non-robust versions of various fundamental Computational Geometric algorithms, + FOR TESTING PURPOSES ONLY!. + The non-robustness is due to rounding error in floating point computation. + + + + + + + + + + + + + Computes whether a ring defined by an array of Coordinate is + oriented counter-clockwise. + This will handle coordinate lists which contain repeated points. + + an array of coordinates forming a ring. + + true if the ring is oriented counter-clockwise. + throws ArgumentException if the ring is degenerate (does not contain 3 different points) + + + + + Computes the orientation of a point q to the directed line segment p1-p2. + The orientation of a point relative to a directed line segment indicates + which way you turn to get to q after travelling from p1 to p2. + + 1 if q is counter-clockwise from p1-p2 + -1 if q is clockwise from p1-p2 + 0 if q is collinear with p1-p2 + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + the origin point of the vector + the final point of the vector + the point to compute the direction to + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + Computes the distance from a line segment AB to a line segment CD. + Note: NON-ROBUST! + + A point of one line. + The second point of the line (must be different to A). + One point of the line. + Another point of the line (must be different to A). + The distance from line segment AB to line segment CD. + + + + A non-robust version of LineIntersector. + + + + + + + + + + true if both numbers are positive or if both numbers are negative, + false if both numbers are zero. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RParameter computes the parameter for the point p + in the parameterized equation + of the line from p1 to p2. + This is equal to the 'distance' of p along p1-p2. + + + + + + + + + + + + + + + Computes the topological relationship () of a single point to a Geometry. + + + A may be specified to control the evaluation of whether the point lies on the boundary or not + The default rule is to use the the SFS Boundary Determination Rule + + Notes: + + s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring. + + Instances of this class are not reentrant. + + + + + + Initializes a new instance of the class. + + + + + Convenience method to test a point for intersection with a Geometry + + The coordinate to test. + The Geometry to test. + true if the point is in the interior or boundary of the Geometry. + + + + Computes the topological relationship ({Location}) of a single point to a Geometry. + It handles both single-element and multi-element Geometries. + The algorithm for multi-part Geometries takes into account the boundaryDetermination rule. + + The Location of the point relative to the input Geometry. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Counts the number of segments crossed by a horizontal ray extending to the right + from a given point, in an incremental fashion. + This can be used to determine whether a point lies in a geometry. + The class determines the situation where the point lies exactly on a segment. + When being used for Point-In-Polygon determination, this case allows short-circuiting the evaluation. + + + This class handles polygonal geometries with any number of shells and holes. + The orientation of the shell and hole rings is unimportant. + In order to compute a correct location for a given polygonal geometry, + it is essential that all segments are counted which + + touch the ray + lie in in any ring which may contain the point + + + The only exception is when the point-on-segment situation is detected, in which + case no further processing is required. + The implication of the above rule is that segments which can be a priori determined to not touch the ray + (i.e. by a test of their bounding box or Y-extent) do not need to be counted. This allows for optimization by indexing. + + + Martin Davis + + + + Determines the of a point in a ring. + This method is an exemplar of how to use this class. + + The point to test + An array of Coordinates forming a ring + The location of the point in the ring + + + + Determines the of a point in a ring. + + The point to test + A coordinate sequence forming a ring + The location of the point in the ring + + + + Counts a segment + + An endpoint of the segment + Another endpoint of the segment + + + + Reports whether the point lies exactly on one of the supplied segments. + + This method may be called at any time as segments are processed. If the result of this method is true, + no further segments need be supplied, since the result will never change again. + + + + + + Gets the of the point relative to the ring, polygon + or multipolygon from which the processed segments were provided. + + This property only determines the correct location if all relevant segments have been processed + + + + Tests whether the point lies in or on the ring, polygon + + + This property only determines the correct location if all relevant segments have been processed + + + + Computes whether a rectangle intersects line segments. + + + Rectangles contain a large amount of inherent symmetry + (or to put it another way, although they contain four + coordinates they only actually contain 4 ordinates + worth of information). + The algorithm used takes advantage of the symmetry of + the geometric situation + to optimize performance by minimizing the number + of line intersection tests. + + Martin Davis + + + + Creates a new intersector for the given query rectangle, + specified as an . + + The query rectangle, specified as an Envelope + + + + Tests whether the query rectangle intersects a given line segment. + + The first endpoint of the segment + The second endpoint of the segment + true if the rectangle intersects the segment + + + + Implements an algorithm to compute the + sign of a 2x2 determinant for double precision values robustly. + It is a direct translation of code developed by Olivier Devillers. + + The original code carries the following copyright notice: + ************************************************************************ + Author : Olivier Devillers + Olivier.Devillers@sophia.inria.fr + http:/www.inria.fr:/prisme/personnel/devillers/anglais/determinant.html + + Olivier Devillers has allowed the code to be distributed under + the LGPL (2012-02-16) saying "It is ok for LGPL distribution." + + ************************************************************************* + ************************************************************************* + Copyright (c) 1995 by INRIA Prisme Project + BP 93 06902 Sophia Antipolis Cedex, France. + All rights reserved + ************************************************************************* + + + + + Computes the sign of the determinant of the 2x2 matrix with the given entries, in a robust way. + + + + + + + + -1 if the determinant is negative, + 1 if the determinant is positive, + 0 if the determinant is null. + + + + + + Returns the index of the direction of the point q relative to + a vector specified by p1-p2. + + The origin point of the vector + The final point of the vector + the point to compute the direction to + + + 1 if q is counter-clockwise (left) from p1-p2 + -1 if q is clockwise (right) from p1-p2 + 0 if q is collinear with p1-p2 + + + + + A robust version of . + + + + + + + + + + + + + + + + + + + + + + + This method computes the actual value of the intersection point. + To obtain the maximum precision from the intersection calculation, + the coordinates are normalized by subtracting the minimum + ordinate values (in absolute value). This has the effect of + removing common significant digits from the calculation to + maintain more bits of precision. + + + + + + + + + + Computes a segment intersection using homogeneous coordinates. + Round-off error can cause the raw computation to fail, + (usually due to the segments being approximately parallel). + If this happens, a reasonable approximation is computed instead. + + + + + Normalize the supplied coordinates to + so that the midpoint of their intersection envelope + lies at the origin. + + + + + Tests whether a point lies in the envelopes of both input segments. + A correctly computed intersection point should return true + for this test. + Since this test is for debugging purposes only, no attempt is + made to optimize the envelope test. + + + true if the input point lies within both input segment envelopes. + + + + Finds the endpoint of the segments P and Q which + is closest to the other segment. + This is a reasonable surrogate for the true + intersection points in ill-conditioned cases + (e.g. where two segments are nearly coincident, + or where the endpoint of one segment lies almost on the other segment). + + + This replaces the older CentralEndpoint heuristic, + which chose the wrong endpoint in some cases + where the segments had very distinct slopes + and one endpoint lay almost on the other segment. + + an endpoint of segment P + an endpoint of segment P + an endpoint of segment Q + an endpoint of segment Q + the nearest endpoint to the other segment + + + + Tests whether a Coordinate lies inside + a ring, using a linear-time algorithm. + + + + + + + + + + + + + + + + + + + + + + + Implements PointInRing using a SIRtree index to increase performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helper class for transforming objects. + + + + + Transforms a object. + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + + + + + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Transforms a object. + + The factory to create the new + The input + The + A transformed + + + + Densifies a geometry by inserting extra vertices along the line segments + contained in the geometry. + All segments in the created densified geometry will be no longer than + than the given distance tolerance. + + + Densified polygonal geometries are guaranteed to be topologically correct. + The coordinates created during densification respect the input geometry's . + Note: At some future point this class will offer a variety of densification strategies. + + Martin Davis + + + + Densifies a geometry using a given distance tolerance, and respecting the input geometry's . + + The geometry densify + The distance tolerance () + The densified geometry + + + + Densifies a coordinate sequence. + + The coordinate sequence to densify + The distance tolerance () + The precision model to apply on the new coordinates + The densified coordinate sequence + + + Creates a new densifier instance + The geometry to densify + + + + Gets the densified geometry. + + The densified geometry + + + + Gets or sets the distance tolerance for the densification. All line segments + in the densified geometry will be no longer than the distance tolereance. + Simplified geometry will be within this distance of the original geometry. + The distance tolerance must be positive. + + + + + Creates a valid area geometry from one that possibly has bad topology + (i.e. self-intersections). Since buffer can handle invalid topology, but + always returns valid geometry, constructing a 0-width buffer "corrects" + the topology. Note this only works for area geometries, since buffer + always returns areas. This also may return empty geometries, if the input + has no actual area. + + An area geometry possibly containing self-intersections + A valid area geometry + + + + Stores all attributes associated with a single Geometry feature. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the names + + + + + + + + + + + + + + + + + + + + + + + + Returns a string array containing + all names of present attributes. + + + + + + Returns a object array containing + all values of present attributes. + + + + + + Verifies if attribute specified already exists. + + + + + + + Build a field with the given value and add it to attributes table. + + Name of the new attribute. + Value for attribute (can be null). + If attribute already exists. + + + + Delete the specified attribute from the table. + + + + + + Return the System.Type of the specified attribute, + useful for casting values retrieved with GetValue methods. + + + + + + + Get the value of the specified attribute. + + + + + + + Set the value of the specified attribute. + + + + + + + + + + + + Get / Set the value of the specified attribute. + + + + + + + Feature class + + + + + + + + + + + + + + + + + Geometry representation of the feature. + + + + + Attributes table of the feature. + + + + + Useful utility functions for handling Coordinate arrays. + + + + + Tests whether an array of s forms a ring, by checking length and closure. + Self-intersection is not checked. + + An array of Coordinates + true if the coordinate form a ring. + + + + Finds a in a list of s + which is not contained in another list of s. + + The s to test. + An array of s to test the input points against. + + A from + which is not in , or null. + + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + + + + Determines which orientation of the array is (overall) increasing. + In other words, determines which end of the array is "smaller" + (using the standard ordering on ). + Returns an integer indicating the increasing direction. + If the sequence is a palindrome, it is defined to be + oriented in a positive direction. + + The array of Coordinates to test. + + 1 if the array is smaller at the start or is a palindrome, + -1 if smaller at the end. + + + + + Determines whether two arrays of equal length + are equal in opposite directions. + + + + + + + + Creates a deep copy of the argument Coordinate array. + + Array of Coordinates. + Deep copy of the input. + + + + Creates a deep copy of a given section of a source array into a destination Coordinate array. + The destination array must be an appropriate size to receive the copied coordinates. + + An array of Coordinates + The index to start copying from + The array to receive the deep-copied coordinates + The destination index to start copying to + The number of items to copy + + + + Converts the given of + s into a array. + + of coordinates. + + + If contains not only s. + + + + + Converts the given of + s into a array. + + of coordinates. + + + + + Returns whether Equals returns true for any two consecutive + coordinates in the given array. + + Array of Coordinates. + true if coord has repeated points; false otherwise. + + + + Returns either the given coordinate array if its length is greater than + the given amount, or an empty coordinate array. + + Length amount. + Array of Coordinates. + New Coordinate array. + + + + If the coordinate array argument has repeated points, + constructs a new array containing no repeated points. + Otherwise, returns the argument. + + + + + + + Collapses a coordinate array to remove all null elements. + + The coordinate array to collapse + An Array containing only non-null elements + + + + Reverses the coordinates in an array in-place. + + Array of Coordinates. + + + + Returns true if the two arrays are identical, both null, or pointwise + equal (as compared using Coordinate.Equals). + + First array of Coordinates. + Second array of Coordinates. + true if two Coordinates array are equals; false otherwise + + + + Returns true if the two arrays are identical, both null, or pointwise + equal, using a user-defined + for s. + + An array of s. + Another array of s. + + A for s. + + + + + + Returns the minimum coordinate, using the usual lexicographic comparison. + + Array to search. + The minimum coordinate in the array, found using CompareTo. + + + + Shifts the positions of the coordinates until firstCoordinate is first. + + Array to rearrange. + Coordinate to make first. + + + + Returns the index of in . + The first position is 0; the second is 1; etc. + + A to search for. + A array to search. + The position of coordinate, or -1 if it is not found. + + + + Extracts a subsequence of the input array + from indices to (inclusive). + The input indices are clamped to the array size; + If the end index is less than the start index, + the extracted array will be empty. + + The input array. + The index of the start of the subsequence to extract. + The index of the end of the subsequence to extract. + A subsequence of the input array. + + + + Computes the of the coordinates. + + the array to scan. + the of the . + + + Extracts the coordinates which intersect an {@link Envelope}. + + @param coordinates the coordinates to scan + @param env the envelope to intersect with + @return an array of the coordinates which intersect the envelope + + + + Compares two arrays + in the forward direction of their coordinates, + using lexicographic ordering. + + + + + Compares the specified s arrays. + + + + + + + + A comparator for arrays modulo their directionality. + E.g. if two coordinate arrays are identical but reversed + they will compare as equal under this ordering. + If the arrays are not equal, the ordering returned + is the ordering in the forward direction. + + + + + A list of Coordinates, which may + be set to prevent repeated coordinates from occuring in the list. + + + + + Constructs a new list without any coordinates + + + + + Constructs a new list from an array of Coordinates, allowing repeated points. + (I.e. this constructor produces a with exactly the same set of points + as the input array.) + + Initial coordinates + + + + Constructs a new list from a collection of Coordinates, + allows repeated points. + + Collection of coordinates to load into the list. + + + + Constructs a new list from a collection of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Collection of coordinates to load into the list. + If false, repeated points are removed. + + + + Constructs a new list from an array of Coordinates, + allowing caller to specify if repeated points are to be removed. + + Array of coordinates to load into the list. + If false, repeated points are removed. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Adds a section of an array of coordinates to the list. + + The coordinates + If set to false, repeated coordinates are collapsed + The index to start from + The index to add up to but not including + true (as by general collection contract) + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + If false, the array is added in reverse order. + Return true. + + + + Adds an array of coordinates to the list. + + Coordinates to be inserted. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the list. + + Coordinate to be inserted, as object. + If set to false, repeated coordinates are collapsed. + Return true. + + + + Adds a coordinate to the end of this list. + + Coordinate to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if all ok. + + + + Inserts the specified coordinate at the specified position in this list. + + The position at which to insert + the coordinate to insert + if set to false, repeated coordinates are collapsed + + + + Add an array of coordinates. + + Coordinates collection to be inserted. + If set to false, repeated coordinates are collapsed. + Return true if at least one element has added (IList not empty). + + + + Ensure this coordList is a ring, by adding the start point if necessary. + + + + + Returns the Coordinates in this collection. + + Coordinater as Coordinate[] array. + + + + Returns a deep copy of this collection. + + The copied object. + + + + Compares two s. + + + For sequences of the same dimension, the ordering is lexicographic. + Otherwise, lower dimensions are sorted before higher. + The dimensions compared can be limited; if this is done + ordinate dimensions above the limit will not be compared. + + + If different behaviour is required for comparing size, dimension, + or coordinate values, any or all methods can be overridden. + + + + + Compare two doubles, allowing for NaN values. + NaN is treated as being less than any valid number. + + A double + A double + -1, 0, or 1 depending on whether a is less than, equal to or greater than b + + + The number of dimensions to test + + + Creates a comparator which will test all dimensions. + + + + + @param dimensionLimit + Creates a comparator which will test only the specified number of dimensions. + The number of dimensions to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 + + + + Compares the same coordinate of two s + + A coordinate sequence + A coordinate sequence + The index of the coordinate to test + the number of dimensiosn to test + + + + Compares two s for relative order. + + A coordinate sequence + A coordinate sequence + -1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2 + + + + Utility functions for manipulating s. + + + + + Reverses the coordinates in a sequence in-place. + + + + + + Swaps two coordinates in a sequence. + + seq the sequence to modify + the index of a coordinate to swap + the index of a coordinate to swap + + + + Copies a section of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinates from + The starting index of the coordinates to copy + The sequence to which the coordinates should be copied to + The starting index of the coordinates in + The number of coordinates to copy + + + + Copies a coordinate of a to another . + The sequences may have different dimensions; + in this case only the common dimensions are copied. + + The sequence to copy coordinate from + The index of the coordinate to copy + The sequence to which the coordinate should be copied to + The index of the coordinate in + + + + Tests whether a forms a valid , + by checking the sequence length and closure + (whether the first and last points are identical in 2D). + Self-intersection is not checked. + + The sequence to test + True if the sequence is a ring + + + + + Ensures that a CoordinateSequence forms a valid ring, + returning a new closed sequence of the correct length if required. + If the input sequence is already a valid ring, it is returned + without modification. + If the input sequence is too short or is not closed, + it is extended with one or more copies of the start point. + + The CoordinateSequenceFactory to use to create the new sequence + The sequence to test + The original sequence, if it was a valid ring, or a new sequence which is valid. + + + + Tests whether two s are equal. + To be equal, the sequences must be the same length. + They do not need to be of the same dimension, + but the ordinate values for the smallest dimension of the two + must be equal. + Two NaN ordinates values are considered to be equal. + + a CoordinateSequence + a CoordinateSequence + true if the sequences are equal in the common dimensions + + + + Creates a string representation of a . + The format is: + + ( ord0,ord1.. ord0,ord1,... ... ) + + + the sequence to output + the string representation of the sequence + + + + The CoordinateSequence implementation that Geometries use by default. In + this implementation, Coordinates returned by ToArray and GetCoordinates are live -- + parties that change them are actually changing the + DefaultCoordinateSequence's underlying data. + + + + + Constructs a DefaultCoordinateSequence based on the given array (the + array is not copied). + + Coordinate array that will be assimilated. + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns a copy of the coordinate at specified index. + + Coordinate index. + The copy of the coordinate specified. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Returns a deep copy of the object passed. + + The copied object. + + + + This method exposes the internal Array of Coordinate Objects. + + Coordinate[] array. + + + + Returns the string Representation of the coordinate array + + A string. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the coordinate at specified index. + + Coordinate index. + Coordinate specified. + + + + Returns the elements number of the coordinate sequence. + + + + + + Returns the elements number of the coordinate sequence. + + The length. + + + + Creates CoordinateSequences internally represented + as an array of x's and an array of y's. + + + + + + + + + + Returns a DefaultCoordinateSequence based on the given array + (the array is not copied). + + Coordinates array, which may not be null + nor contain null elements + Singleton instance of DefaultCoordinateSequenceFactory. + + + + Returns the singleton instance of DefaultCoordinateSequenceFactory. + + Singleton instance of DefaultCoordinateSequenceFactory. + + + + A representation of a planar, linear vector geometry. + + + +

Binary Predicates:

+ Because it is not clear at this time what semantics for spatial + analysis methods involving GeometryCollections would be useful, + GeometryCollections are not supported as arguments to binary + predicates or the Relate method. +
+ +

Overlay Methods:

+ The spatial analysis methods will + return the most specific class possible to represent the result. If the + result is homogeneous, a Point, LineString, or + Polygon will be returned if the result contains a single + element; otherwise, a MultiPoint, MultiLineString, + or MultiPolygon will be returned. If the result is + heterogeneous a GeometryCollection will be returned. +
+ + Representation of Computed Geometries: + The SFS states that the result + of a set-theoretic method is the "point-set" result of the usual + set-theoretic definition of the operation (SFS 3.2.21.1). However, there are + sometimes many ways of representing a point set as a Geometry. + The SFS does not specify an unambiguous representation of a given point set + returned from a spatial analysis method. One goal of NTS is to make this + specification precise and unambiguous. NTS uses a canonical form for + Geometrys returned from overlay methods. The canonical + form is a Geometry which is simple and noded: + Simple means that the Geometry returned will be simple according to + the NTS definition of IsSimple. + Noded applies only to overlays involving LineStrings. It + means that all intersection points on LineStrings will be + present as endpoints of LineStrings in the result. + This definition implies that non-simple geometries which are arguments to + spatial analysis methods must be subjected to a line-dissolve process to + ensure that the results are simple. + + + Constructed Points And The Precision Model: + The results computed by the set-theoretic methods may + contain constructed points which are not present in the input Geometrys. + These new points arise from intersections between line segments in the + edges of the input Geometrys. In the general case it is not + possible to represent constructed points exactly. This is due to the fact + that the coordinates of an intersection point may contain twice as many bits + of precision as the coordinates of the input line segments. In order to + represent these constructed points explicitly, NTS must truncate them to fit + the PrecisionModel. + Unfortunately, truncating coordinates moves them slightly. Line segments + which would not be coincident in the exact result may become coincident in + the truncated representation. This in turn leads to "topology collapses" -- + situations where a computed element has a lower dimension than it would in + the exact result. + When NTS detects topology collapses during the computation of spatial + analysis methods, it will throw an exception. If possible the exception will + report the location of the collapse. + + + +

Geometry Equality

+ There are two ways of comparing geometries for equality: + structural equality and topological equality. +

Structural Equality

+ Structural Equality is provided by the + method. + This implements a comparison based on exact, structural pointwise + equality. + The is a synonym for this method, + to provide structural equality semantics for + use in collections. + It is important to note that structural pointwise equality + is easily affected by things like + ring order and component order. In many situations + it will be desirable to normalize geometries before + comparing them (using the + or methods). + is provided + as a convenience method to compute equality over + normalized geometries, but it is expensive to use. + Finally, + allows using a tolerance value for point comparison. + +

Topological Equality

+ Topological Equality is provided by the + method. + It implements the SFS definition of point-set equality + defined in terms of the DE-9IM matrix. + To support the SFS naming convention, the method + is also provided as a synonym. + However, due to the potential for confusion with + its use is discouraged. + + Since and are overridden, + Geometries can be used effectively in .Net collections. + +
+
+ + + + + + + An object reference which can be used to carry ancillary data defined + by the client. + + + + The bounding box of this Geometry. + + + + + Creates a new Geometry via the specified GeometryFactory. + + The factory + + + + Returns true if the array contains any non-empty Geometrys. + + an array of Geometrys; no elements may be null + + true if any of the Geometrys + IsEmpty methods return false. + + + + + Returns true if the array contains any null elements. + + an array to validate. + true if any of arrays elements are null. + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + Returns an element Geometry from a GeometryCollection, + or this, if the geometry is not a collection. + + The index of the geometry element. + The n'th geometry contained in this geometry. + + + + Returns the minimum distance between this Geometry + and another Geometry g. + + The Geometry from which to compute the distance. + The distance between the geometries + 0 if either input geometry is empty + if g is null + + + + Tests whether the distance from this Geometry + to another is less than or equal to a specified value. + + the Geometry to check the distance to. + the distance value to compare. + true if the geometries are less than distance apart. + + + + Notifies this geometry that its coordinates have been changed by an external + party (for example, via a ). + + + When this method is called the geometry will flush + and/or update any derived information it has cached (such as its ). + The operation is applied to all component Geometries. + + + + + Notifies this Geometry that its Coordinates have been changed by an external + party. When GeometryChanged is called, this method will be called for + this Geometry and its component Geometries. + + + + + Tests whether this geometry is disjoint from the argument geometry. + + + The Disjoint predicate has the following equivalent definitions: + + The DE-9IM intersection matrix for the two geometries matches FF*FF****. + !g.intersects(this) == true
(Disjoint is the inverse of Intersects)
+
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys are disjoint. + +
+ + + Tests whether this geometry touches the argument geometry + + + The Touches predicate has the following equivalent definitions: + + The geometries have at least one point in common, + but their interiors do not intersect + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns + + FT*******, + F**T***** or + F***T****. + + + If both geometries have dimension 0, the predicate returns false, + since points have only interiors. + This predicate is symmetric. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys touch; + Returns false if both Geometrys are points. + + + + + Tests whether this geometry intersects the argument geometry. + + + The Intersects predicate has the following equivalent definitions: + + The two geometries have at least one point in common + The DE-9IM Intersection Matrix for the two geometries matches
+ [T********] or
+ [*T*******] or
+ [***T*****] or
+ [****T****]
+ !g.disjoint(this)
+ (Intersects is the inverse of Disjoint)
+
+ The Geometry with which to compare this Geometry. + true if the two Geometrys intersect. + +
+ + + Tests whether this geometry crosses the specified geometry. + + + The Crosses predicate has the following equivalent definitions: + + The geometries have some but not all interior points in common. + The DE-9IM Intersection Matrix for the two geometries matches + one of the following patterns: + + CodeDescription + [T*T******]for P/L, P/A, and L/A situations + [T*****T**]for L/P, A/P, and A/L situations) + [0********]for L/L situations + + + + For any other combination of dimensions this predicate returns false. + + The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. + In order to make the relation symmetric, + NTS extends the definition to apply to L/P, A/P and A/L situations as well. + + + The Geometry with which to compare this Geometry + true if the two Geometrys cross. + + + + Tests whether this geometry is within the specified geometry. + + + The within predicate has the following equivalent definitions: + + + Every point of this geometry is a point of the other geometry, + and the interiors of the two geometries have at least one point in common. + + The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***] + g.contains(this) == true
(Within is the converse of )
+
+ + An implication of the definition is that "The boundary of a geometry is not within the Polygon". + In other words, if a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) == false + (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) + For a predicate with similar behaviour but avoiding + this subtle limitation, see . + +
+ The Geometry with which to compare this Geometry. + true if this Geometry is within other. + + +
+ + + + Tests whether this geometry overlaps the specified geometry. + + + The Overlaps predicate has the following equivalent definitions: + + The geometries have at least one point each not shared by the other (or equivalently neither covers the other), + they have the same dimension, + and the intersection of the interiors of the two geometries has + the same dimension as the geometries themselves. + The DE-9IM Intersection Matrix for the two geometries matches + [T*T***T**] (for two points or two surfaces) + or [1*T***T**] (for two curves) + + If the geometries are of different dimension this predicate returns false. + + The Geometry with which to compare this Geometry. + + true if the two Geometrys overlap. + For this function to return true, the Geometry + s must be two points, two curves or two surfaces. + + + + + Tests whether this geometry covers the argument geometry + + + The covers predicate has the following equivalent definitions: + + Every point of the other geometry is a point of this geometry. + The DE-9IM Intersection Matrix for the two geometries matches at least + one of the following patterns: + + [T*****FF*] or
+ [*T****FF*] or
+ [***T**FF*] or
+ [****T*FF*] +
+
+ g.CoveredBy(this) == true
+ (covers is the converse of )
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + In particular, unlike Contains it does not distinguish between + points in the boundary and in the interior of geometries. + For most situations, Covers should be used in preference to Contains. + As an added benefit, Covers is more amenable to optimization, + and hence should be more performant. + +
+ The Geometry with which to compare this Geometry + true if this Geometry covers + + +
+ + Tests whether this geometry is covered by the specified geometry. + + The CoveredBy predicate has the following equivalent definitions: + + Every point of this geometry is a point of the other geometry. + + The DE-9IM Intersection Matrix for the two geometries matches + at least one of the following patterns: + + [T*F**F***] + [*TF**F***] + [**FT*F***] + [**F*TF***] + g.Covers(this) == true
+ (CoveredBy is the converse of ) +
+
+ If either geometry is empty, the value of this predicate is false. + + This predicate is similar to , + but is more inclusive (i.e. returns true for more cases). + +
+ the Geometry with which to compare this Geometry + true if this Geometry is covered by g + + +
+ + + Tests whether the elements in the DE-9IM + for the two Geometrys match the elements in intersectionPattern. + + + The pattern is a 9-character string, with symbols drawn from the following set: + + 0 (dimension 0) + 1 (dimension 1) + 2 (dimension 2) + T ( matches 0, 1 or 2) + F ( matches FALSE) + * ( matches any value) + For more information on the DE-9IM, see the OpenGIS Simple Features + Specification. + + the Geometry with which to compare this Geometry + the pattern against which to check the + intersection matrix for the two Geometrys + true if the DE-9IM intersection + matrix for the two Geometrys match intersectionPattern + + + + + Returns the DE-9IM intersection matrix for the two Geometrys. + + The Geometry with which to compare this Geometry + + A matrix describing the intersections of the interiors, + boundaries and exteriors of the two Geometrys. + + + + + Tests whether this geometry is + topologically equal to the argument geometry. + + This method is included for backward compatibility reasons. + It has been superseded by the method, + which has been named to clearly denote its functionality. + + This method should NOT be confused with the method + , which implements + an exact equality comparison. + + The Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal. + + + + + Tests whether this geometry is topologically equal to the argument geometry + as defined by the SFS Equals predicate. + + + The SFS equals predicate has the following equivalent definitions: + + The two geometries have at least one point in common, + and no point of either geometry lies in the exterior of the other geometry. + The DE-9IM Intersection Matrix for the two geometries matches + the pattern T*F**FFF* +
+            T*F
+            **F
+            FF*
+            
+
+ Note that this method computes topologically equality. + For structural equality, see {@link #equalsExact(Geometry)}. +
+ the Geometry with which to compare this Geometry + true if the two Geometrys are topologically equal +
+ + + Tests whether this geometry is structurally and numerically equal + to a given Object. + + + If the argument Object is not a Geometry, + the result is false. + Otherwise, the result is computed using + . + + This method is provided to fulfill the Java contract + for value-based object equality. + In conjunction with + it provides semantics which are most useful + for using + Geometrys as keys and values in Java collections. + + Note that to produce the expected result the input geometries + should be in normal form. It is the caller's + responsibility to perform this where required + (using + or as appropriate). + + The object to compare + true if this geometry is exactly equal to the argument + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets a hash code for the Geometry. + + + An integer value suitable for use as a hashcode + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + Returns the Well-known Text representation of this Geometry. + For a definition of the Well-known Text format, see the OpenGIS Simple + Features Specification. + + + The Well-known Text representation of this Geometry. + + + + + + + + + + + Returns the Well-known Binary representation of this Geometry. + For a definition of the Well-known Binary format, see the OpenGIS Simple + Features Specification. + + The Well-known Binary representation of this Geometry. + + + + + + + + + + Returns the feature representation as GML 2.1.1 XML document. + This XML document is based on Geometry.xsd schema. + NO features or XLink are implemented here! + + + + + Computes a buffer area around this geometry having the given width. The + buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The buffer geometry is constructed using 8 segments per quadrant to approximate + the circular arcs. + The end cap style is BufferStyle.CapRound. + + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given width. + The buffer of a Geometry is the Minkowski sum or difference of the geometry + with a disc of radius Abs(distance). + + + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified accuracy of approximation for circular arcs. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + + + + The width of the buffer (may be positive, negative or 0), interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + + + +
+ + + Computes a buffer region around this Geometry having the given + width and with a specified number of segments used to approximate curves. + The buffer of a Geometry is the Minkowski sum of the Geometry with + a disc of radius distance. Curves in the buffer polygon are + approximated with line segments. This method allows specifying the + accuracy of that approximation. + + Mathematically-exact buffer area boundaries can contain circular arcs. + To represent these arcs using linear geometry they must be approximated with line segments. + The quadrantSegments argument allows controlling the accuracy of + the approximation by specifying the number of line segments used to + represent a quadrant of a circle + The end cap style specifies the buffer geometry that will be + created at the ends of linestrings. The styles provided are: +
    +
  • - (default) a semi-circle
  • +
  • - a straight line perpendicular to the end segment
  • +
  • - a half-square
  • +
+ The buffer operation always returns a polygonal result. The negative or + zero-distance buffer of lines and points is always an empty . + This is also the result for the buffers of degenerate (zero-area) polygons. + +
+ + The width of the buffer, interpreted according to the + PrecisionModel of the Geometry. + + The number of segments to use to approximate a quadrant of a circle. + Cap Style to use for compute buffer. + + a polygonal geometry representing the buffer region (which may be empty) + + If a robustness error occurs + + + + +
+ + + + + + Returns the smallest convex Polygon that contains all the + points in the Geometry. This obviously applies only to Geometry + s which contain 3 or more points. + + the minimum-area convex polygon containing this Geometry's points. + + + + Computes a new geometry which has all component coordinate sequences + in reverse order (opposite orientation) to this one. + + A reversed geometry + + + + Computes a Geometry representing the point-set which is + common to both this Geometry and the other Geometry. + + The intersection of two geometries of different dimension produces a result + geometry of dimension less than or equal to the minimum dimension of the input + geometries. + The result geometry may be a heterogenous . + If the result is empty, it is an atomic geometry + with the dimension of the lowest input dimension. + + Intersection of s is supported + only for homogeneous collection types. + + Non-empty heterogeneous arguments are not supported. + + The Geometry with which to compute the intersection. + A geometry representing the point-set common to the two Geometrys. + if a robustness error occurs. + if the argument is a non-empty heterogenous GeometryCollection + + + + Computes a Geometry representing the point-set + which is contained in both this + Geometry and the other Geometry. + + + The method may be used on arguments of different dimension, but it does not + support arguments. + + The union of two geometries of different dimension produces a result + geometry of dimension equal to the maximum dimension of the input + geometries. + The result geometry may be a heterogenous + . + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Unioning s has the effect of + noding and dissolving the input linework. In this context + "noding" means that there will be a node or endpoint in the result for + every endpoint or line segment crossing in the input. "Dissolving" means + that any duplicate (i.e. coincident) line segments or portions of line + segments will be reduced to a single line segment in the result. + If merged linework is required, the + class can be used. + + Non-empty arguments are not supported. + the Geometry with which to compute the union + A point-set combining the points of this Geometry and the + points of other + Thrown if a robustness error occurs + Thrown if either input is a non-empty GeometryCollection + + + + + Computes a Geometry representing the closure of the point-set + of the points contained in this Geometry that are not contained in + the other Geometry. + + If the result is empty, it is an atomic geometry + with the dimension of the left-hand input. + + Non-empty arguments are not supported. + + The Geometry with which to compute the difference. + A Geometry representing the point-set difference of this Geometry with other. + + + + Computes a Geometry representing the closure of the point-set + which is the union of the points in this Geometry which are not + contained in the other Geometry, + with the points in the other Geometry not contained in this + Geometry. + If the result is empty, it is an atomic geometry + with the dimension of the highest input dimension. + + Non-empty arguments are not supported. + + The Geometry with which to compute the symmetric difference. + a Geometry representing the point-set symmetric difference of this Geometry with other. + + + + Computes the union of all the elements of this geometry. + + + This method supports s (which the other overlay operations currently do not). + + The result obeys the following contract: + + Unioning a set of s has the effect of fully noding and dissolving the linework. + Unioning a set of s always returns a geometry + (unlike ), which may return geometries of lower dimension if a topology + collapse occurred). + + + Thrown if a robustness error occurs + + + + Returns true if the two Geometrys are exactly equal, + up to a specified tolerance. + Two Geometries are exactly within a tolerance equal if: + + they have the same class, + they have the same values of Coordinates, + within the given tolerance distance, in their internal + Coordinate lists, in exactly the same order. + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry + have identical structure and point values, up to the distance tolerance. + Distance at or below which two Coordinates will be considered equal. + + true if this and the other Geometry + are of the same class and have equal internal data. + + + + + + + + Returns true if the two Geometrys are exactly equal. + Two Geometries are exactly equal if: + + they have the same class, + they have the same values of Coordinates in their internal + Coordinate lists, in exactly the same order. + + This provides a stricter test of equality than + , which is more useful + in certain situations + (such as using geometries as keys in collections). + + This method does not + test the values of the GeometryFactory, the SRID, + or the UserData fields. + + To properly test equality between different geometries, + it is usually necessary to them first. + + The Geometry with which to compare this Geometry. + + true if this and the other Geometry have identical structure and point values. + + + + + Tests whether two geometries are exactly equal + in their normalized forms. + + This is a convenience method which creates normalized + versions of both geometries before computing + . + This method is relatively expensive to compute. + For maximum performance, the client + should instead perform normalization on the individual geometries + at an appropriate point during processing. + + + A geometry + true if the input geometries are exactly equal in their normalized form + + + + + Performs an operation with or on this Geometry's coordinates. + + + If this method modifies any coordinate values, + must be called to update the geometry state. + Note that you cannot use this method to + modify this Geometry if its underlying CoordinateSequence's #get method + returns a copy of the Coordinate, rather than the actual Coordinate stored + (if it even stores Coordinate objects at all). + + The filter to apply to this Geometry's coordinates + + + + Performs an operation on the coordinates in this Geometry's s. + + + If the filter reports that a coordinate value has been changed, + will be called automatically. + + The filter to apply + + + + Performs an operation with or on this Geometry and its + subelement Geometrys (if any). + Only GeometryCollections and subclasses + have subelement Geometry's. + + + The filter to apply to this Geometry (and + its children, if it is a GeometryCollection). + + + + + Performs an operation with or on this Geometry and its + component Geometry's. Only GeometryCollections and + Polygons have component Geometry's; for Polygons they are the LinearRings + of the shell and holes. + + The filter to apply to this Geometry. + + + + + + + + + + Converts this Geometry to normal form (or canonical form ). + + + + Normal form is a unique representation for Geometrys. + It can be used to test whether two Geometrys are equal + in a way that is independent of the ordering of the coordinates within + them. Normal form equality is a stronger condition than topological + equality, but weaker than pointwise equality. + + The definitions for normal + form use the standard lexicographical ordering for coordinates. "Sorted in + order of coordinates" means the obvious extension of this ordering to + sequences of coordinates. + + + NOTE that this method mutates the value of this geometry in-place. + If this is not safe and/or wanted, the geometry should be + cloned prior to normalization. + + + + + + Creates a new Geometry which is a normalized copy of this Geometry. + + A normalized copy of this geometry. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry. + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry, using the given . + + If their classes are different, they are compared using the following + ordering: + + Point (lowest), + MultiPoint, + LineString, + LinearRing, + MultiLineString, + Polygon, + MultiPolygon, + GeometryCollection (highest). + + If the two Geometrys have the same class, their first + elements are compared. If those are the same, the second elements are + compared, etc. + + A Geometry with which to compare this Geometry + A IComparer<ICoordinateSequence> + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether the two Geometrys are equal, from the point + of view of the EqualsExact method. Called by EqualsExact + . In general, two Geometry classes are considered to be + "equivalent" only if they are the same class. An exception is LineString + , which is considered to be equivalent to its subclasses. + + The Geometry with which to compare this Geometry for equality. + + true if the classes of the two Geometry + s are considered to be equal by the equalsExact method. + + + + + Throws an exception if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + if g is a GeometryCollection, but not one of its subclasses. + + + + + Returns true if g's class is GeometryCollection. + (its subclasses do not trigger an exception). + + The Geometry to check. + + If g is a GeometryCollection, but not one of its subclasses. + + + + + Returns the minimum and maximum x and y values in this Geometry, + or a null Envelope if this Geometry is empty. + Unlike EnvelopeInternal, this method calculates the Envelope + each time it is called; EnvelopeInternal caches the result + of this method. + + + This Geometrys bounding box; if the Geometry + is empty, Envelope.IsNull will return true. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry having the same class. + + A Geometry having the same class as this Geometry. + + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the NTS Technical + Specifications. + + + + + Returns whether this Geometry is greater than, equal to, + or less than another Geometry of the same class. + using the given . + + A Geometry having the same class as this Geometry + The comparer + A positive number, 0, or a negative number, depending on whether + this object is greater than, equal to, or less than o, as + defined in "Normal Form For Geometry" in the JTS Technical + Specifications + + + + + Returns the first non-zero result of CompareTo encountered as + the two Collections are iterated over. If, by the time one of + the iterations is complete, no non-zero result has been encountered, + returns 0 if the other iteration is also complete. If b + completes before a, a positive number is returned; if a + before b, a negative number. + + A Collection of IComparables. + A Collection of IComparables. + The first non-zero compareTo result, if any; otherwise, zero. + + + + + + + + + + + + + + + + + + + + + A predefined with == . + + + + + + + Gets the factory which contains the context in which this point was created. + + The factory for this point. + + + + Gets/Sets the user data object for this point, if any. + + + A simple scheme for applications to add their own custom data to a Geometry. + An example use might be to add an object representing a Coordinate Reference System. + Note that user data objects are not present in geometries created by + construction methods. + + + + + Sets the ID of the Spatial Reference System used by the Geometry. + + + + NOTE: This method should only be used for exceptional circumstances or + for backwards compatibility. Normally the SRID should be set on the + used to create the geometry. + SRIDs set using this method will not be propagated to + geometries returned by constructive methods. + + + + + + Returns the name of this Geometry's actual class. + + The name of this Geometrys actual class. + + + + Gets the OGC geometry type + + + + + Returns the PrecisionModel used by the Geometry. + + + the specification of the grid of allowable points, for this + Geometry and all other Geometrys. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the number of Geometryes in a GeometryCollection, + or 1, if the geometry is not a collection. + + + + + Tests whether this is simple. + + The SFS definition of simplicity + follows the general rule that a Geometry is simple if it has no points of + self-tangency, self-intersection or other anomalous points. + + Simplicity is defined for each subclass as follows: + + Valid polygonal geometries are simple, since their rings + must not self-intersect. IsSimple + tests for this condition and reports false if it is not met. + (This is a looser test than checking for validity). + Linear rings have the same semantics. + Linear geometries are simple iff they do not self-intersect at points + other than boundary points. + Zero-dimensional geometries (points) are simple iff they have no + repeated points. + Empty Geometrys are always simple. + + + true if this Geometry is simple + + + + + Tests whether this Geometry is topologically + valid, according to the OGC SFS specification. + For validity rules see the documentation for the specific geometry subclass. + + true if this Geometry is valid. + + + + Tests whether the set of points covered in this Geometry is empty. + + true if this Geometry does not cover any points. + + + + Returns the area of this Geometry. + Areal Geometries have a non-zero area. + They override this function to compute the area. + Others return 0.0 + + The area of the Geometry. + + + + Returns the length of this Geometry. + Linear geometries return their length. + Areal geometries return their perimeter. + They override this function to compute the length. + Others return 0.0 + + The length of the Geometry. + + + + Computes the centroid of this Geometry. + The centroid + is equal to the centroid of the set of component Geometries of highest + dimension (since the lower-dimension geometries contribute zero + "weight" to the centroid). + + The centroid of an empty geometry is POINT EMPTY. + + A Point which is the centroid of this Geometry. + + + + Computes an interior point of this Geometry. + + + An interior point is guaranteed to lie in the interior of the Geometry, + if it possible to calculate such a point exactly. Otherwise, + the point may lie on the boundary of the point. + + The interior point of an empty geometry is POINT EMPTY. + + A Point which is in the interior of this Geometry. + + + + + + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the boundary, or an empty geometry of appropriate dimension + if this Geometry is empty. + For a discussion of this function, see the OpenGIS Simple + Features Specification. As stated in SFS Section 2.1.13.1, "the boundary + of a Geometry is a set of Geometries of the next lower dimension." + + The closure of the combinatorial boundary of this Geometry. + NOTE: make abstract, remove setter and change geoapi + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + Gets a geometry representing the envelope (bounding box) of this Geometry. + + If this Geometry is + + empty, returns an empty Point + a point, returns a Point + a line parallel to an axis, a two-vertex LineString, + otherwise, returns a + Polygon whose vertices are (minx, miny), (maxx, miny), (maxx, + maxy), (minx, maxy), (minx, miny). + + + + A Geometry representing the envelope of this Geometry + + + + + + Gets an containing + the minimum and maximum x and y values in this Geometry. + If the geometry is empty, an empty Envelope + is returned. + + + The returned object is a copy of the one maintained internally, + to avoid aliasing issues. + For best performance, clients which access this + envelope frequently should cache the return value. + the envelope of this Geometry. + An empty Envelope if this Geometry is empty + + + + + + + + + + + + + + + Basic implementation of GeometryCollection. + + + + + Represents an empty GeometryCollection. + + + + + Internal representation of this GeometryCollection. + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + For create this is used a standard + with == . + + + + + + + + The Geometrys for this GeometryCollection, + or null or an empty array to create the empty + point. Elements may be empty Geometrys, + but not nulls. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a GeometryCollectionEnumerator: + this IEnumerator returns the parent geometry as first element. + In most cases is more useful the code + geometryCollectionInstance.Geometries.GetEnumerator(): + this returns an IEnumerator over geometries composing GeometryCollection. + + + + + + Creates a with + every component reversed. + The order of the components in the collection are not reversed. + + A in the reverse order + + + + + + + + + Collects all coordinates of all subgeometries into an Array. + Note that while changes to the coordinate objects themselves + may modify the Geometries in place, the returned Array as such + is only a temporary container which is not synchronized back. + + The collected coordinates. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "GeometryCollection" + + + + Gets the OGC geometry type + + + + + + + + + + Returns the area of this GeometryCollection. + + + + + Returns the length of this GeometryCollection. + + + + + Return true if all features in collection are of the same type. + + + + + Returns the iTh element in the collection. + + + + + + + Returns the number of geometries contained by this . + + + + + Iterates over all Geometry's in a GeometryCollection. + Implements a pre-order depth-first traversal of the GeometryCollection + (which may be nested). The original GeometryCollection is + returned as well (as the first object), as are all sub-collections. It is + simple to ignore the GeometryCollection objects if they are not + needed. + + + + + The GeometryCollection being iterated over. + + + + + Indicates whether or not the first element (the GeometryCollection) + has been returned. + + + + + The number of Geometrys in the the GeometryCollection. + + + + + The index of the Geometry that will be returned when next + is called. + + + + + The iterator over a nested GeometryCollection, or null + if this GeometryCollectionIterator is not currently iterating + over a nested GeometryCollection. + + + + + Constructs an iterator over the given GeometryCollection. + + + The collection over which to iterate; also, the first + element returned by the iterator. + + + + + + + + + + + + + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + + + The parent GeometryCollection is the first object returned! + + + + Delegate function declaration to handle filter operation + + The geometry to filter + + + + An implementation that applies filtering with the provided + + + + + Creates an instance of this class + + The filter method to be used + + + + Supplies a set of utility methods for building Geometry objects + from lists of Coordinates. + + + Note that the factory constructor methods do not change the input coordinates in any way. + In particular, they are not rounded to the supplied PrecisionModel. + It is assumed that input Coordinates meet the given precision. + + + + + A predefined with + == . + + + + + A predefined with + == . + + A shortcut for . + + + + A predefined with + == . + + + + + A predefined with + == . + + + + + + + + + + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. + + + + + Constructs a GeometryFactory that generates Geometries having the given + CoordinateSequence implementation, a double-precision floating PrecisionModel and a + spatial-reference ID of 0. + + + + + Constructs a GeometryFactory that generates Geometries having the given + {PrecisionModel} and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + + + + Constructs a GeometryFactory that generates Geometries having the given + PrecisionModel and spatial-reference ID, and the default CoordinateSequence + implementation. + + The PrecisionModel to use. + The SRID to use. + + + + Constructs a GeometryFactory that generates Geometries having a floating + PrecisionModel and a spatial-reference ID of 0. + + + + + Converts the ICollection to an array. + + The ICollection of Points to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Geometry's to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of LinearRings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of Polygons to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPoints to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiLineStrings to convert. + The ICollection in array format. + + + + Converts the ICollection to an array. + + The ICollection of MultiPolygons to convert. + The ICollection in array format. + + + + Creates a with the same extent as the given envelope. + + + + The Geometry returned is guaranteed to be valid. + To provide this behaviour, the following cases occur: + + + If the Envelope is: +
    +
  • null returns an empty
  • +
  • a point returns a non-empty
  • +
  • a line returns a two-point
  • +
  • a rectangle returns a whose points are (minx, maxy), (minx, maxy), (maxx, maxy), (maxx, miny).
  • +
+
+
+ The Envelope + + An empty Point (for null Envelopes), a Point (when min x = max x and min y = max y) or a Polygon (in all other cases) + +
+ + + Creates a Point using the given Coordinate. + A null coordinate creates an empty Geometry. + + a Coordinate, or null + A object + + + + Creates a Point using the given CoordinateSequence; a null or empty + CoordinateSequence will create an empty Point. + + a CoordinateSequence (possibly empty), or null + A object + + + + Creates a LineString using the given Coordinates. + A null or empty array creates an empty LineString. + + An array without null elements, or an empty array, or null. + A object + + + + Creates a LineString using the given CoordinateSequence. + A null or empty CoordinateSequence creates an empty LineString. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a LinearRing using the given Coordinates; a null or empty array + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + An array without null elements, or an empty array, or null. + A object + If the ring is not closed, or has too few points + + + + Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence + creates an empty LinearRing. The points must form a closed and simple + linestring. Consecutive points must not be equal. + + A CoordinateSequence (possibly empty), or null. + A object + If the ring is not closed, or has too few points + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty point is to be created. + + + The inner boundaries of the new Polygon, or + null or empty LinearRing s if + the empty point is to be created. + + A object + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + A object + If the boundary ring is invalid + + + + Constructs a Polygon with the given exterior boundary. + + the outer boundary of the new Polygon, or + null or an empty LinearRing if + the empty geometry is to be created. + the created Polygon + If the boundary ring is invalid + + + + Creates a using the given Points. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null. + A object + + + + Creates a using the given Coordinates. + A null or empty array will create an empty MultiPoint. + + An array (without null elements), or an empty array, or null + A object + + + + Creates a using the given CoordinateSequence. + A null or empty CoordinateSequence will create an empty MultiPoint. + + A CoordinateSequence (possibly empty), or null. + A object + + + + Creates a MultiLineString using the given LineStrings; a null or empty + array will create an empty MultiLineString. + + LineStrings, each of which may be empty but not null- + A object + + + + Creates a MultiPolygon using the given Polygons; a null or empty array + will create an empty Polygon. The polygons must conform to the + assertions specified in the OpenGIS Simple Features + Specification for SQL. + + Polygons, each of which may be empty but not null. + A object + + + + Creates a GeometryCollection using the given Geometries; a null or empty + array will create an empty GeometryCollection. + + an array of Geometries, each of which may be empty but not null, or null + A object + + + + Build an appropriate Geometry, MultiGeometry, or + GeometryCollection to contain the Geometrys in + it. + + + If geomList contains a single Polygon, + the Polygon is returned.
+ If geomList contains several Polygons, a + MultiPolygon is returned.
+ If geomList contains some Polygons and + some LineStrings, a GeometryCollection is + returned.
+ If geomList is empty, an empty GeometryCollection + is returned. + Note that this method does not "flatten" Geometries in the input, and hence if + any MultiGeometries are contained in the input a GeometryCollection containing + them will be returned. +
+ The Geometry to combine. + + A of the "smallest", "most type-specific" + class that can contain the elements of geomList. + +
+ + + Creates a deep copy of the input . + The defined for this factory + is used to copy the s + of the input geometry. + + This is a convenient way to change the CoordinateSequence + used to represent a geometry, or to change the + factory used for a geometry. + + can also be used to make a deep copy, + but it does not allow changing the CoordinateSequence type. + + The geometry + A deep copy of the input geometry, using the CoordinateSequence type of this factory + + + + + Returns the PrecisionModel that Geometries created by this factory + will be associated with. + + + + + + + + + + The SRID value defined for this factory. + + + + + A backed by an array of s. + This is the implementation that s use by default. + + Coordinates returned by , and are live -- + modifications to them are actually changing the + CoordinateSequence's underlying data. + A dimension may be specified for the coordinates in the sequence, + which may be 2 or 3. + The actual coordinates will always have 3 ordinates, + but the dimension is useful as metadata in some situations. + + + + The actual dimension of the coordinates in the sequence. + Allowable values are 2 or 3. + + + + Constructs a sequence based on the given array of s. + The coordinate dimension is 3 + + + The array is not copied. + + The coordinate array that will be referenced. + + + + Constructs a sequence based on the given array + of s. + + The Array is not copied + The coordinate array that will be referenced. + The dimension of the coordinates + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + + + + Constructs a sequence of a given , populated + with new s of the given . + + The size of the sequence to create. + the dimension of the coordinates + + + + Creates a new sequence based on a deep copy of the given . + + The coordinate sequence that will be copied + + + + Get the Coordinate with index i. + + The index of the coordinate. + The requested Coordinate instance. + + + + Get a copy of the Coordinate with index i. + + The index of the coordinate. + A copy of the requested Coordinate. + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Creates a deep copy of the object. + + The deep copy. + + + + + + + + + + Sets the value for a given ordinate of a coordinate in this sequence. + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + The new ordinate value. + + + + This method exposes the internal Array of Coordinate Objects. + + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the string representation of the coordinate array. + + + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the length of the coordinate sequence. + + + + + Creates CoordinateSequences represented as an array of Coordinates. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Returns the singleton instance of CoordinateArraySequenceFactory. + + + + + A coordinate sequence that follows the dotspatial shape range + + + + + Creates an instance of this class + + The + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The number of dimensions. + + + + Constructs a sequence of a given size, populated with new Coordinates. + + The size of the sequence to create. + The kind of ordinates. + + + + Creates a sequence based on the given coordinate sequence. + + The coordinate sequence. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a reversed version of this coordinate sequence with cloned s + + A reversed version of this sequence + + + + Releases the weak reference to the weak referenced coordinate array + + This is necessary if you modify the values of the , , arrays externally. + + + + Gets the vector with x- and y-ordinate values; + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with z-ordinate values + + If you modify the values of this vector externally, you need to call ! + + + + Gets the vector with measure values + + If you modify the values of this vector externally, you need to call ! + + + + A coordinate sequence factory class that creates DotSpatial's Shape/ShapeRange like coordinate sequences. + + + + + Returns a CoordinateArraySequence based on the given array (the array is not copied). + + the coordinates, which may not be null nor contain null elements. + + + + + Creates a which is a copy + of the given . + This method must handle null arguments by creating an empty sequence. + + + A coordinate sequence + + + + Creates a of the specified size and dimension. + For this to be useful, the implementation must be mutable. + + + the dimension of the coordinates in the sequence + (if user-specifiable, otherwise ignored) + A coordinate sequence + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates. + + The ordinates each coordinate has. is fix, + and can be set. + + A coordinate sequence. + + + + Returns the singleton instance of DotSpatialAffineCoordinateSequenceFactory. + + + + + + Gets the Ordinate flags that sequences created by this factory can cope with. + + + + + A CoordinateSequence implementation based on a packed arrays. + A CoordinateSequence implementation based on a packed arrays. + + + + + A soft reference to the Coordinate[] representation of this sequence. + Makes repeated coordinate array accesses more efficient. + + + + + The dimensions of the coordinates hold in the packed array + + + + + The ordinates + + + + + Returns (possibly a copy of) the ith Coordinate in this collection. + Whether or not the Coordinate returned is the actual underlying + Coordinate or merely a copy depends on the implementation. + Note that in the future the semantics of this method may change + to guarantee that the Coordinate returned is always a copy. Callers are + advised not to assume that they can modify a CoordinateSequence by + modifying the Coordinate returned by this method. + + + + + + + Returns a copy of the i'th coordinate in this sequence. + This method optimizes the situation where the caller is + going to make a copy anyway - if the implementation + has already created a new Coordinate object, no further copy is needed. + + The index of the coordinate to retrieve. + + A copy of the i'th coordinate in the sequence + + + + + Copies the i'th coordinate in the sequence to the supplied Coordinate. + Only the first two dimensions are copied. + + The index of the coordinate to copy. + A Coordinate to receive the value. + + + + Returns (possibly copies of) the Coordinates in this collection. + Whether or not the Coordinates returned are the actual underlying + Coordinates or merely copies depends on the implementation. + Note that if this implementation does not store its data as an array of Coordinates, + this method will incur a performance penalty because the array needs to + be built from scratch. + + + + + + + + + + + + Returns ordinate X (0) of the specified coordinate. + + + + The value of the X ordinate in the index'th coordinate. + + + + + Returns ordinate Y (1) of the specified coordinate. + + + + The value of the Y ordinate in the index'th coordinate. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the first ordinate of a coordinate in this sequence. + + + + + + + Sets the second ordinate of a coordinate in this sequence. + + + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the dimension (number of ordinates in each coordinate) for this sequence. + + + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on doubles. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked. + If it is larger than the dimension a meaningless value may be returned. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Packed coordinate sequence implementation based on floats. + + + + + The packed coordinate array + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Initializes a new instance of the class. + + + + + + + Returns a Coordinate representation of the specified coordinate, by always + building a new Coordinate object. + + + + + + + Gets the underlying array containing the coordinate values. + + The array of coordinate values + + + + Creates a new object that is a copy of the current instance. + + + A new object that is a copy of this instance. + + + + + Returns the ordinate of a coordinate in this sequence. + Ordinate indices 0 and 1 are assumed to be X and Y. + Ordinate indices greater than 1 have user-defined semantics + (for instance, they may contain other dimensions or measure values). + + The coordinate index in the sequence. + The ordinate index in the coordinate (in range [0, dimension-1]). + + + + + Sets the ordinate of a coordinate in this sequence. + + The coordinate index. + The ordinate index in the coordinate, 0 based, + smaller than the number of dimensions. + The new ordinate value. + + Warning: for performance reasons the ordinate index is not checked: + if it is over dimensions you may not get an exception but a meaningless value. + + + + + Expands the given Envelope to include the coordinates in the sequence. + Allows implementing classes to optimize access to coordinate values. + + The envelope to expand. + A reference to the expanded envelope. + + + + Returns the number of coordinates in this sequence. + + + + + + Builds packed array coordinate sequences. The array data type can be either + double or float, and defaults to double. + + + + + Initializes a new instance of the class, + using double values. + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + + + + + + Returns a CoordinateSequence based on the given array; whether or not the + array is copied is implementation-dependent. + + Coordinates array, which may not be null nor contain null elements + + + + + Returns a CoordinateSequence based on the given coordinate sequence; whether or not the + array is copied is implementation-dependent. + + + + + + + Creates a of the specified size and ordinates. + For this to be useful, the implementation must be mutable. + + The number of coordinates + + The ordinates each coordinate has. is fix, and can be set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Models an OGC SFS LinearRing. + + + A LinearRing is a which is both closed and simple. + In other words, + the first and last coordinate in the ring must be equal, + and the interior of the ring must not self-intersect. + Either orientation of the ring is allowed. + + A ring must have either 0 or 4 or more points. + The first and last points must be equal (in 2D). + If these conditions are not met, the constructors throw + an + + + + + Models an OGC-style LineString + + + A LineString consists of a sequence of two or more vertices, + along with all points along the linearly-interpolated curves + (line segments) between each + pair of consecutive vertices. + Consecutive vertices may be equal. + The line segments in the line may intersect each other (in other words, + the linestring may "curl back" in itself and self-intersect. + Linestrings with exactly two identical points are invalid. + A linestring must have either 0 or 2 or more points. + If these conditions are not met, the constructors throw an . + + + + + + Represents an empty LineString. + + + + + The points of this LineString. + + + + + + + + + + + + + + + + + + + Creates a whose coordinates are in the reverse order of this objects. + + A with coordinates in the reverse order. + + + + Returns true if the given point is a vertex of this LineString. + + The Coordinate to check. + true if pt is one of this LineString's vertices. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalizes a LineString. A normalized linestring + has the first point which is not equal to it's reflected point + less than the reflected point. + + + + + + + + + + + + Initializes a new instance of the class. + + + For create this is used a standard + with == . + + The coordinates used for create this . + If too few points are provided + + + + Initializes a new instance of the class. + + + The points of the linestring, or null + to create the empty point. Consecutive points may not be equal. + + + If too few points are provided + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "LineString" + + + + Returns the length of this LineString + + The length of the polygon. + + + + + + + + + + + + + + + + + Returns the value of the angle between the + and the . + + + + + The minimum number of vertices allowed in a valid non-empty ring (= 4). + Empty rings with 0 vertices are also valid. + + + + + Constructs a LinearRing with the given points. + + + Points forming a closed and simple linestring, or + null or an empty array to create the empty point. + This array must not contain null elements. + + + If the ring is not closed, or has too few points + + + + + + + + + Initializes a new instance of the class. + + The points used for create this instance. + + For create this is used a standard + with == . + + If the ring is not closed, or has too few points + + + + Returns Dimensions.False, since by definition LinearRings do not have a boundary. + + + + + Returns the name of this object's interface. + + "LinearRing" + + + + Represents a line segment defined by two Coordinates. + Provides methods to compute various geometric properties + and relationships of line segments. + This class is designed to be easily mutable (to the extent of + having its contained points public). + This supports a common pattern of reusing a single LineSegment + object as a way of computing segment properties on the + segments defined by arrays or lists of Coordinates. + + + + + Creates an instance of this class using two coordinates + + The start-point + The end-point + + + + Creates an instance of this class using another instance + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determines the orientation of a LineSegment relative to this segment. + The concept of orientation is specified as follows: + Given two line segments A and L, + A is to the left of a segment L if A lies wholly in the + closed half-plane lying to the left of L + A is to the right of a segment L if A lies wholly in the + closed half-plane lying to the right of L + otherwise, A has indeterminate orientation relative to L. This + happens if A is collinear with L or if A crosses the line determined by L. + + The LineSegment to compare. + + 1 if seg is to the left of this segment, + -1 if seg is to the right of this segment, + 0 if seg is collinear to or crosses this segment. + + + + + Determines the orientation index of a relative to this segment. + The orientation index is as defined in . + + + + + 1 if p is to the left of this segment + -1 if p is to the right of this segment + 0 if p is collinear with this segment + " + + + + + + Reverses the direction of the line segment. + + + + + Puts the line segment into a normalized form. + This is useful for using line segments in maps and indexes when + topological equality rather than exact equality is desired. + + + + + Computes the distance between this line segment and another one. + + + + + + + Computes the distance between this line segment and a point. + + + + + Computes the perpendicular distance between the (infinite) line defined + by this line segment and a point. + + + + + + + Computes the that lies a given + fraction along the line defined by this segment. + + + A fraction of 0.0 returns the start point of the segment; + A fraction of 1.0 returns the end point of the segment. + If the fraction is < 0.0 or > 1.0 the point returned + will lie before the start or beyond the end of the segment. + + the fraction of the segment length along the line + the point at that distance + + + + Computes the that lies a given + + + A fraction along the line defined by this segment and offset from + the segment by a given distance. + A fraction of 0.0 offsets from the start point of the segment; + A fraction of 1.0 offsets from the end point of the segment. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + + the fraction of the segment length along the line + the distance the point is offset from the segment + (positive is to the left, negative is to the right) + the point at that distance and offset + if the segment has zero length + + + Computes the Projection Factor for the projection of the point p + onto this LineSegment. The Projection Factor is the constant r + by which the vector for this segment must be multiplied to + equal the vector for the projection of p on the line + defined by this segment. + + The projection factor will lie in the range (-inf, +inf), + or be NaN if the line segment has zero length. + + The point to compute the factor for + The projection factor for the point + + + + Computes the fraction of distance (in [0.0, 1.0]) + that the projection of a point occurs along this line segment. + If the point is beyond either ends of the line segment, + the closest fractional value (0.0 or 1.0) is returned. + + + Essentially, this is the clamped to + the range [0.0, 1.0]. + + the point + the fraction along the line segment the projection of the point occurs + + + + Compute the projection of a point onto the line determined + by this line segment. + Note that the projected point may lie outside the line segment. + If this is the case, the projection factor will lie outside the range [0.0, 1.0]. + + + + + + + Project a line segment onto this line segment and return the resulting + line segment. The returned line segment will be a subset of + the target line line segment. This subset may be null, if + the segments are oriented in such a way that there is no projection. + Note that the returned line may have zero length (i.e. the same endpoints). + This can happen for instance if the lines are perpendicular to one another. + + The line segment to project. + The projected line segment, or null if there is no overlap. + + + + Computes the closest point on this line segment to another point. + + The point to find the closest point to. + + A Coordinate which is the closest point on the line segment to the point p. + + + + + Computes the closest points on a line segment. + + + + A pair of Coordinates which are the closest points on the line segments. + + + + + Computes an intersection point between two segments, if there is one. + There may be 0, 1 or many intersection points between two segments. + If there are 0, null is returned. If there is 1 or more, a single one + is returned (chosen at the discretion of the algorithm). If + more information is required about the details of the intersection, + the {RobustLineIntersector} class should be used. + + A line segment + An intersection point, or null if there is none. + + + + + Computes the intersection point of the lines defined by two segments, if there is one. + + + There may be 0, 1 or an infinite number of intersection points between two lines. + If there is a unique intersection point, it is returned. + Otherwise, null is returned. + If more information is required about the details of the intersection, + the class should be used. + + A line segment defining a straight line + An intersection point, or null if there is none or an infinite number + + + + + Creates a LineString with the same coordinates as this segment + + the geometery factory to use + A LineString with the same geometry as this segment + + + + Returns true if o has the same values for its points. + + A LineSegment with which to do the comparison. + + true if o is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + + + + + + + + + + Compares this object with the specified object for order. + Uses the standard lexicographic ordering for the points in the LineSegment. + + + The LineSegment with which this LineSegment + is being compared. + + + A negative integer, zero, or a positive integer as this LineSegment + is less than, equal to, or greater than the specified LineSegment. + + + + + Returns true if other is + topologically equal to this LineSegment (e.g. irrespective + of orientation). + + + A LineSegment with which to do the comparison. + + + true if other is a LineSegment + with the same values for the x and y ordinates. + + + + + + + + + + + + Return HashCode. + + + + + The end-point + + + + + The start-point + + + + + Gets the minimum X ordinate + + + + + Gets the maximum X ordinate + + + + + Gets the minimum Y ordinate + + + + + Gets the maximum Y ordinate + + + + + Computes the length of the line segment. + + The length of the line segment. + + + + Tests whether the segment is horizontal. + + true if the segment is horizontal. + + + + Tests whether the segment is vertical. + + true if the segment is vertical. + + + + The angle this segment makes with the x-axis (in radians). + + + + The midpoint of the segment + + + + Basic implementation of MultiLineString. + + + + + Represents an empty MultiLineString. + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + + + + Constructs a MultiLineString. + + + The LineStrings for this MultiLineString, + or null or an empty array to create the empty + point. Elements may be empty LineStrings, + but not nulls. + + + For create this is used a standard + with == . + + + + + Creates a in the reverse order to this object. + Both the order of the component LineStrings + and the order of their coordinate sequences are reversed. + + a in the reverse order. + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiLineString" + + + + Gets the OGC geometry type + + + + + Gets a value indicating whether this instance is closed. + + true if this instance is closed; otherwise, false. + + + + Models a collection of Points. + + + + + Represents an empty MultiPoint. + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + + + + Constructs a MultiPoint. + + + The Points for this MultiPoint + , or null or an empty array to create the empty point. + Elements may be empty Points, but not nulls. + + + For create this is used a standard + with == . + + + + + + + + + + + + + Returns the Coordinate at the given position. + + The index of the Coordinate to retrieve, beginning at 0. + + The nth Coordinate. + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPoint" + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + Basic implementation of MultiPolygon. + + + + + Represents an empty MultiPolygon. + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + For create this is used a standard + with == . + + + + + Constructs a MultiPolygon. + + + The Polygons for this MultiPolygon + , or null or an empty array to create the empty point. + Elements may be empty Polygons, but not null + s. The polygons must conform to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + + + + + + + + + + + + Creates a {@link MultiPolygon} with every component reversed. + + The order of the components in the collection are not reversed. + An in the reverse order + + + + + + + + + + + + + + Returns the name of this object's interface. + + "MultiPolygon" + + + + + + + + + A bounding container for a which is in the shape of a general octagon. + + + The OctagonalEnvelope of a geometric object + is a geometry which is tight bound along the (up to) four extremal rectilineal parallels + and along the (up to) four extremal diagonal parallels. + Depending on the shape of the contained + geometry, the octagon may be degenerate to any extreme + (e.g. it may be a rectangle, a line, or a point). + + + + + Gets the octagonal envelope of a geometry + + The geometry + The octagonal envelope of the geometry + + + + Creates a new null bounding octagon + + + + + Creates a new null bounding octagon bounding a + + The coordinate to bound + + + + Creates a new null bounding octagon bounding a pair of s + + A coordinate to bound + A coordinate to bound + + + + Creates a new null bounding octagon bounding an + + + + + Creates a new null bounding octagon bounding an + (the copy constructor). + + + + + Creates a new null bounding octagon bounding a + + + + + Sets the value of this object to the null value + + + + + Tests if the extremal values for this octagon are valid. + + @return true if this object has valid values + + + + + OGC compliant geometry factory + + + + + Creates an instance of this class using the default + values for , + and + . + + + + + Creates an instance of this class using the default + values for , + , + but the specified . + + + + Creates an instance of this class using the default + values for , + but the + specified . + + + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. + + + + + + The is guaranteed to be orientated counter-clockwise. +
The are guaranteed to be orientated clockwise. +
+
+ + + Represents a single point. + + A Point is topologically valid if and only if: + + The coordinate which defines it if any) is a valid coordinate + (i.e. does not have an NaN X- or Y-ordinate + + + + + + + Represents an empty Point. + + + + + The Coordinate wrapped by this Point. + + + + + Initializes a new instance of the class. + + The coordinate used for create this . + + For create this is used a standard + with == . + + + + + Constructs a Point with the given coordinate. + + + Contains the single coordinate on which to base this Point, + or null to create the empty point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + The z coordinate. + /// + For create this is used a standard + with set to . + + + + + Initializes a new instance of the class. + + The x coordinate. + The y coordinate. + /// + For create this is used a standard + with set to . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Point" + + + + Gets the OGC geometry type + + + + + Gets the boundary of this geometry. + Zero-dimensional geometries have no boundary by definition, + so an empty GeometryCollection is returned. + + + + + + + + + + + + + + + Represents a polygon with linear edges, which may include holes. + The outer boundary (shell) + and inner boundaries (holes) of the polygon are represented by {@link LinearRing}s. + The boundary rings of the polygon may have any orientation. + Polygons are closed, simple geometries by definition. + + The polygon model conforms to the assertions specified in the + OpenGIS Simple Features + Specification for SQL. + + A Polygon is topologically valid if and only if: + + the coordinates which define it are valid coordinates + the linear rings for the shell and holes are valid + (i.e. are closed and do not self-intersect) + holes touch the shell or another hole at at most one point + (which implies that the rings of the shell and holes must not cross) + the interior of the polygon is connected, + or equivalently no sequence of touching holes + makes the interior of the polygon disconnected + (i.e. effectively split the polygon into two pieces). + + + + + + Represents an empty Polygon. + + + + + The exterior boundary, or null if this Polygon + is the empty point. + + + + + The interior boundaries, if any. + + + + + Initializes a new instance of the class. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + For create this is used a standard + with == . + + + + + Constructs a Polygon with the given exterior boundary and + interior boundaries. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + point is to be created. + + + The inner boundaries of the new Polygon + , or null or empty LinearRings if the empty + point is to be created. + + + + + + Gets an array of ordinate values + + The ordinate index + An array of ordinate values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + + Constructs a Polygon with the given exterior boundary. + + + The outer boundary of the new Polygon, + or null or an empty LinearRing if the empty + polygon is to be created. + + + + + Returns a vertex of this Geometry + (usually, but not necessarily, the first one). + + + The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation. + + a Coordinate which is a vertex of this Geometry. + null if this Geometry is empty. + + + + + Returns an array containing the values of all the vertices for + this geometry. + + + If the geometry is a composite, the array will contain all the vertices + for the components, in the order in which the components occur in the geometry. + + In general, the array cannot be assumed to be the actual internal + storage for the vertices. Thus modifying the array + may not modify the geometry itself. + Use the method + (possibly on the components) to modify the underlying data. + If the coordinates are modified, + must be called afterwards. + + + The vertices of this Geometry. + + + + + + Returns the count of this Geometrys vertices. The Geometry + s contained by composite Geometrys must be + Geometry's; that is, they must implement NumPoints. + + The number of vertices in this Geometry. + + + + Returns the dimension of this geometry. + + + The dimension of a geometry is is the topological + dimension of its embedding in the 2-D Euclidean plane. + In the NTS spatial model, dimension values are in the set {0,1,2}. + + Note that this is a different concept to the dimension of + the vertex s. + The geometry dimension can never be greater than the coordinate dimension. + For example, a 0-dimensional geometry (e.g. a Point) + may have a coordinate dimension of 3 (X,Y,Z). + + + + The topological dimensions of this geometry + + + + + Returns the dimension of this Geometrys inherent boundary. + + + The dimension of the boundary of the class implementing this + interface, whether or not this object is the empty point. Returns + Dimension.False if the boundary is the empty point. + + NOTE: make abstract, remove setter and change geoapi + + + + + + + + + + + + + + + + + + + + + + + + Returns the name of this object's interface. + + "Polygon" + + + + Returns the area of this Polygon + + + + + + Returns the perimeter of this Polygon. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the precision model of the Coordinates in a Geometry. + In other words, specifies the grid of allowable + points for all Geometrys. + + + The MakePrecise method allows rounding a coordinate to + a "precise" value; that is, one whose + precision is known exactly. + Coordinates are assumed to be precise in geometries. + That is, the coordinates are assumed to be rounded to the + precision model given for the point. + NTS input routines automatically round coordinates to the precision model + before creating Geometries. + All internal operations + assume that coordinates are rounded to the precision model. + Constructive methods (such as bool operations) always round computed + coordinates to the appropriate precision model. + Currently three types of precision model are supported: + + Floating: represents full double precision floating point. + This is the default precision model used in NTS + FloatingSingle: represents single precision floating point. + Fixed: represents a model with a fixed number of decimal places. + + A Fixed Precision Model is specified by a scale factor. + The scale factor specifies the size of the grid which numbers are rounded to. + Input coordinates are mapped to fixed coordinates according to the following + equations: + + jtsPt.x = round( (inputPt.x * scale ) / scale + jtsPt.y = round( (inputPt.y * scale ) / scale + + + For example, to specify 3 decimal places of precision, use a scale factor + of 1000. To specify -3 decimal places of precision (i.e. rounding to + the nearest 1000), use a scale factor of 0.001. + + Coordinates are represented internally as Java double-precision values. + Since .NET uses the IEEE-394 floating point standard, this + provides 53 bits of precision. (Thus the maximum precisely representable + integer is 9,007,199,254,740,992 - or almost 16 decimal digits of precision). + + NTS binary methods currently do not handle inputs which have different precision models. + The precision model of any constructed geometric value is undefined. + + + + + The maximum precise value representable in a double. Since IEE754 + double-precision numbers allow 53 bits of mantissa, the value is equal to + 2^53 - 1. This provides almost 16 decimal digits of precision. + + + + + Determines which of two s is the most precise + + A precision model + A precision model + The PrecisionModel which is most precise + + + + The type of PrecisionModel this represents. + + + + + The scale factor which determines the number of decimal places in fixed precision. + + + + + Creates a PrecisionModel with a default precision + of Floating. + + + + + Creates a PrecisionModel that specifies + an explicit precision model type. + If the model type is Fixed the scale factor will default to 1. + + + The type of the precision model. + + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate + + Not used. + Not used. + + + + Creates a PrecisionModel that specifies Fixed precision. + Fixed-precision coordinates are represented as precise internal coordinates, + which are rounded to the grid defined by the scale factor. + + + Amount by which to multiply a coordinate after subtracting + the offset, to obtain a precise coordinate. + + + + + Copy constructor to create a new PrecisionModel + from an existing one. + + + + + + Return HashCode. + + + + + Sets internal to the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the + precise representation of external. + + + + + Returns the precise representation of external. + + The original coordinate. + + The coordinate whose values will be changed to the precise + representation of external + + + + + Returns the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Sets external to the external representation of internal. + + The original coordinate. + + The coordinate whose values will be changed to the + external representation of internal. + + + + + Rounds a numeric value to the PrecisionModel grid. + Symmetric Arithmetic Rounding is used, to provide + uniform rounding behaviour no matter where the number is + on the number line. + + + This method has no effect on NaN values + + + + + + Rounds a Coordinate to the PrecisionModel grid. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compares this PrecisionModel object with the specified object for order. + A PrecisionModel is greater than another if it provides greater precision. + The comparison is based on the value returned by the + {getMaximumSignificantDigits) method. + This comparison is not strictly accurate when comparing floating precision models + to fixed models; however, it is correct when both models are either floating or fixed. + + + The PrecisionModel with which this PrecisionModel + is being compared. + + + A negative integer, zero, or a positive integer as this PrecisionModel + is less than, equal to, or greater than the specified PrecisionModel. + + + + + + + + + + + + Tests whether the precision model supports floating point. + + true if the precision model supports floating point. + + + + Returns the maximum number of significant digits provided by this + precision model. + Intended for use by routines which need to print out precise values. + + + The maximum number of decimal places provided by this precision model. + + + + + Returns the scale factor used to specify a fixed precision model. + + + The number of decimal places of precision is + equal to the base-10 logarithm of the scale factor. + Non-integral and negative scale factors are supported. + Negative scale factors indicate that the places + of precision is to the left of the decimal point. + + + The scale factor for the fixed precision model + + + + + Gets the type of this PrecisionModel. + + + + + + Returns the x-offset used to obtain a precise coordinate. + + + The amount by which to subtract the x-coordinate before + multiplying by the scale. + + + + + Returns the y-offset used to obtain a precise coordinate. + + + The amount by which to subtract the y-coordinate before + multiplying by the scale + + + + + A base class containing the logic for computes the contains + and covers spatial relationship predicates + for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + Contains and covers are very similar, and differ only in how certain + cases along the boundary are handled. These cases require + full topological evaluation to handle, so all the code in + this class is common to both predicates. + + + It is not possible to short-circuit in all cases, in particular + in the case where line segments of the test geometry touches the polygon linework. + In this case full topology must be computed. + (However, if the test geometry consists of only points, this + can be evaluated in an optimized fashion. + + + Martin Davis + + + + A base class for predicate operations on s. + + mbdavis + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether all components of the test Geometry are contained in the target geometry. + + Handles both linear and point components. + A geometry to test + + true if all componenta of the argument are contained in the target geometry + + + + + Tests whether all components of the test Geometry are contained in the interior of the target geometry. + + Handles both linear and point components. + A geometry to test + true if all componenta of the argument are contained in the target geometry interior + + + + Tests whether any component of the test Geometry intersects the area of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry + + + + Tests whether any component of the test Geometry intersects the interior of the target geometry. + + Handles test geometries with both linear and point components. + A geometry to test + true if any component of the argument intersects the prepared area geometry interior + + + + Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) + + The test geometry + The representative points of the target geometry + true if any component intersects the areal test geometry + + + This flag controls a difference between contains and covers. + + For contains the value is true. + For covers the value is false. + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Evaluate the contains or covers relationship + for the given geometry. + + the test geometry + true if the test geometry is contained + + + + Tests whether a geometry consists of a single polygon with no holes. + + True if the geometry is a single polygon with no holes + + + + Computes the full topological predicate. + Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon has the relationship with the test geometry + + + + A base class for subclasses. + + + Contains default implementations for methods, which simply delegate to the equivalent methods. + This class may be used as a "no-op" class for Geometry types which do not have a corresponding implementation. + + Martin Davis + + + + Tests whether any representative of the target geometry intersects the test geometry. + This is useful in A/A, A/L, A/P, L/P, and P/P cases. + + The test geometry + true if any component intersects the areal test geometry + + + + Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes. + + A geometry + true if the envelopes intersect + + + + Determines whether the envelope of this geometry covers the Geometry g. + + A geometry + true if g is contained in this envelope + + + + Tests whether the base contains a given geometry. + + The Geometry to test + true if this Geometry contains the given Geometry + + Default implementation. + + + + + Tests whether the base is covered by a given geometry. + + The geometry to test + true if this geometry is covered by the given geometry + + Default implementation. + + + + Tests whether the base covers a given geometry. + + The geometry to test + true if this geometry covers the given geometry + + Default implementation. + + + + Tests whether the base crosses a given geometry. + + The geometry to test + true if this geometry crosses the given geometry + + Default implementation. + + + + Tests whether the base is disjoint from given geometry. + + The geometry to test + true if this geometry is disjoint from the given geometry + + Default implementation. + + + + Tests whether the base intersects a given geometry. + + The geometry to test + true if this geometry intersects the given geometry + + Default implementation. + + + + Tests whether the base overlaps a given geometry. + + The geometry to test + true if this geometry overlaps the given geometry + + Default implementation. + + + + Tests whether the base touches a given geometry. + + The geometry to test + true if this geometry touches the given geometry + + Default implementation. + + + + Tests whether the base is within a given geometry. + + The geometry to test + true if this geometry is within the given geometry + + Default implementation. + + + + Gets the list of representative points for this geometry. + One vertex is included for every component of the geometry + (i.e. including one for every ring of polygonal geometries). + + Do not modify the returned list! + + + + + A factory for creating s. It chooses an appropriate implementation of PreparedGeometry + based on the geoemtric type of the input geometry. + + + In the future, the factory may accept hints that indicate + special optimizations which can be performed. + + Martin Davis + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + Creates a new appropriate for the argument . + + The geometry to prepare + + the prepared geometry + + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + mbdavis + + + + Computes the intersects spatial relationship predicate + for a target relative to other classes. + + + Uses short-circuit tests and indexing to improve performance. + + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared linestring + A test geometry + true if the linestring intersects the geometry + + + + Creates an instance of this operation. + + The target PreparedLineString + + + + Tests whether this geometry intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Tests whether any representative point of the test Geometry intersects + the target geometry. + + + Only handles test geometries which are Puntal (dimension 0) + + A Puntal geometry to test + true if any point of the argument intersects the prepared geometry + + + + A prepared version for geometries. + Instances of this class are thread-safe. + + Martin Davis + + + + Tests whether this point intersects a . + + + The optimization here is that computing topology for the test geometry + is avoided. This can be significant for large geometries. + + + + + A prepared version for geometries. + This class supports both s and s. + This class does not support MultiPolygons which are non-valid + (e.g. with overlapping elements). + + + Instances of this class are thread-safe and immutable. + + mbdavis + + + + Computes the contains spatial relationship predicate for a relative to all other classes. + Uses short-circuit tests and indexing to improve performance. + + + + It is not possible to short-circuit in all cases, in particular + in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + + Martin Davis + + + + Computes the contains spatial relationship predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon contains the geometry + + + + Creates an instance of this operation. + + the PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon contains a given geometry. + + The test geometry + true if the test geometry is contained + + + + Computes the full topological contains predicate.
+ Used when short-circuit tests are not conclusive. +
+ The test geometry + true if this prepared polygon contains the test geometry +
+ + + Computes the containsProperly spatial relationship predicate for s relative to all other {@link Geometry} classes.
+ Uses short-circuit tests and indexing to improve performance. +
+ + + A Geometry A containsProperly another Geometry B iff + all points of B are contained in the Interior of A. + Equivalently, B is contained in A AND B does not intersect + the Boundary of A. + + + The advantage to using this predicate is that it can be computed + efficiently, with no need to compute topology at individual points. + In a situation with many geometries intersecting the boundary + of the target geometry, this can make a performance difference. + + + Martin Davis +
+ + Computes the containsProperly predicate between a and a . + + The prepared polygon + A test geometry + true if the polygon properly contains the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon containsProperly a given geometry. + + The test geometry + true if the polygon properly contains the geometry + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + + Uses short-circuit tests and indexing to improve performance. + + It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. + In this case full topology must be computed. + + Martin Davis + + + + Computes the Covers spatial relationship predicate for a relative to all other classes. + + The prepared polygon + A test geometry + true if the polygon covers the geometry + + + + Creates an instance of this operation. + + The PreparedPolygon to evaluate + + + + Tests whether this PreparedPolygon covers a given geometry. + + The test geometry + true if the test geometry is covered + + + + Computes the full topological covers predicate. Used when short-circuit tests are not conclusive. + + The test geometry + true if this prepared polygon covers the test geometry + + + + Computes the intersects spatial relationship predicate + for s relative to all other classes. + + Uses short-circuit tests and indexing to improve performance. + Martin Davis + + + + Computes the intersects predicate between a + and a . + + The prepared polygon + A test geometry + true if the polygon intersects the geometry + + + + Creates an instance of this operation. + + The prepared polygon + + + + Tests whether this PreparedPolygon intersects a given geometry. + + The test geometry + true if the test geometry intersects + + + + Indicates an invalid or inconsistent topological situation encountered during processing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a planar triangle, and provides methods for calculating various + properties of triangles. + + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + The coordinates of the vertices of the triangle + + + + Tests whether a triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 degrees. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + True if the triangle is acute. + + + + Computes the line which is the perpendicular bisector of the + + A point + Another point + The perpendicular bisector, as an HCoordinate line segment a-b. + + + Computes the circumcentre of a triangle. + + The circumcentre is the centre of the circumcircle, + the smallest circle which encloses the triangle. + It is also the common intersection point of the + perpendicular bisectors of the sides of the triangle, + and is the only point which has equal distance to all three + vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. For example, + the circumcentre of an obtuse isoceles triangle lies outside the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The circumcentre of the triangle + + + + Computes the determinant of a 2x2 matrix. Uses standard double-precision + arithmetic, so is susceptible to round-off error. + + the [0,0] entry of the matrix + the [0,1] entry of the matrix + the [1,0] entry of the matrix + the [1,1] entry of the matrix + The determinant + + + + Computes the incentre of a triangle. + + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + It is also the point at which the bisectors of the triangle's angles meet. + It is the centre of the triangle's InCircle, which is the unique circle + that is tangent to each of the triangle's three sides. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point which is the incentre of the triangle + + + Computes the centroid (centre of mass) of a triangle. + + This is also the point at which the triangle's three + medians intersect (a triangle median is the segment from a vertex of the triangle to the + midpoint of the opposite side). + The centroid divides each median in a ratio of 2:1. + The centroid always lies within the triangle. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The centroid of the triangle + + + Computes the length of the longest side of a triangle + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The length of the longest side of the triangle + + + Computes the point at which the bisector of the angle ABC cuts the segment AC. + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The angle bisector cut point + + + + Computes the 2D area of a triangle. + The area value is always non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + Computes the signed 2D area of a triangle. + + + + The area value is positive if the triangle is oriented CW, + and negative if it is oriented CCW. + + + The signed area value can be used to determine point orientation, but + the implementation in this method is susceptible to round-off errors. + Use for robust orientation + calculation. + + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle + + + + + + Computes the 3D area of a triangle. + The value computed is alway non-negative. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The 3D area of the triangle + + + + Computes the Z-value (elevation) of an XY point + on a three-dimensional plane defined by a triangle + whose vertices have Z-values. + The defining triangle must not be degenerate + (in other words, the triangle must enclose a + non-zero area), + and must not be parallel to the Z-axis. + + This method can be used to interpolate + the Z-value of a point inside a triangle + (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + A vertex of a triangle, with a Z ordinate + The computed Z-value (elevation) of the point + + + + Creates a new triangle with the given vertices. + + A vertex + A vertex + A vertex + + + + Computes the InCentre of this triangle + + The InCentre of a triangle is the point which is equidistant + from the sides of the triangle. + This is also the point at which the bisectors of the angles meet. + It is the centre of the triangle's InCircle, + which is the unique circle that is tangent to each of the triangle's three sides. + + + The point which is the InCentre of the triangle. + + + + + Tests whether this triangle is acute. A triangle is acute iff all interior + angles are acute. This is a strict test - right triangles will return + false A triangle which is not acute is either right or obtuse. + + Note: this implementation is not robust for angles very close to 90 + degrees. + + true if this triangle is acute + + + + Computes the circumcentre of this triangle. The circumcentre is the centre + of the circumcircle, the smallest circle which encloses the triangle. It is + also the common intersection point of the perpendicular bisectors of the + sides of the triangle, and is the only point which has equal distance to + all three vertices of the triangle. + + The circumcentre does not necessarily lie within the triangle. + + This method uses an algorithm due to J.R.Shewchuk which uses normalization + to the origin to improve the accuracy of computation. (See Lecture Notes + on Geometric Robustness, Jonathan Richard Shewchuk, 1999). + + The circumcentre of this triangle + + + + Computes the centroid (centre of mass) of this triangle. This is also the + point at which the triangle's three medians intersect (a triangle median is + the segment from a vertex of the triangle to the midpoint of the opposite + side). The centroid divides each median in a ratio of 2:1. + + The centroid always lies within the triangle. + + The centroid of this triangle + + + + Computes the length of the longest side of this triangle + + The length of the longest side of this triangle + + + + Computes the 2D area of this triangle. The area value is always + non-negative. + + The area of this triangle + + + + + Computes the signed 2D area of this triangle. The area value is positive if + the triangle is oriented CW, and negative if it is oriented CCW. + + The signed area value can be used to determine point orientation, but the + implementation in this method is susceptible to round-off errors. Use + + for robust orientation calculation. + + The signed 2D area of this triangle + + + + + Computes the 3D area of this triangle. The value computed is alway + non-negative. + + The 3D area of this triangle + + + + Computes the Z-value (elevation) of an XY point on a three-dimensional + plane defined by this triangle (whose vertices must have Z-values). This + triangle must not be degenerate (in other words, the triangle must enclose + a non-zero area), and must not be parallel to the Z-axis. + + This method can be used to interpolate the Z-value of a point inside this + triangle (for example, of a TIN facet with elevations on the vertices). + + The point to compute the Z-value of + The computed Z-value (elevation) of the point + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + A corner point of the triangle + + + + + Represents an affine transformation on the 2D Cartesian plane. + + + + It can be used to transform a or . + An affine transformation is a mapping of the 2D plane into itself + via a series of transformations of the following basic types: +
    +
  • reflection (through a line)
  • +
  • rotation (around the origin)
  • +
  • scaling (relative to the origin)
  • +
  • shearing (in both the X and Y directions)
  • +
  • translation
  • +
+
+ + In general, affine transformations preserve straightness and parallel lines, + but do not preserve distance or shape. + + + An affine transformation can be represented by a 3x3 + matrix in the following form: +
+            T = | m00 m01 m02 |
+                | m10 m11 m12 |
+                |  0   0   1  |
+            
+ A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') + by representing it as a 3x1 matrix and using matrix multiplication to compute: +
+            | x' |  = T x | x |
+            | y' |        | y |
+            | 1  |        | 1 |
+            
+
+

Transformation Composition

+ + Affine transformations can be composed using the method. + Composition is computed via multiplication of the + transformation matrices, and is defined as: +
+            A.compose(B) = TB x TA
+            
+
+ + This produces a transformation whose effect is that of A followed by B. + The methods , , + , , and + have the effect of composing a transformation of that type with + the transformation they are invoked on. + The composition of transformations is in general not commutative. + +

Transformation Inversion

+ + Affine transformations may be invertible or non-invertible. + If a transformation is invertible, then there exists + an inverse transformation which when composed produces + the identity transformation. + The method + computes the inverse of a transformation, if one exists. + + + @author Martin Davis + +
+
+ + + Creates a transformation for a reflection about the + line (x0,y0) - (x1,y1). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + the x-ordinate of a another point on the reflection line + the y-ordinate of a another point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a reflection about the + line (0,0) - (x,y). + + the x-ordinate of a point on the reflection line + the y-ordinate of a point on the reflection line + a transformation for the reflection + + + + Creates a transformation for a rotation + about the origin + by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + a transformation for the rotation + + + + Creates a transformation for a rotation + by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a rotation + about the point (x,y) by an angle theta, + specified by the sine and cosine of the angle. + + + This allows providing exact values for sin(theta) and cos(theta) + for the common case of rotations of multiples of quarter-circles. + + the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + a transformation for the rotation + + + + Creates a transformation for a scaling relative to the origin. + + the value to scale by in the x direction + the value to scale by in the y direction + a transformation for the scaling + + + + Creates a transformation for a scaling relative to the point (x,y). + + The value to scale by in the x direction + The value to scale by in the y direction + The x-ordinate of the point to scale around + The y-ordinate of the point to scale around + A transformation for the scaling + + + + Creates a transformation for a shear. + + the value to shear by in the x direction + the value to shear by in the y direction + a tranformation for the shear + + + + Creates a transformation for a translation. + + the value to translate by in the x direction + the value to translate by in the y direction + a tranformation for the translation + + + + Constructs a new identity transformation + + + + + Constructs a new transformation whose + matrix has the specified values. + + an array containing the 6 values { m00, m01, m02, m10, m11, m12 } + if matrix is null + if matrix is too small + + + + Constructs a new transformation whose + matrix has the specified values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + + + + Constructs a transformation which is + a copy of the given one. + + the transformation to copy + + + + Constructs a transformation + which maps the given source + points into the given destination points. + + source point 0 + source point 1 + source point 2 + the mapped point for source point 0 + the mapped point for source point 1 + the mapped point for source point 2 + + + + Sets this transformation to be the identity transformation. + + + The identity transformation has the matrix: +
+            | 1 0 0 |
+            | 0 1 0 |
+            | 0 0 1 |
+            
+
+ this transformation, with an updated matrix +
+ + + Sets this transformation's matrix to have the given values. + + the entry for the [0, 0] element in the transformation matrix + the entry for the [0, 1] element in the transformation matrix + the entry for the [0, 2] element in the transformation matrix + the entry for the [1, 0] element in the transformation matrix + the entry for the [1, 1] element in the transformation matrix + the entry for the [1, 2] element in the transformation matrix + this transformation, with an updated matrix + + + + Sets this transformation to be a copy of the given one + + a transformation to copy + this transformation, with an updated matrix + + + + Computes the inverse of this transformation, if one + exists. + + + + * The inverse is the transformation which when + * composed with this one produces the identity + * transformation. + * A transformation has an inverse if and only if it + * is not singular (i.e. its + * determinant is non-zero). + * Geometrically, an transformation is non-invertible + * if it maps the plane to a line or a point. + * If no inverse exists this method + * will throw a . + + + * The matrix of the inverse is equal to the + * inverse of the matrix for the transformation. + * It is computed as follows: + *
+            *                 1
+            * inverse(A)  =  ---   x  adjoint(A)
+            *                det
+            *
+            *
+            *             =   1       |  m11  -m01   m01*m12-m02*m11  |
+            *                ---   x  | -m10   m00  -m00*m12+m10*m02  |
+            *                det      |  0     0     m00*m11-m10*m01  |
+            *
+            *
+            *
+            *             = |  m11/det  -m01/det   m01*m12-m02*m11/det |
+            *               | -m10/det   m00/det  -m00*m12+m10*m02/det |
+            *               |   0           0          1               |
+            *
+            * 
+
+
+ A new inverse transformation + + +
+ + + Explicitly computes the math for a reflection. May not work. + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1). + + The x-ordinate of one point on the reflection line + The y-ordinate of one point on the reflection line + The x-ordinate of another point on the reflection line + The y-ordinate of another point on the reflection line + This transformation with an updated matrix + + + + Sets this transformation to be a reflection + about the line defined by vector (x,y). + + + The transformation for a reflection + is computed by: +
+            d = sqrt(x2 + y2)
+            sin = x / d;
+            cos = x / d;
+            Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
+            
+
+ the x-component of the reflection line vector + the y-component of the reflection line vector + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the orign. + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle theta + has the value: +
+            |  cos(theta)  -sin(theta)   0 |
+            |  sin(theta)   cos(theta)   0 |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation around the origin + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   0 |
+            |  sinTheta   cosTheta   0 |
+            |         0          0   1 |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y). + + + A positive rotation angle corresponds + to a counter-clockwise rotation. + The transformation matrix for a rotation + by an angle + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |           0            0   1 |
+            
+
+ the rotation angle, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a rotation + around a given point (x,y) + by specifying the sin and cos of the rotation angle directly. + + + The transformation matrix for the rotation + has the value: +
+            |  cosTheta  -sinTheta   x-x*cos+y*sin |
+            |  sinTheta   cosTheta   y-x*sin-y*cos |
+            |         0          0         1       |
+            
+
+ the sine of the rotation angle + the cosine of the rotation angle + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix +
+ + + Sets this transformation to be a scaling. + + + The transformation matrix for a scale + has the value: +
+            |  xScale      0  dx |
+            |  1      yScale  dy |
+            |  0           0   1 |
+            
+
+ the amount to scale x-ordinates by + the amount to scale y-ordinates by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a shear. + + + The transformation matrix for a shear + has the value: +
+            |  1      xShear  0 |
+            |  yShear      1  0 |
+            |  0           0  1 |
+            
+ Note that a shear of (1, 1) is not + equal to shear(1, 0) composed with shear(0, 1). + Instead, shear(1, 1) corresponds to a mapping onto the + line x = y. +
+ the x component to shear by + the y component to shear by + this transformation, with an updated matrix +
+ + + Sets this transformation to be a translation. + + + For a translation by the vector (x, y) + the transformation matrix has the value: +
+            |  1  0  dx |
+            |  1  0  dy |
+            |  0  0   1 |
+            
+
+ the x component to translate by + the y component to translate by + this transformation, with an updated matrix +
+ + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + the x-ordinate of a point on the line to reflect around + the y-ordinate of a point on the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a reflection transformation composed + with the current value. + + the x-ordinate of the line to reflect around + the y-ordinate of the line to reflect around + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation transformation composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by in radians + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around the origin composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value. + + + Positive angles correspond to a rotation + in the counter-clockwise direction. + + the angle to rotate by, in radians + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a rotation around a given point composed + with the current value, + with the sin and cos of the rotation angle specified directly. + + the sine of the angle to rotate by + the cosine of the angle to rotate by + the x-ordinate of the rotation point + the y-ordinate of the rotation point + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a scale transformation composed + with the current value. + + the value to scale by in the x direction + the value to scale by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a shear transformation composed + with the current value. + + the value to shear by in the x direction + the value to shear by in the y direction + this transformation, with an updated matrix + + + + Updates the value of this transformation + to that of a translation transformation composed + with the current value. + + the value to translate by in the x direction + the value to translate by in the y direction + this transformation, with an updated matrix + + + + Updates this transformation to be + the composition of this transformation with the given . + + + This produces a transformation whose effect + is equal to applying this transformation + followed by the argument transformation. + Mathematically, +
+            A.compose(B) = TB x TA
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Updates this transformation to be the composition + of a given with this transformation. + + + This produces a transformation whose effect + is equal to applying the argument transformation + followed by this transformation. + Mathematically, +
+            A.composeBefore(B) = TA x TB
+            
+
+ an affine transformation + this transformation, with an updated matrix +
+ + + Applies this transformation to the coordinate + and places the results in the coordinate + (which may be the same as the source). + + the coordinate to transform + the coordinate to accept the results + the dest coordinate + + + + + Cretaes a new which is the result of this transformation applied to the input Geometry. + + A Geometry + The transformed Geometry + + + + Applies this transformation to the i'th coordinate + in the given CoordinateSequence. + + a CoordinateSequence + the index of the coordinate to transform + + + + Transforms the i'th coordinate in the input sequence + + A CoordinateSequence + The index of the coordinate to transform + + + + Tests if an object is an AffineTransformation and has the same matrix as this transformation. + + An object to test + true if the given object is equal to this object + + + + Gets a text representation of this transformation. + The string is of the form: + + AffineTransformation[[m00, m01, m02], [m10, m11, m12]] + + + A string representing this transformation + + + + Clones this transformation + + A copy of this transformation + + + + Gets an array containing the entries + of the transformation matrix. + + + Only the 6 non-trivial entries are returned, + in the sequence: +
+            m00, m01, m02, m10, m11, m12
+            
+
+ an array of length 6 +
+ + + Computes the determinant of the transformation matrix. + + + + The determinant is computed as: +
+             | m00 m01 m02 |
+             | m10 m11 m12 | = m00 * m11 - m01 * m10
+             |  0   0   1  |
+             
+
+ + If the determinant is zero, + the transform is singular (not invertible), + and operations which attempt to compute + an inverse will throw a . + +
+ the determinant of the transformation + + + The determinant of the transformation + +
+ + + Reports that this filter should continue to be executed until + all coordinates have been transformed. + + false + + + Tests if this transformation is the identity transformation. + + + + Builds an defined by a set of control vectors. + + + + A control vector consists of a source point and a destination point, + which is the image of the source point under the desired transformation. + + + A transformation is well-defined + by a set of three control vectors + if and only if the source points are not collinear. + (In particular, the degenerate situation + where two or more source points are identical will not produce a well-defined transformation). + A well-defined transformation exists and is unique. + If the control vectors are not well-defined, the system of equations + defining the transformation matrix entries is not solvable, + and no transformation can be determined. + + No such restriction applies to the destination points. + However, if the destination points are collinear or non-unique, + a non-invertible transformations will be generated. + + + This technique of recovering a transformation + from its effect on known points is used in the Bilinear Interpolated Triangulation + algorithm for warping planar surfaces. + + + Martin Davis + + + + Constructs a new builder for the transformation defined by the given set of control point mappings. + + A control point + A control point + A control point + The image of under the required transformation + The image of under the required transformation + The image of under the required transformation + + + + Computes the + determined by the control point mappings, + or null if the control vectors do not determine a well-defined transformation. + + + + An affine transformation + null if the control vectors do not determine a well-defined transformation. + + + + + + Computes the transformation matrix by + solving the two systems of linear equations + defined by the control point mappings, + if this is possible. + + True if the transformation matrix is solvable + + + + Solves the transformation matrix system of linear equations + for the given right-hand side vector. + + The vector for the right-hand side of the system + The solution vector, if it can be determinated, otherwise null + + + + Supports creating s defined by various kinds of inputs and transformation mapping rules. + + Martin Davis + + + + Creates a tranformation from a set of three control vectors. A control + vector consists of a source point and a destination point, which is the + image of the source point under the desired transformation. Three control + vectors allows defining a fully general affine transformation. + + + + + + + + The computed transformation + + + + Creates an AffineTransformation defined by a pair of control vectors. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. The + computed transformation is a combination of one or more of a uniform scale, + a rotation, and a translation (i.e. there is no shear component and no + reflection) + + + + + + The computed transformation + null if the control vectors do not determine a well-defined transformation + + + + Creates an AffineTransformation defined by a single control vector. A + control vector consists of a source point and a destination point, which is + the image of the source point under the desired transformation. This + produces a translation. + + The start point of the control vector + The end point of the control vector + The computed transformation + + + + Creates an AffineTransformation defined by a set of control vectors. + Between one and three vectors must be supplied. + + The source points of the vectors + The destination points of the vectors + The computed transformation + if the control vector arrays are too short, long or of different lengths + + + + Creates an AffineTransformation defined by a maping between two baselines. + The computed transformation consists of: + + a translation from the start point of the source baseline to the start point of the destination baseline, + a rotation through the angle between the baselines about the destination start point, + and a scaling equal to the ratio of the baseline lengths. + + If the source baseline has zero length, an identity transformation is returned. + + The start point of the source baseline + The end point of the source baseline + The start point of the destination baseline + The end point of the destination baseline + + + + + Extracts a single representative from each connected component of a . + + 1.9 + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The Geometry from which to extract + A list of Coordinates + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + Maps the members of a + into another GeometryCollection via a defined + mapping function. + + Martin Davis + + + + + + + + + + + + Creates an instance of this class + + + + + + + + + + + + + Combines s to produce a of the most appropriate type. + + + Input geometries which are already collections will have their elements extracted first. + No validation of the result geometry is performed. + (The only case where invalidity is possible is where geometries are combined and result in a self-intersection). + + mbdavis + + + + Combines a collection of geometries. + The geometries to combine + The combined geometry + + + + Combines two geometries. + + A geometry to combine + A geometry to combine + The combined geometry + + + + Combines three geometries. + + A geometry to combine + A geometry to combine + A geometry to combine + The combined geometry + + + + Creates a list from two items + + + + A list from two geometries + + + + Creates a list from three items + + + + + A list from three geometries + + + + Creates a new combiner for a collection of geometries + + The geometries to combine + + + + Extracts the GeometryFactory used by the geometries in a collection + + + a GeometryFactory + + + + Computes the combination of the input geometries to produce the most appropriate or + + A Geometry which is the combination of the inputs + + + + + Value indicating whether empty geometries should be skipped + + + + + A class which supports creating new s + which are modifications of existing ones, + maintaining the same type structure. + + + Geometry objects are intended to be treated as immutable. + This class allows you to "modifies" a Geometrys + by traversing them, applying a user-defined + , or + and creating a new Geometrys with the same structure but + (possibly) modified components. + + Examples of the kinds of modifications which can be made are: + + + The values of the coordinates may be changed. + The editor does not check whether changing coordinate values makes the result Geometry invalid + + + The coordinate lists may be changed (e.g. by adding, deleting or modifying coordinates). + The modifed coordinate lists must be consistent with their original parent component + (e.g. a LinearRing must always have at least 4 coordinates, and the first and last + coordinate must be equal). + + + Components of the original point may be deleted + (e.g. holes may be removed from a Polygon, or LineStrings removed from a MultiLineString). + Deletions will be propagated up the component tree appropriately. + + + + All changes must be consistent with the original Geometry's structure + (e.g. a Polygon cannot be collapsed into a LineString). + If changing the structure is required, use a . + + + This class supports creating an edited Geometry + using a different via the + constructor. + Examples of situations where this is required is if the geometry is + transformed to a new SRID and/or a new PrecisionModel. + + Usage notes + + The resulting Geometry is not checked for validity. + If validity needs to be enforced, the new Geometry's + method should be called. + By default the UserData of the input geometry is not copied to the result. + + + + + + + + + The factory used to create the modified Geometry. + + + If null the GeometryFactory of the input is used. + + + + + Creates a new GeometryEditor object which will create + edited with the same as the input Geometry. + + + + + Creates a new GeometryEditor object which will create + edited s with the given . + + The GeometryFactory to create the edited Geometry with. + + + + Edit the input Geometry with the given edit operation. + Clients can create subclasses of GeometryEditorOperation or + CoordinateOperation to perform required modifications. + + The Geometry to edit. + The edit operation to carry out. + A new Geometry which is the result of the editing (which may be empty). + + + + Gets or sets a value indicating if the User Data is copied to the edit result. + If so, only the object reference is copied. + + + + + A interface which specifies an edit operation for Geometries. + + + + + Edits a Geometry by returning a new Geometry with a modification. + The returned Geometry may be the input geometry itself. + It may be null if the geometry is to be deleted. + + The Geometry to modify. + + The factory with which to construct the modified Geometry + (may be different to the factory of the input point). + + A new Geometry which is a modification of the input Geometry. + null if the Geometry is to be deleted completely + + + + A GeometryEditorOperation which does not modify + the input geometry. + This can be used for simple changes of + (including PrecisionModel and SRID). + + mbdavis + + + + A GeometryEditorOperation which edits the coordinate list of a Geometry. + Operates on Geometry subclasses which contains a single coordinate list. + + + + + + + + + + + + + Edits the array of Coordinates from a Geometry. + + The coordinate array to operate on. + The point containing the coordinate list. + An edited coordinate array (which may be the same as the input). + + + + A which edits the + of a . + + Operates on Geometry subclasses which contains a single coordinate list. + + + + An edited coordinate sequence (which may be the same as the input) + + + + Extracts the components of a given type from a . + + + + + Extracts the T components from an and adds them to the provided . + + the geometry from which to extract + the list to add the extracted elements to + The geometry type to extract + + + + Extracts the T elements from a single and returns them in a . + + the geometry from which to extract + + + + Extracts the components of type T from a . + + + + + Constructs a filter with a list in which to store the elements found. + + The list to extract into + + + + Methods to map various collections + of s + via defined mapping functions. + + Martin Davis + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation delegate + A result collection or geometry of most specific type + + + + Maps the members of a + (which may be atomic or composite) + into another Geometry of most specific type. + null results are skipped. + In the case of hierarchical s, + only the first level of members are mapped. + + The input atomic or composite geometry + The mapping operation + A result collection or geometry of most specific type + + + + An interface for geometry functions used for mapping. + + Martin Davis + + + + Computes a new geometry value. + + The input geometry + A result geometry + + + + Extracts all the 1-dimensional () components from a . + For polygonal geometries, this will extract all the component s. + If desired, s can be forced to be returned as s. + + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single + and adds them to the provided . + + The geometry from which to extract linear components + The Collection to add the extracted linear components to + + The Collection of linear components (LineStrings or LinearRings) + + + + Extracts the linear components from a single point. + If more than one point is to be processed, it is more + efficient to create a single LineExtracterFilter instance + and pass it to multiple geometries. + + The point from which to extract linear components. + The list of linear components. + + + + Extracts the linear components from a single geometry. + If more than one geometry is to be processed, it is more + efficient to create a single instance + and pass it to multiple geometries. + + The geometry from which to extract linear components + true if s should be converted to s + The list of linear components + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Extracts the linear components from a single + and returns them as either a or . + + The geometry from which to extract + true if s should be converted to s + A linear geometry + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + Constructs a LineExtracterFilter with a list in which to store LineStrings found. + + + + + + + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single + and adds them to the. + + The geometry from which to extract + The list to add the extracted elements to + The list argument + + + + Extracts the elements from a single + and returns them in a . + + The geometry from which to extract + A list containing the linear elements + + + + Extracts the elements from a single + and returns them as either a or . + + The geometry from which to extract + A linear geometry + + + + Constructs a filter with a list in which to store the elements found. + + + + + Implements some 2D matrix operations (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination.
+ In order to avoid overhead the algorithm runs in-place + on A - if A should not be modified the client must supply a copy. +
+ A an nxn matrix in row/column order )modified by this method) + A vector of length n + if the matrix is the wrong size + + + A vector containing the solution (if any) + null if the system has no or no unique solution + + +
+ + + Indicates that an is non-invertible. + + Martin Davis + + + + Extracts all the 0-dimensional (Point) components from a Geometry. + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + the geometry from which to extract + + + + Constructs a PointExtracterFilter with a list in which to store Points found. + + + + + + + + + + + + Extracts all the elements from a . + + + + + + Extracts the elements from a single and adds them to the provided . + + The geometry from which to extract + The list to add the extracted elements to + + + + + Extracts the elements from a single and returns them in a . + + The geometry from which to extract + + + + Constructs a PolygonExtracterFilter with a list in which to store Polygons found. + + + + + + + + + + + + A visitor to elements which componets, which + allows short-circuiting when a defined condition holds. + + + + + + + + + + + + + + + + + + + + + + + Creates geometries which are shaped like multi-armed stars with each arm shaped like a sine wave. + These kinds of geometries are useful as a more complex geometry for testing algorithms. + + + Martin Davis + + + + + Computes various kinds of common geometric shapes. + Allows various ways of specifying the location and extent of the shapes, + as well as number of line segments used to form them. + + + + + Create a shape factory which will create shapes using the default GeometryFactory. + + + + + Create a shape factory which will create shapes using the given GeometryFactory. + + The factory to use. + + + + Creates a rectangular Polygon. + + A rectangular polygon. + + + + Creates a circular Polygon. + + A circular polygon. + + + + Creates an elliptical Polygon. + If the supplied envelope is square the + result will be a circle. + + An an ellipse or circle. + + + + Creates a squircular . + + a squircle + + + + Creates a supercircular + of a given positive power. + + a supercircle + + + + Creates a elliptical arc, as a LineString. + + The arc is always created in a counter-clockwise direction. + + Start angle in radians + Size of angle in radians + + + + + Creates an elliptical arc polygon. + + + The polygon is formed from the specified arc of an ellipse + and the two radii connecting the endpoints to the centre of the ellipse. + + Start angle in radians + Size of angle in radians + An elliptical arc polygon + + + + Gets/Sets the location of the shape by specifying the base coordinate + (which in most cases is the + lower left point of the envelope containing the shape). + + + + + Gets/Sets the location of the shape by specifying the centre of + the shape's bounding box. + + + + + Gets or sets the envelope of the shape + + + + + Gets/Sets the total number of points in the created Geometry. + + + + + Gets/Sets the size of the extent of the shape in both x and y directions. + + + + + Gets/Sets the width of the shape. + + + + + Gets/Sets the height of the shape. + + + + + Gets/Sets the rotation angle, in radians, to use for the shape. + The rotation is applied relative to the centre of the shape. + + + + + Creates a factory which will create sine stars using the default + + + + + Creates a factory which will create sine stars using the given + + The factory to use + + + + Generates the geometry for the sine star + + The geometry representing the sine star + + + Gets/Sets the number of arms in the star + + + + Sets the ration of the length of each arm to the distance from the tip of the arm to the centre of the star. + + Value should be between 0.0 and 1.0 + + + + A Depth object records the topological depth of the sides + of an Edge for up to two Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Depth object is null (has never been initialized) if all depths are null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Normalize the depths for each point, if they are non-null. + A normalized depth + has depth values in the set { 0, 1 }. + Normalizing the depths + involves reducing the depths by the same amount so that at least + one of them is 0. If the remaining value is > 0, it is set to 1. + + + + + + + + + + + Calls GetDepth and SetDepth. + + + + + + + + + + + + + Models the end of an edge incident on a node. + + + + EdgeEnds have a direction determined by the direction of the ray from the initial + point to the next point. + + + EdgeEnds are IComparable under the ordering "a has a greater angle with the x-axis than b". + This ordering is used to sort EdgeEnds around a node. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the total order relation: + a has a greater angle with the positive x-axis than b. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is obviously susceptible to roundoff. + A robust algorithm is: + - first compare the quadrant. If the quadrants + are different, it it trivial to determine which vector is "greater". + - if the vectors lie in the same quadrant, the computeOrientation function + can be used to decide the relative orientation of the vectors. + + + + + + Subclasses should override this if they are using labels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes the factor for the change in depth when moving from one location to another. + E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. + + + + + + + + + + The depth of each side (position) of this edge. + The 0 element of the array is never used. + + + + + + + + + + + + + + + + + + + + + + + + + + Compute the label in the appropriate orientation for this DirEdge. + + + + + Set both edge depths. + One depth for a given side is provided. + The other is computed depending on the Location + transition and the depthDelta of the edge. + + + + + + + Set both edge depths. One depth for a given side is provided. The other is + computed depending on the Location transition and the depthDelta of the edge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VisitedEdge get property returns true if bot Visited + and Sym.Visited are true. + VisitedEdge set property marks both DirectedEdges attached to a given Edge. + This is used for edges corresponding to lines, which will only + appear oriented in a single direction in the result. + + + + + + + + + + + + + + + + + + + + + + + + + This edge is a line edge if + at least one of the labels is a line label + any labels which are not line labels have all Location = Exterior. + + + + + This is an interior Area edge if + its label is an Area label for both Geometries + and for each Geometry both sides are in the interior. + + true if this is an interior Area edge. + + + + A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node. + It supports labelling the edges as well as linking the edges to form both + MaximalEdgeRings and MinimalEdgeRings. + + + + + A EdgeEndStar is an ordered list of EdgeEnds around a node. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + A map which maintains the edges in sorted order around the node. + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + The location of the point for this star in Geometry i Areas. + + + + + Insert a EdgeEnd into this EdgeEndStar. + + + + + + Insert an EdgeEnd into the map, and clear the edgeList cache, + since the list of edges has now changed. + + + + + + + Iterator access to the ordered list of edges is optimized by + copying the map collection to a list. (This assumes that + once an iterator is requested, it is likely that insertion into + the map is complete). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate for the node this star is based at. + + + + + + + + + + + + + + + A list of all outgoing edges in the result, in CCW order. + + + + + Insert a directed edge in the list. + + + + + + + + + + + + + + + + + + + + + + + + + Compute the labelling for all dirEdges in this star, as well + as the overall labelling. + + + + + + For each dirEdge in the star, merge the label . + + + + + Update incomplete dirEdge labels from the labelling for the node. + + + + + + + + + + + + Traverse the star of DirectedEdges, linking the included edges together. + To link two dirEdges, the next pointer for an incoming dirEdge + is set to the next outgoing edge. + DirEdges are only linked if: + they belong to an area (i.e. they have sides) + they are marked as being in the result + Edges are linked in CCW order (the order they are stored). + This means that rings have their face on the Right + (in other words, the topological location of the face is given by the RHS label of the DirectedEdge). + PRECONDITION: No pair of dirEdges are both marked as being in the result. + + + + + + + + + + + + + + + + Traverse the star of edges, maintaing the current location in the result + area at this node (if any). + If any L edges are found in the interior of the result, mark them as covered. + + + + + + + + + + + Compute the DirectedEdge depths for a subsequence of the edge array. + + The last depth assigned (from the R side of the last edge visited). + + + + + + + + + + + + + + + + + + + + A GraphComponent is the parent class for the objects' + that form a graph. Each GraphComponent can carry a + Label. + + + + + + + + + + + + + + + + + + + + + Compute the contribution to an IM for this component. + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + + + + + + + + + + + IsInResult indicates if this component has already been included in the result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A coordinate in this component (or null, if there are none). + + + + + An isolated component is one that does not intersect or touch any other + component. This is the case if the label has valid locations for + only a single Geometry. + + true if this component is isolated. + + + + Updates an IM from the label for an edge. + Handles edges from both L and A geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an EdgeIntersection for intersection intIndex. + An intersection that falls exactly on a vertex of the edge is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + Equals is defined to be: + e1 equals e2 + iff + the coordinates of e1 are the same or the reverse of the coordinates in e2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if the coordinate sequences of the Edges are identical. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The depthDelta is the change in depth as an edge is crossed from R to L. + + The change in depth as the edge is crossed from R to L. + + + + + + + + + + + + + + + + + + + + + + + + An Edge is collapsed if it is an Area edge and it consists of + two segments which are equal and opposite (eg a zero-width V). + + + + + + + + + + + + + + + + + + + + An EdgeIntersection represents a point on an + edge which intersects with another edge. + The intersection may either be a single point, or a line segment + (in which case this point is the start of the line segment) + The label attached to this intersection point applies to + the edge from this point forwards, until the next + intersection or the end of the edge. + The intersection point must be precise. + + + + + + + + + + + + + + + + + + + + + + + + + -1 this EdgeIntersection is located before the argument location, + 0 this EdgeIntersection is at the argument location, + 1 this EdgeIntersection is located after the argument location. + + + + + + + + + + + + + + + + + + The point of intersection. + + + + + The index of the containing line segment in the parent edge. + + + + + The edge distance of this point along the containing line segment. + + + + + A list of edge intersections along an Edge. + + + + + + + + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + + The EdgeIntersection found or added. + + + + Returns an iterator of EdgeIntersections. + + + + + + + + + + + + Adds entries for the first and last points of the edge to the list. + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the input list (this is so a single list + can be used to accumulate all split edges for a Geometry). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + + + + + + + + + + + + A EdgeList is a list of Edges. It supports locating edges + that are pointwise equals to a target edge. + + + + + + Remove the selected Edge element from the list if present. + + Edge element to remove from list + + + + Insert an edge unless it is already in the list. + + + + + + + + + + + + If there is an edge equal to e already in the list, return it. + Otherwise return null. + + + + equal edge, if there is one already in the list, + null otherwise. + + + + + + + + + + + + + + + + + + If the edge e is already in the list, return its index. + + + + Index, if e is already in the list, + -1 otherwise. + + + + + + + + + + + + + + + + + + + + + + + Validates that a collection of is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Checks whether the supplied s are correctly noded. + + an enumeration of Edges. + If the SegmentStrings are not correctly noded + + + + Creates a new validator for the given collection of s. + + + + + Checks whether the supplied edges are correctly noded. + + If the SegmentStrings are not correctly noded + + + + + + + + + The directed edge which starts the list of edges for this EdgeRing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compute a LinearRing from the point list previously collected. + Test if the ring is a hole (i.e. if it is CCW) and set the hole flag + accordingly. + + + + + + + + + + + + + + + + + + + Collect all the points from the DirectedEdges of this ring into a contiguous list. + + + + + + + + + + + + + + + + + + + + + + Merge the RHS label from a DirectedEdge into the label for this EdgeRing. + The DirectedEdge label may be null. This is acceptable - it results + from a node which is NOT an intersection node between the Geometries + (e.g. the end node of a LinearRing). In this case the DirectedEdge label + does not contribute any information to the overall labelling, and is simply skipped. + + + + + + + + + + + + + + + This method will cause the ring to be computed. + It will also check any holes, if they have been assigned. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the list of DirectedEdges that make up this EdgeRing. + + + + + + + + + + A GeometryGraph is a graph that models a given Geometry. + + + + + The computation of the IntersectionMatrix relies on the use of a structure + called a "topology graph". The topology graph contains nodes and edges + corresponding to the nodes and line segments of a Geometry. Each + node and edge in the graph is labeled with its topological location relative to + the source point. + Note that there is no requirement that points of self-intersection be a vertex. + Thus to obtain a correct topology graph, Geometrys must be + self-noded before constructing their graphs. + Two fundamental operations are supported by topology graphs: + Computing the intersections between all the edges and nodes of a single graph + Computing the intersections between the edges and nodes of two different graphs + + + + + For nodes in the Collection, link the DirectedEdges at the node that are in the result. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The node if found; null otherwise + + + + + + Add a set of edges to the graph. For each edge two DirectedEdges + will be created. DirectedEdges are NOT linked by this method. + + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Link the DirectedEdges at the nodes of the graph. + This allows clients to link only a subset of nodes in the graph, for + efficiency (because they know that only a subset is of interest). + + + + + Returns the EdgeEnd which has edge e as its base edge + (MD 18 Feb 2002 - this should return a pair of edges). + + + The edge, if found null if the edge was not found. + + + + Returns the edge whose first two coordinates are p0 and p1. + + + + The edge, if found null if the edge was not found. + + + + Returns the edge which starts at p0 and whose first segment is + parallel to p1. + + + + The edge, if found null if the edge was not found. + + + + The coordinate pairs match if they define line segments lying in the same direction. + E.g. the segments are parallel and in the same quadrant + (as opposed to parallel and opposite!). + + + + + + + + + + + + + + + + + + + + + + + + + This method implements the Boundary Determination Rule + for determining whether + a component (node or edge) that appears multiple times in elements + of a MultiGeometry is in the boundary or the interior of the Geometry. + The SFS uses the "Mod-2 Rule", which this function implements. + An alternative (and possibly more intuitive) rule would be + the "At Most One Rule": + isInBoundary = (componentCount == 1) + + + + + The lineEdgeMap is a map of the linestring components of the + parentGeometry to the edges which are derived from them. + This is used to efficiently perform findEdge queries + + + + + If this flag is true, the Boundary Determination Rule will used when deciding + whether nodes are in the boundary or not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + Adds a polygon ring to the graph. Empty rings are ignored. + The left and right topological location arguments assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged. + + + + + + + + + + + + + + + + + + + + Add an Edge computed externally. The label on the Edge is assumed + to be correct. + + + + + + Add a point computed externally. The point is assumed to be a + Point Geometry part, which has a location of INTERIOR. + + + + + + Compute self-nodes, taking advantage of the Geometry type to + minimize the number of intersection tests. (E.g. rings are + not tested for self-intersection, since they are assumed to be valid). + + The LineIntersector to use. + If false, intersection checks are optimized to not test rings for self-intersection. + The SegmentIntersector used, containing information about the intersections found. + + + + + + + + + + + + + + + + + + + + + Adds candidate boundary points using the current . + This is used to add the boundary + points of dim-1 geometries (Curves/MultiCurves). + + + + + + + + + + + + + Add a node for a self-intersection. + If the node is a potential boundary node (e.g. came from an edge which + is a boundary) then insert it as a potential boundary node. + Otherwise, just add it as a regular node. + + + + + + + + Determines the of the given in this geometry. + + The point to test + + The location of the point in the geometry + + + + + + + + + + + + + + + + + + + + Gets the used with this geometry graph. + + + + + + + + + + An EdgeSetIntersector computes all the intersections between the + edges in the set. It adds the computed intersections to each edge + they are found on. It may be used in two scenarios: + determining the internal intersections between a single set of edges + determining the mutual intersections between two different sets of edges + It uses a SegmentIntersector to compute the intersections between + segments and to record statistics about what kinds of intersections were found. + + + + + Computes all self-intersections between edges in a set of edges, + allowing client to choose whether self-intersections are computed. + + A list of edges to test for intersections. + The SegmentIntersector to use. + true if self-intersections are to be tested as well. + + + + Computes all mutual intersections between two sets of edges. + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + They have the following properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MonotoneChains are a way of partitioning the segments of an edge to + allow for fast searching of intersections. + + Specifically, a sequence of contiguous line segments + is a monotone chain iff all the vectors defined by the oriented segments + lies in the same quadrant. + + Monotone Chains have the following useful properties: + the segments within a monotone chain will never intersect each other, and + the envelope of any contiguous subset of the segments in a monotone chain + is simply the envelope of the endpoints of the subset. + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + + Note that due to the efficient intersection test, there is no need to limit the size + of chains to obtain fast performance. + + + + + + + + + + + + + + + + + + + + The index of the last point in the monotone chain. + + + + + + Computes the intersection of line segments, + and adds the intersection to the edges containing the segments. + + + + + + + + + + + + + Testing only. + + + + + + + + + + + + + + + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning + and end segments. + + + + + + + + + This method is called by clients of the EdgeIntersector class to test for and add + intersections for two segments of the edges being intersected. + Note that clients (such as MonotoneChainEdges) may choose not to intersect + certain pairs of segments for efficiency reasons. + + + + + + + + + + + + + + + + + + + + + + + + + The proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire Geometry, since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the Geometry. + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this SegmentIntersector. + + + + + Finds all intersections in one or two sets of edges, + using the straightforward method of + comparing all segments. + This algorithm is too slow for production use, but is useful for testing purposes. + + + + + + + + + + + + + + + + + + + + + Performs a brute-force comparison of every segment in each Edge. + This has n^2 performance, and is about 100 times slower than using + monotone chains. + + + + + + + + Finds all intersections in one or two sets of edges, + using an x-axis sweepline algorithm in conjunction with Monotone Chains. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + The use of MonotoneChains as the items in the index + seems to offer an improvement in performance over a sweep-line alone. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + Finds all intersections in one or two sets of edges, + using a simple x-axis sweepline algorithm. + While still O(n^2) in the worst case, this algorithm + drastically improves the average-case time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Because DELETE events have a link to their corresponding INSERT event, + it is possible to compute exactly the range of events which must be + compared to a given INSERT event object. + + + + + + + + + + + + + + + + + + + + + + + + + Creates an INSERT event. + + The edge set label for this object. + The event location + the object being inserted + + + + Creates a DELETE event. + + The event location + The corresponding INSERT event + + + + Events are ordered first by their x-value, and then by their eventType. + Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A Label indicates the topological relationship of a component + of a topology graph to a given Geometry. + This class supports labels for relationships to two Geometrys, + which is sufficient for algorithms for binary operations. + Topology graphs support the concept of labeling nodes and edges in the graph. + The label of a node or edge specifies its topological relationship to one or + more geometries. (In fact, since NTS operations have only two arguments labels + are required for only two geometries). A label for a node or edge has one or + two elements, depending on whether the node or edge occurs in one or both of the + input Geometrys. Elements contain attributes which categorize the + topological location of the node or edge relative to the parent + Geometry; that is, whether the node or edge is in the interior, + boundary or exterior of the Geometry. Attributes have a value + from the set {Interior, Boundary, Exterior}. In a node each + element has a single attribute On. For an edge each element has a + triplet of attributes Left, On, Right. + It is up to the client code to associate the 0 and 1 TopologyLocations + with specific geometries. + + + + + Converts a Label to a Line label (that is, one with no side Location). + + Label to convert. + Label as Line label. + + + + Construct a Label with a single location for both Geometries. + Initialize the locations to Null. + + + + + + Construct a Label with a single location for both Geometries. + Initialize the location for the Geometry index. + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for both Geometries to the given values. + + + + + + + + Construct a Label with On, Left and Right locations for both Geometries. + Initialize the locations for the given Geometry index. + + + + + + + + + Construct a Label with the same values as the argument Label. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge this label with another one. + Merging updates any null attributes of this label with the attributes from lbl. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converts one GeometryLocation to a Line location. + + + + + + + + + + + + + + + + + + + + + + Only non-null if this node is precise. + + + + + + + + + + + + + + + + + Basic nodes do not compute IMs. + + + + + + Add the edge to the list of edges at this node. + + + + + + + + + + + + To merge labels for two nodes, + the merged location for each LabelElement is computed. + The location for the corresponding node LabelElement is set to the result, + as long as the location is non-null. + + + + + + + + + + + + + Updates the label of a node to BOUNDARY, + obeying the mod-2 boundaryDetermination rule. + + + + + + The location for a given eltIndex for a node will be one + of { Null, Interior, Boundary }. + A node may be on both the boundary and the interior of a point; + in this case, the rule is that the node is considered to be in the boundary. + The merged location is the maximum of the two input values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The basic node constructor does not allow for incident edges. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + + + + + + + This method expects that a node has a coordinate value. + + + + + + + + + + + + + Adds a node for the start point of this EdgeEnd + (if one does not already exist in this map). + Adds the EdgeEnd to the (possibly new) node. + + + + + + The node if found; null otherwise. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An indicator that a Location is on a GraphComponent (0) + + + + + An indicator that a Location is to the left of a GraphComponent (1) + + + + + An indicator that a Location is to the right of a GraphComponent (2) + + + + + An indicator that a Location is is parallel to x-axis of a GraphComponent (-1) + /// + + + + A Position indicates the position of a Location relative to a graph component + (Node, Edge, or Area). + + + + + Returns Positions.Left if the position is Positions.Right, + Positions.Right if the position is Left, or the position + otherwise. + + + + + + Utility functions for working with quadrants, which are numbered as follows: + + 1 | 0 + --+-- + 2 | 3 + + + + + + North-East + + + + + North-West + + + + + South-West + + + + + South-East + + + + + Only static methods! + + + + + Returns the quadrant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + If the displacements are both 0 + + + + Returns the quadrant of a directed line segment from p0 to p1. + + + + if the points are equal + + + + Returns true if the quadrants are 1 and 3, or 2 and 4. + + + + + + + Returns the right-hand quadrant of the halfplane defined by the two quadrants, + or -1 if the quadrants are opposite, or the quadrant if they are identical. + + + + + + + Returns whether the given quadrant lies within the given halfplane (specified + by its right-hand quadrant). + + + + + + + Returns true if the given quadrant is 0 or 1. + + + + + + A TopologyLocation is the labelling of a + GraphComponent's topological relationship to a single Geometry. + + + If the parent component is an area edge, each side and the edge itself + have a topological location. These locations are named: + + Onon the edge + Leftleft-hand side of the edge + Rightright-hand side + + + If the parent component is a line edge or node, there is a single + topological relationship attribute, On. + + The possible values of a topological location are + { , , , } + + The labelling is stored in an array _location[j] where + where j has the values On, Left, Right. + + + + + + + + + + + + Constructs a TopologyLocation specifying how points on, to the left of, and to the + right of some GraphComponent relate to some Geometry. Possible values for the + parameters are Location.Null, Location.Exterior, Location.Boundary, + and Location.Interior. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Merge updates only the Null attributes of this object + with the attributes of another. + + + + + + + + + + + Get calls Get(Positions posIndex), + Set calls SetLocation(Positions locIndex, Location locValue) + + + + + + + true if all locations are Null. + + + + + true if any locations are Null. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An BinTree (or "Binary Interval Tree") + is a 1-dimensional version of a quadtree. + It indexes 1-dimensional intervals (which may + be the projection of 2-D objects on an axis). + It supports range searching + (where the range may be a single point). + + + + This structure is dynamic - + new items can be added at any time, + and it will support deletion of items + (although this is not currently implemented). + + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + This index is different to the Interval Tree of Edelsbrunner + or the Segment Tree of Bentley. + + + + + Ensure that the Interval for the inserted item has non-zero extents. + Use the current minExtent to pad it, if necessary. + + + + + + + + + + + + + + + + + Removes a single item from the tree. + + itemEnv the Envelope of the item to be removed + the item to remove + true if the item was found (and thus removed) + + + + + + + + + + + + + + + + + Queries the tree to find all candidate items which + may overlap the query interval. + If the query interval is null, all items in the tree are found. + min and max may be the same value. + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + + + + + + + + + + + + + + + + + Compute the total number of nodes in the tree. + + The number of nodes in the tree. + + + + Represents an (1-dimensional) closed interval on the Real number line. + + + + + Creates a new interval instance, setting ==0d; + + + + + Creates a new interval instance, setting = and =; + + The minimum value + The maximum value + + + + Creates a new interval instance, setting = and =. + + + + + + Method to initialize the interval with the given and values.
+ If < , their values are exchanged. +
+ The minimum value + The maximum value +
+ + + Method to expand this interval to contain . + + The interval to contain. + + + + Function to test if this overlaps . + + The interval to test + true if this interval overlaps + + + + Function to test if this overlaps the interval R[, ]. + + The mimimum value of the interval + The maximum value of the interval + true if this interval overlaps the interval R[, ] + + + + Function to test if this contains . + + This is more rigid than + The interval to test + true if this interval contains + + + + Function to test if this contains the interval R[, ]. + + This is more rigid than + The mimimum value of the interval + The maximum value of the interval + true if this interval contains the interval R[, ] + + + + Function to test if this contains the value . + + The value to test + true if this interval contains the value + + + + Gets or sets a value indicating the minimum value of the closed interval. + + + + + Gets or sets a value indicating the maximum value of the closed interval. + + + + + Gets the width of the interval ( - ) + + + + + Gets the centre of the interval ( + * 0.5d) + + + + + A Key is a unique identifier for a node in a tree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node of a Bintree. + + + + + The base class for nodes in a Bintree. + + + + + Returns the index of the subnode that wholely contains the given interval. + If none does, returns -1. + + + + + + + + + + + + Subnodes are numbered as follows: + 0 | 1 + . + + + + + + + + + + + + + + + + + + + + + + + + + Adds items in the tree which potentially overlap the query interval + to the given collection. + If the query interval is null, add all items in the tree. + + A query interval, or null + The candidate items found + + + + Removes a single item from this subtree. + + The envelope containing the item + The item to remove + true if the item was found and removed + + + + + + + + + Gets whether this node is prunable + + + + + Gets whether this node has any children + + + + + + + + + + Gets whether this node has any subnodes + + + + + + + + + + + + + + + Creates a node + + The interval of the node item + A new node + + + + Creates a larger node, that contains both and + If is null, a node for is created. + + The original node + The additional interval + A new node + + + + Creates a new node instance + + The node's interval + The node's level + + + + + + + + + + + Returns the subnode containing the envelope. + Creates the node if + it does not already exist. + + + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subnode for the index. + If it doesn't exist, create it. + + + + + + + + + + + + Gets the node's + + + + + The root node of a single Bintree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the tree this is the root of. + + + + + + + Insert an item which is known to be contained in the tree rooted at + the given Node. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + The root node matches all searches. + + + + + + MonotoneChains are a way of partitioning the segments of a linestring to + allow for fast searching of intersections. + + + + They have the following properties: + + the segments within a monotone chain never intersect each other + the envelope of any contiguous subset of the segments in a monotone chain + is equal to the envelope of the endpoints of the subset. + + + + Property 1 means that there is no need to test pairs of segments from within + the same monotone chain for intersection. + Property 2 allows an efficient + binary search to be used to find the intersection points of two monotone chains. + For many types of real-world data, these properties eliminate a large number of + segment comparisons, producing substantial speed gains. + + One of the goals of this implementation of MonotoneChains is to be + as space and time efficient as possible. One design choice that aids this + is that a MonotoneChain is based on a subarray of a list of points. + This means that new arrays of points (potentially very large) do not + have to be allocated. + + MonotoneChains support the following kinds of queries: + + Envelope selectdetermine all the segments in the chain which + intersect a given envelope. + Overlapdetermine all the pairs of segments in two chains whose + envelopes overlap. + + + + This implementation of MonotoneChains uses the concept of internal iterators + ( and ) + to return the resultsets for the above queries. + This has time and space advantages, since it + is not necessary to build lists of instantiated objects to represent the segments + returned by the query. + Queries made in this manner are thread-safe. + + + + + + + + + + + + + + + Gets the line segment starting at + + The index of the segment + The line segment to extract to + + + + Determine all the line segments in the chain whose envelopes overlap + the searchEnvelope, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the select action on chain segments + which it can determine are not in the search envelope. + However, it *may* call the select action on segments + which do not intersect the search envelope. + This saves on the overhead of checking envelope intersection + each time, since clients may be able to do this more efficiently. + + The search envelope + The select action to execute on selected segments + + + + + + + + + + + + + Determine all the line segments in two chains which may overlap, and process them. + + + The monotone chain search algorithm attempts to optimize + performance by not calling the overlap action on chain segments + which it can determine do not overlap. + However, it *may* call the overlap action on segments + which do not actually interact. + This saves on the overhead of checking intersection + each time, since clients may be able to do this more efficiently. + + The monotone chain + The overlap action to execute on selected segments + + + + + + + + + + + + + + + Gets or sets the Id + + + + + Gets the chain's context + + + + + Gets the chain's envelope + + + + + Gets the start index + + + + + Gets the end index of the underlying linestring + + + + + Return the subsequence of coordinates forming this chain. + Allocates a new array to hold the Coordinates. + + + + + Constructs s + for sequences of s. + + + + + Only static methods! + + + + + + + + + + + + + + + + + + + Return a list of the MonotoneChains + for the given list of coordinates. + + + + + + + Return an array containing lists of start/end indexes of the monotone chains + for the given list of coordinates. + The last entry in the array points to the end point of the point array, + for use as a sentinel. + + + + + + Finds the index of the last point in a monotone chain + starting at a given point. + Any repeated points (0-length segments) will be included + in the monotone chain returned. + + The coordinates + The start index + + The index of the last point in the monotone chain starting at start. + + + + + The action for the internal iterator for performing + overlap queries on a MonotoneChain. + + + + + This envelope is used during the MonotoneChain search process. + + + + + This envelope is used during the MonotoneChain search process. + + + + + + + + + + + + + + + This function can be overridden if the original chains are needed. + + + The index of the start of the overlapping segment from mc1. + + The index of the start of the overlapping segment from mc2. + + + + This is a convenience function which can be overridden to obtain the actual + line segments which overlap. + + + + + + + A visitor for nodes and items in an index. + + + + + + + + + + + A static index on a set of 1-dimensional intervals, + using an R-Tree packed based on the order of the interval midpoints. + + + It supports range searching, + where the range is an interval of the real line (which may be a single point). + A common use is to index 1-dimensional intervals which + are the projection of 2-D objects onto an axis of the coordinate system. + + This index structure is static + - items cannot be added or removed once the first query has been made. + The advantage of this characteristic is that the index performance + can be optimized based on a fixed set of items. + + Martin Davis + + + + + Adds an item to the index which is associated with the given interval + + The lower bound of the item interval + The upper bound of the item interval + The item to insert + if the index has already been queried + + + + Search for intervals in the index which intersect the given closed interval + and apply the visitor to them. + + The lower bound of the query interval + The upper bound of the query interval + The visitor to pass any matched items to + + + + The basic insertion and query operations supported by classes + implementing spatial index algorithms. + A spatial index typically provides a primary filter for range rectangle queries. A + secondary filter is required to test for exact intersection. Of course, this + secondary filter may consist of other tests besides intersection, such as + testing other kinds of spatial relationships. + + + + + Adds a spatial item with an extent specified by the given Envelope to the index. + + + + + Queries the index for all items whose extents intersect the given search Envelope + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A list of the items found by the query. + + + + Queries the index for all items whose extents intersect the given search , + and applies an to them. + Note that some kinds of indexes may also return objects which do not in fact + intersect the query envelope. + + The envelope to query for. + A visitor object to apply to the items found. + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + A node of a , which represents one or more points in the same location. + + The type of the object + dskea + + + + Creates a new KdNode. + + coordinate of point + coordinate of point + A data objects to associate with this node + + + + Creates a new KdNode. + + The point location of new node + A data objects to associate with this node + + + + Gets x-ordinate of this node + + + + + Gets y-ordinate of this node + + + + + Gets the location of this node + + + + + Gets the user data object associated with this node. + + + + + Gets or sets the left node of the tree + + + + + Gets or sets the right node of the tree + + + + + Gets the number of inserted points that are coincident at this location. + + + + + Gets whether more than one point with this value have been inserted (up to the tolerance) + + + + + + An implementation of a 2-D KD-Tree. KD-trees provide fast range searching on point data. + + + This implementation supports detecting and snapping points which are closer + than a given distance tolerance. + If the same point (up to tolerance) is inserted + more than once , it is snapped to the existing node. + In other words, if a point is inserted which lies within the tolerance of a node already in the index, + it is snapped to that node. + When a point is snapped to a node then a new node is not created but the count of the existing node + is incremented. + If more than one node in the tree is within tolerance of an inserted point, + the closest and then lowest node is snapped to. + + The type of the user data object + David Skea + Martin Davis + + + + Converts a collection of s to an array of s. + + A collection of nodes + An array of the coordinates represented by the nodes + + + + Converts a collection of {@link KdNode}s + to an array of s, + specifying whether repeated nodes should be represented + by multiple coordinates. + + a collection of nodes + true if repeated nodes should + be included multiple times + An array of the coordinates represented by the nodes + + + + Creates a new instance of a KdTree with a snapping tolerance of 0.0. + (I.e. distinct points will not be snapped) + + + + + Creates a new instance of a KdTree with a snapping distance + tolerance. Points which lie closer than the tolerance to a point already + in the tree will be treated as identical to the existing point. + + The tolerance distance for considering two points equal + + + + Inserts a new point in the kd-tree, with no data. + + The point to insert + The kdnode containing the point + + + + Inserts a new point into the kd-tree. + + The point to insert + A data item for the point + + A new KdNode if a new point is inserted, else an existing + node is returned with its counter incremented. This can be checked + by testing returnedNode.getCount() > 1. + + + + + Finds the node in the tree which is the best match for a point + being inserted. + The match is made deterministic by returning the lowest of any nodes which + lie the same distance from the point. + There may be no match if the point is not within the distance tolerance of any + existing node. + + The point being inserted + + + the best matching node + null if no match was found + + + + + + Inserts a point known to be beyond the distance tolerance of any existing node. + The point is inserted at the bottom of the exact splitting path, + so that tree shape is deterministic. + + The point to insert + + + The data for the point + The created node + + + + + + Performs a range search of the points in the index. + + The range rectangle to query + + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection of the KdNodes found + + + + Performs a range search of the points in the index. + + The range rectangle to query + A collection to accumulate the result nodes into + + + + Performs a nearest neighbor search of the points in the index. + + The point to search the nearset neighbor for + + + + Tests whether the index contains any items. + + + + + DoubleBits manipulates Double numbers + by using bit manipulation and bit-field extraction. + For some operations (such as determining the exponent) + this is more accurate than using mathematical operations + (which suffer from round-off error). + The algorithms and constants in this class + apply only to IEEE-754 double-precision floating point format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This computes the number of common most-significant bits in the mantissa. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + The number of common most-significant mantissa bits. + + + + A representation of the Double bits formatted for easy readability. + + + + + + + + + + Determines the exponent for the number. + + + + + Determines the exponent for the number. + + + + + Provides a test for whether an interval is + so small it should be considered as zero for the purposes of + inserting it into a binary tree. + The reason this check is necessary is that round-off error can + cause the algorithm used to subdivide an interval to fail, by + computing a midpoint value which does not lie strictly between the + endpoints. + + + + + This value is chosen to be a few powers of 2 less than the + number of bits available in the double representation (i.e. 53). + This should allow enough extra precision for simple computations to be correct, + at least for comparison purposes. + + + + + Only static methods! + + + + + Computes whether the interval [min, max] is effectively zero width. + I.e. the width of the interval is so much less than the + location of the interval that the midpoint of the interval cannot be + represented precisely. + + + + + A Key is a unique identifier for a node in a quadtree. + It contains a lower-left point and a level number. The level number + is the power of two for the size of the node envelope. + + + + + + + + + + + + + + + + + + Return a square envelope containing the argument envelope, + whose extent is a power of two and which is based at a power of 2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a node of a Quadtree. Nodes contain + items which have a spatial extent corresponding to the node's position + in the quadtree. + + + + + The base class for nodes in a Quadtree. + + + + + Gets the index of the subquad that wholly contains the given envelope. + If none does, returns -1. + + The index of the subquad that wholly contains the given envelope
+ or -1 if no subquad wholly contains the envelope
+
+ + + + + + + + subquads are numbered as follows: + 2 | 3 + --+-- + 0 | 1 + + + + + + + + + + + Removes a single item from this subtree. + + The envelope containing the item. + The item to remove. + true if the item was found and removed. + + + + Insert items in this into the parameter! + + IList for adding items. + Parameter IList with this items. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the subquad containing the envelope . + Creates the subquad if + it does not already exist. + + The envelope to search for + The subquad containing the search envelope. + + + + Returns the smallest existing + node containing the envelope. + + + + + + + + + + + + Get the subquad for the index. + If it doesn't exist, create it. + + + + + + + + + + + + + + + + + + A Quadtree is a spatial index structure for efficient range querying + of items bounded by 2D rectangles.
+ s can be indexed by using their s.
+ Any type of object can also be indexed, as long as it has an extent that can be + represented by an . + + This Quadtree index provides a primary filter + for range rectangle queries. The various query methods return a list of + all items which may intersect the query rectangle. Note that + it may thus return items which do not in fact intersect the query rectangle. + A secondary filter is required to test for actual intersection + between the query rectangle and the envelope of each candidate item. + The secondary filter may be performed explicitly, + or it may be provided implicitly by subsequent operations executed on the items + (for instance, if the index query is followed by computing a spatial predicate + between the query geometry and tree items, + the envelope intersection check is performed automatically. + + This implementation does not require specifying the extent of the inserted + items beforehand. It will automatically expand to accomodate any extent + of dataset. + + This data structure is also known as an MX-CIF quadtree + following the terminology usage of Samet and others. +
+
+ + + Ensure that the envelope for the inserted item has non-zero extents. + Use the current minExtent to pad the envelope, if necessary. + + + + + + + minExtent is the minimum envelope extent of all items + inserted into the tree so far. It is used as a heuristic value + to construct non-zero envelopes for features with zero X and/or Y extent. + Start with a non-zero extent, in case the first feature inserted has + a zero extent in both directions. This value may be non-optimal, but + only one feature will be inserted with this value. + + + + + Constructs a Quadtree with zero items. + + + + + + + + + + + + Removes a single item from the tree. + + The Envelope of the item to be removed. + The item to remove. + true if the item was found (and thus removed). + + + + Queries the tree and returns items which may lie in the given search envelope. + + + Precisely, the items that are returned are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be returned as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not returned - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A List of items which may intersect the search envelope + + + + Queries the tree and visits items which may lie in the given search envelope. + + + Precisely, the items that are visited are all items in the tree + whose envelope may intersect the search Envelope. + Note that some items with non-intersecting envelopes may be visited as well; + the client is responsible for filtering these out. + In most situations there will be many items in the tree which do not + intersect the search envelope and which are not visited - thus + providing improved performance over a simple linear scan. + + The envelope of the desired query area. + A visitor object which is passed the visited items + + + + Return a list of all items in the Quadtree. + + + + + + + + + + + Returns the number of levels in the tree. + + + + + Tests whether the index contains any items. + + + + + Returns the number of items in the tree. + + + + + QuadRoot is the root of a single Quadtree. + It is centred at the origin, + and does not have a defined extent. + + + + + Insert an item into the quadtree this is the root of. + + + + + Insert an item which is known to be contained in the tree rooted at + the given QuadNode root. Lower levels of the tree will be created + if necessary to hold the item. + + + + + + + + + + + + A node of an . A node is one of: + + empty + an interior node containing child s + a leaf node containing data items (s). + + A node stores the bounds of its children, and its level within the index tree. + + + + + Constructs an AbstractNode at the given level in the tree + + + 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Returns a representation of space that encloses this Boundable, + preferably not much bigger than this Boundable's boundary yet fast to + test for intersection with the bounds of other Boundables. The class of + object returned depends on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other + object (for other subclasses of AbstractSTRtree). + + + + + Adds either an AbstractNode, or if this is a leaf node, a data object + (wrapped in an ItemBoundable). + + + + + + Returns either child s, or if this is a leaf node, real data (wrapped + in s). + + + + + Gets the bounds of this node + + + + + Returns 0 if this node is a leaf, 1 if a parent of a leaf, and so on; the + root node will have the highest level. + + + + + Gets the count of the s at this node. + + + + + Tests whether there are any s at this node. + + + + + Base class for STRtree and SIRtree. STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + This implementation is based on s rather than just s, + because the STR algorithm operates on both nodes and + data, both of which are treated as s. + + + + + Set to null when index is built, to avoid retaining memory. + + + + Constructs an AbstractSTRtree with the specified maximum number of child + nodes that a node may have. + + + + + + Creates parent nodes, grandparent nodes, and so forth up to the root + node, for the data that has been inserted into the tree. Can only be + called once, and thus can be called only after all of the data has been + inserted into the tree. + + + + + + + + + + + + Sorts the childBoundables then divides them into groups of size M, where + M is the node capacity. + + + + + + + Creates the levels higher than the given level. + + The level to build on. + the level of the Boundables, or -1 if the boundables are item + boundables (that is, below level 0). + The root, which may be a ParentNode or a LeafNode. + + + + Also builds the tree, if necessary. + + + + + + Gets a tree structure (as a nested list) + corresponding to the structure of the items and nodes in this tree. + The returned Lists contain either Object items, + or Lists which correspond to subtrees of the tree + Subtrees which do not contain any items are not included. + Builds the tree if necessary. + + a List of items and/or Lists + + + + Removes an item from the tree. + (Builds the tree, if necessary.) + + + + + Returns the maximum number of child nodes that a node may have. + + + + + Tests whether the index contains any items. + This method does not build the index, + so items can still be inserted after it has been called. + + + + + Gets the number of elements in the tree + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + A test for intersection between two bounds, necessary because subclasses + of AbstractSTRtree have different implementations of bounds. + + + + + For STRtrees, the bounds will be Envelopes; + for SIRtrees, Intervals; + for other subclasses of AbstractSTRtree, some other class. + + The bounds of one spatial object. + The bounds of another spatial object. + Whether the two bounds intersect. + + + + A pair of s, whose leaf items + support a distance metric between them. + Used to compute the distance between the members, + and to expand a member relative to the other + in order to produce new branches of the + Branch-and-Bound evaluation tree. + Provides an ordering based on the distance between the members, + which allows building a priority queue by minimum distance. + + Martin Davis + + + + Creates an instance of this class with the given s and the function. + + The first boundable + The second boundable + The item distance function + + + + Gets one of the member s in the pair + (indexed by [0, 1]). + + The index of the member to return (0 or 1) + The chosen member + + + + Computes the distance between the s in this pair. + The boundables are either composites or leaves. + If either is composite, the distance is computed as the minimum distance + between the bounds. + If both are leaves, the distance is computed by . + + The distance between the s in this pair. + + + + Compares two pairs based on their minimum distances + + + + + For a pair which is not a leaf + (i.e. has at least one composite boundable) + computes a list of new pairs + from the expansion of the larger boundable. + + + + + Gets the minimum possible distance between the Boundables in + this pair. + If the members are both items, this will be the + exact distance between them. + Otherwise, this distance will be a lower bound on + the distances between the items in the members. + + The exact or lower bound distance for this pair + + + + Tests if both elements of the pair are leaf nodes + + + + + An function for + items which are using the method. + + Martin Davis + + + + A function method which computes the distance + between two s in an . + Used for Nearest Neighbour searches. + + Martin Davis + + + + Computes the distance between two items. + + The first item. + The second item. + If the metric is not applicable to the arguments + The distance between and . + + + + Computes the distance between two items, + using the method. + + An item which is a geometry. + An item which is a geometry. + if either item is not a Geometry + The distance between the two items. + + + + A spatial object in an AbstractSTRtree. + + + + + Returns a representation of space that encloses this Boundable, preferably + not much bigger than this Boundable's boundary yet fast to test for intersection + with the bounds of other Boundables. The class of object returned depends + on the subclass of AbstractSTRtree. + + + An Envelope (for STRtrees), an Interval (for SIRtrees), or other object + (for other subclasses of AbstractSTRtree). + + + + + A contiguous portion of 1D-space. Used internally by SIRtree. + + + + + + + + + + + + + + + + + + + + + this + + + + + + + this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Boundable wrapper for a non-Boundable spatial object. Used internally by + AbstractSTRtree. + + + + + + + + + + + + The bounds + + + + + The item + + + + + One-dimensional version of an STR-packed R-tree. SIR stands for + "Sort-Interval-Recursive". STR-packed R-trees are described in: + P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an SIRtree with the default (10) node capacity. + + + + + Constructs an SIRtree with the given maximum number of child nodes that + a node may have. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + + Returns items whose bounds intersect the given value. + + + + + + Returns items whose bounds intersect the given bounds. + + Possibly equal to x2. + Possibly equal to x1. + + + + + + + + + + + + + + + + + + + + + + + + + + + A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. + For two-dimensional spatial data. + The STR packed R-tree is simple to implement and maximizes space + utilization; that is, as many leaves as possible are filled to capacity. + Overlap between nodes is far less than in a basic R-tree. However, once the + tree has been built (explicitly or on the first call to #query), items may + not be added or removed. + Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With + Application To GIS. Morgan Kaufmann, San Francisco, 2002. + + + + + Constructs an STRtree with the default (10) node capacity. + + + + + Constructs an STRtree with the given maximum number of child nodes that + a node may have. + + The minimum recommended capacity setting is 4. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates the parent level for the given child level. First, orders the items + by the x-values of the midpoints, and groups them into vertical slices. + For each slice, orders the items by the y-values of the midpoints, and + group them into runs of size M (the node capacity). For each run, creates + a new (parent) node. + + + + + + + + + + + + + + + + + + + + + + + + + Must be sorted by the x-value of the envelope midpoints. + + + + + + + + + + + + Inserts an item having the given bounds into the tree. + + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + Returns items whose bounds intersect the given envelope. + + + + + + + Removes a single item from the tree. + + The Envelope of the item to remove. + The item to remove. + true if the item was found. + + + + + + + + + + Finds the two nearest items in the tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + A distance metric applicable to the items in this tree + The pair of the nearest items + + + + Finds the item in this tree which is nearest to the given , + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + + The query does not have to be + contained in the tree, but it does + have to be compatible with the + distance metric. + + The envelope of the query item + The item to find the nearest neighbour of + A distance metric applicable to the items in this tree and the query item + The nearest item in this tree + + + + Finds the two nearest items from this tree + and another tree, + using as the distance metric. + A Branch-and-Bound tree traversal algorithm is used + to provide an efficient search. + The result value is a pair of items, + the first from this tree and the second + from the argument tree. + + Another tree + A distance metric applicable to the items in the trees + The pair of the nearest items, one from each tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ProjectionEvents are ordered first by their x-value, and then by their eventType. + It is important that Insert events are sorted before Delete events, so that + items whose Insert and Delete events occur at the same x-value will be + correctly handled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sweepline implements a sorted index on a set of intervals. + It is used to compute all overlaps between the interval in the index. + + + + + + + + + + + Because Delete Events have a link to their corresponding Insert event, + it is possible to compute exactly the range of events which must be + compared to a given Insert event object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Extends the class to allow reading values in the BigEndian format. + + + While extends + adding methods for reading integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for reading values in the BigEndian format. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + encoding is null. + The stream does not support reading, the stream is null, or the stream is already closed. + + + + Reads a 2-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by two bytes. + + + A 2-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 2-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by two bytes. + + + A 2-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by four bytes. + + + A 4-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte signed integer from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte signed integer read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte unsigned integer from the current stream using big endian encoding + and advances the position of the stream by eight bytes. + + + An 8-byte unsigned integer read from this stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a 4-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by four bytes. + + + A 4-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads an 8-byte floating point value from the current stream using big endian encoding + and advances the current position of the stream by eight bytes. + + + An 8-byte floating point value read from the current stream. + + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Reads a string from the current stream. + The string is prefixed with the length, encoded as an integer seven bits at a time. + + The string being read. + The stream is closed. + An I/O error occurs. + The end of the stream is reached. + + + + Extends the class to allow writing values in the BigEndian format. + + + While extends + adding methods for writing integer values () + and double values () in the BigEndian format, + this implementation overrides methods, such + and and more, + for writing values in the BigEndian format. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The supplied stream. + output is null. + + The stream does not support writing, or the stream is already closed. + + + + Initializes a new instance of the class. + + The supplied stream. + The character encoding. + output or encoding is null. + + The stream does not support writing, or the stream is already closed. + + + + Writes a two-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a two-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by two bytes. + + The two-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte signed integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte signed integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte unsigned integer to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte unsigned integer to write. + The stream is closed. + An I/O error occurs. + + + + Writes a four-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by four bytes. + + The four-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes an eight-byte floating-point value to the current stream using BigEndian encoding + and advances the stream position by eight bytes. + + The eight-byte floating-point value to write. + The stream is closed. + An I/O error occurs. + + + + Writes a length-prefixed string to this stream in the current encoding + of the , + and advances the current position of the stream in accordance + with the encoding used and the specific characters being written to the stream. + + The value to write. + The stream is closed. + An I/O error occurs. + value is null. + + + + Reads a GML document and creates a representation of the features based on NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + + + + Initialize reader with a standard . + + + + + Initialize reader with the given . + + + + + Read a GML document and returns relative . + + + + + + + Reads the coordinate. + + The reader. + + + + + Extract a from a x,y string value. + + + + + + + Extract a from a pos entity string value. + + + + + + + Extract a from a x,y string value. + + + + + builder. + + + + + Writes the GML representation of the features of NetTopologySuite model. + Uses GML 2.1.1 Geometry.xsd schema for base for features. + + Thanks to rstuven for improvements :) + + + + + + Returns an XmlReader with feature informations. + Use XmlDocument.Load(XmlReader) for obtain a XmlDocument to work. + + + + + + + Writes a GML feature into a generic Stream, such a FileStream or other streams. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formatter for double values of coordinates + + + + + Thrown by a WKTReader when a parsing problem occurs. + + + + + Creates a ParseException with the given detail message. + + A description of this ParseException. + + + + Creates a ParseException with es detail message. + + An exception that occurred while a WKTReader was + parsing a Well-known Text string. + + + + WKB Geometry Types + + + + + Point. + + + + + LineString. + + + + + Polygon. + + + + + MultiPoint. + + + + + MultiLineString. + + + + + MultiPolygon. + + + + + GeometryCollection. + + + + + Point with Z coordinate. + + + + + LineString with Z coordinate. + + + + + Polygon with Z coordinate. + + + + + MultiPoint with Z coordinate. + + + + + MultiLineString with Z coordinate. + + + + + MultiPolygon with Z coordinate. + + + + + GeometryCollection with Z coordinate. + + + + + Point with M ordinate value. + + + + + LineString with M ordinate value. + + + + + Polygon with M ordinate value. + + + + + MultiPoint with M ordinate value. + + + + + MultiLineString with M ordinate value. + + + + + MultiPolygon with M ordinate value. + + + + + GeometryCollection with M ordinate value. + + + + + Point with Z coordinate and M ordinate value. + + + + + LineString with Z coordinate and M ordinate value. + + + + + Polygon with Z coordinate and M ordinate value. + + + + + MultiPoint with Z coordinate and M ordinate value. + + + + + MultiLineString with Z coordinate and M ordinate value. + + + + + MultiPolygon with Z coordinate and M ordinate value. + + + + + GeometryCollection with Z coordinate and M ordinate value. + + + + + Converts a Well-Known Binary byte data to a Geometry. + + + The reader repairs structurally-invalid input + (specifically, LineStrings and LinearRings which contain + too few points have vertices added, + and non-closed rings are closed). + s + + + + Converts a hexadecimal string to a byte array. + The hexadecimal digit symbols are case-insensitive. + + A string containing hex digits + An array of bytes with the value of the hex string + + + true if structurally invalid input should be reported rather than repaired. + At some point this could be made client-controllable. + + + + Initialize reader with a standard . + + + + + Initialize reader with the given GeometryFactory. + + + + + + Reads a in binary WKB format from an array of s. + + The byte array to read from + The geometry read + if the WKB data is ill-formed. + + + + Reads a in binary WKB format from an . + + The stream to read from + The geometry read + if the WKB data is ill-formed. + + + + + + + + + + + + + + + + + Function to read a coordinate sequence. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to form a ring. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to read a coordinate sequence that is supposed to serve a line string. + + The reader + The number of ordinates + The coordinate system + The read coordinate sequence. + + + + Function to convert from to + + The coordinate system + The corresponding + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Reads a geometry. + + The reader + The coordinate system + The spatial reference id for the geometry. + A geometry + + + + Function to determine whether an ordinate should be handled or not. + + + + + + + The builder. + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Writes a Well-Known Binary byte data representation of a Geometry. + + + WKBWriter stores X,Y,Z values if is not , + otherwise value is discarded and only X,Y are stored. + + + + Converts a byte array to a hexadecimal string. + A byte array + + + Converts a byte array to a hexadecimal string. + A byte array + + + + Initializes writer with LittleIndian byte order. + + + + + Initializes writer with the specified byte order. + + Encoding type + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + + + + Initializes writer with the specified byte order. + + Encoding type + SRID values, present or not, should be emitted. + Z values, present or not, should be emitted + M values, present or not, should be emitted + + + + Writes a WKB representation of a given point. + + + + + + + Writes a WKB representation of a given point. + + + + + + + + + + + + + + + Writes LittleIndian ByteOrder. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets corrent length for Byte Stream. + + + + + + + Sets corrent length for Byte Stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets or sets whether the value should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Gets or sets whether the values should be emitted + + + + + Standard byte size for each complex point. + Each complex point (LineString, Polygon, ...) contains: + 1 byte for ByteOrder and + 4 bytes for WKBType. + 4 bytes for SRID value + + + + + Gets a value whether or not EWKB featues may be used. + EWKB features are + 0x80000000 flag if geometry's z-ordinate values are written + 0x40000000 flag if geometry's m-ordinate values are written + 0x20000000 flag if geometry's SRID value is written + + + + + Converts a Well-Known Text string to a Geometry. + + The WKTReader allows + extracting Geometry objects from either input streams or + internal strings. This allows it to function as a parser to read Geometry + objects from text blocks embedded in other data formats (e.g. XML). + + The Well-known + Text format is defined in the + OpenGIS Simple Features Specification for SQL . + + NOTE: There is an inconsistency in the SFS. + The WKT grammar states that MultiPoints are represented by + MULTIPOINT ( ( x y), (x y) ), + but the examples show MultiPoints as MULTIPOINT ( x y, x y ). + Other implementations follow the latter syntax, so NTS will adopt it as well. + A WKTReader is parameterized by a GeometryFactory, + to allow it to create Geometry objects of the appropriate + implementation. In particular, the GeometryFactory will + determine the PrecisionModel and SRID that is used. + The WKTReader will convert the input numbers to the precise + internal representation. + + reads also non-standard "LINEARRING" tags. + + + + + + Creates a WKTReader that creates objects using a basic GeometryFactory. + + + + + Creates a WKTReader that creates objects using the given + GeometryFactory. + + The factory used to create Geometrys. + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + one or more Geometry Tagged Text strings (see the OpenGIS + Simple Features Specification) separated by whitespace. + + + A Geometry specified by wellKnownText + + + + + Converts a Well-known Text representation to a Geometry. + + + A Reader which will return a "Geometry Tagged Text" + string (see the OpenGIS Simple Features Specification). + + A Geometry read from reader. + + + + + Returns the next array of Coordinates in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next element returned by the stream should be "(" (the + beginning of "(x1 y1, x2 y2, ..., xn yn)") or "EMPTY". + + + if set to true skip extra parenthesis around coordinates. + + + The next array of Coordinates in the + stream, or an empty array if "EMPTY" is the next element returned by + the stream. + + + + + + + + + + + + + + + + + + + + Returns the next number in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a number. + + The next number in the stream. + if the next token is not a valid number + + + + Returns the next "EMPTY" or "(" in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be "EMPTY" or "(". + + + The next "EMPTY" or "(" in the stream as uppercase text. + + + + Returns the next ")" or "," in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")" or ",". + + + The next ")" or "," in the stream. + + + + Returns the next ")" in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be ")". + + + The next ")" in the stream. + + + + Returns the next word in the stream as uppercase text. + + + Tokenizer over a stream of text in Well-known Text + format. The next token must be a word. + + The next word in the stream as uppercase text. + + + + Creates a Geometry using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Geometry Tagged Text. + + A Geometry specified by the next token + in the stream. + + + + Creates a Point using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <Point Text. + + + A Point specified by the next token in + the stream. + + + + Creates a LineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + + A LineString specified by the next + token in the stream. + + + + Creates a LinearRing using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <LineString Text. + + + A LinearRing specified by the next + token in the stream. + + + + Creates a MultiPoint using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <MultiPoint Text. + + + + A MultiPoint specified by the next + token in the stream. + + + + Creates an array of Points having the given Coordinates. + + + The Coordinates with which to create the Points + + The factory to create the points + + Points created using this WKTReader + s GeometryFactory. + + + + + Creates a Polygon using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a Polygon Text. + + + + A Polygon specified by the next token + in the stream. + + + + + Creates a MultiLineString using the next token in the stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiLineString Text. + + + + A MultiLineString specified by the + next token in the stream. + + + + Creates a MultiPolygon using the next token in the stream. + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a MultiPolygon Text. + + + + A MultiPolygon specified by the next + token in the stream, or if if the coordinates used to create the + Polygon shells and holes do not form closed linestrings. + + + + Creates a GeometryCollection using the next token in the + stream. + + + Tokenizer over a stream of text in Well-known Text + format. The next tokens must form a <GeometryCollection Text. + + + + A GeometryCollection specified by the + next token in the stream. + + + + Gets or sets the factory to create geometries + + + + + Gets or sets the default SRID + + + + + Gets or sets whether invalid linear rings should be fixed + + + + + Outputs the textual representation of a . + The outputs coordinates rounded to the precision + model. No more than the maximum number of necessary decimal places will be + output. + The Well-known Text format is defined in the OpenGIS Simple Features + Specification for SQL. + A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does + not define a special tag for LinearRings. The standard tag to use is + "LINESTRING". + + + + + Generates the WKT for a Point specified by a . + + The point coordinate. + The WKT + + + + Generates the WKT for a N-point LineString specified by a . + + The sequence to write. + The WKT + + + Generates the WKT for a LINESTRING + specified by a {@link CoordinateSequence}. + + @param seq the sequence to write + + @return the WKT string + + + + Generates the WKT for a LineString specified by two s. + + The first coordinate. + The second coordinate. + The WKT + + + + Creates the NumberFormatInfo used to write doubles + with a sufficient number of decimal places. + + + The PrecisionModel used to determine + the number of decimal places to write. + + + A NumberFormatInfo that write doubles + without scientific notation. + + + + + Returns a String of repeated characters. + + The character to repeat. + The number of times to repeat the character. + A string of characters. + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Geometry Tagged Text string (see the OpenGIS Simple Features Specification). + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + A Stream to write into + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process. + + A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification) + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Same as write, but with newlines and spaces to make the + well-known text more readable. + + A Geometry to process + + + A Geometry Tagged Text string (see the OpenGIS Simple + Features Specification), with newlines and spaces. + + + + + Converts a Geometry to its Well-known Text representation. + + A Geometry to process + + + + A "Geometry Tagged Text" string (see the OpenGIS Simple + Features Specification). + + + + + Converts a Geometry to <Geometry Tagged Text format, + then appends it to the writer. + + /he Geometry to process. + + /he output writer to append to. + + + + Converts a Coordinate to Point Tagged Text format, + then appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a LineString to <LineString Tagged Text + format, then appends it to the writer. + + The LineString to process. + + The output writer to append to. + + + + Converts a LinearRing to <LinearRing Tagged Text + format, then appends it to the writer. + + The LinearRing to process. + + The output writer to append to. + + + + Converts a Polygon to Polygon Tagged Text format, + then appends it to the writer. + + The Polygon to process. + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Tagged Text + format, then appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to MultiLineString Tagged + Text format, then appends it to the writer. + + The MultiLineString to process. + + The output writer to append to. + + + + Converts a MultiPolygon to MultiPolygon Tagged Text + format, then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollection + Tagged Text format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + Converts a Coordinate to Point Text format, then + appends it to the writer. + + The Coordinate to process. + + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + Appends the i'th coordinate from the sequence to the writer + the to process + the index of the coordinate to write + writer the output writer to append to + + + + + Converts a Coordinate to Point format, then appends + it to the writer. + + The Coordinate to process. + The output writer to append to. + + The PrecisionModel to use to convert + from a precise coordinate to an external coordinate. + + + + + Converts a to a . + + The to convert. + + The as a . + + + + Converts a to <LineString Text> format, then appends it to the writer + + + + + Converts a LineString to <LineString Text format, then + appends it to the writer. + + The LineString to process. + + + The output writer to append to. + + + + Converts a Polygon to Polygon Text format, then + appends it to the writer. + + The Polygon to process. + + + The output writer to append to. + + + + Converts a MultiPoint to <MultiPoint Text format, then + appends it to the writer. + + The MultiPoint to process. + + The output writer to append to. + + + + Converts a MultiLineString to <MultiLineString Text + format, then appends it to the writer. + + The MultiLineString to process. + + + The output writer to append to. + + + + Converts a MultiPolygon to <MultiPolygon Text format, + then appends it to the writer. + + The MultiPolygon to process. + + The output writer to append to. + + + + Converts a GeometryCollection to GeometryCollectionText + format, then appends it to the writer. + + The GeometryCollection to process. + + The output writer to append to. + + + + + + + + + + + + + + + + + + + + Gets/sets whther the output woll be formatted + + + + + Gets/sets the maximum number of coordinates per line written in formatted output. + + If the provided coordinate number is < 0, coordinates will be written all on one line. + + + Gets/sets the tab size to use for indenting. + If the size is non-positive + + + + Extracts the subline of a linear between + two s on the line. + + + + + Computes the subline of a between + two s on the line. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The line to use as the baseline. + The start location. + The end location. + The extracted subline. + + + + Initializes a new instance of the class. + + + + + + Extracts a subline of the input. + If is minor that , + the linear geometry computed will be reversed. + + The start location. + The end location. + A linear geometry. + + + + + + + + + + + Assumes input is valid + (e.g. minor or equals to ). + + + + + + + + Supports linear referencing along a linear + using the length along the line as the index. + Negative length values are taken as measured in the reverse direction + from the end of the geometry. + Out-of-range index values are handled by clamping + them to the valid range of values. + Non-simple lines (i.e. which loop back to cross or touch + themselves) are supported. + + + + + Constructs an object which allows a linear + to be linearly referenced using length as an index. + + The linear geometry to reference along. + + + + Computes the for the point + on the line at the given index. + If the index is out of range the first or last point on the + line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the lies before the , + the computed geometry is reversed. + + + + + + + + + + + + + + + Computes the minimum index for a point on the line. + If the line is not simple (i.e. loops back on itself) + a single point may have more than one possible index. + In this case, the smallest index is returned. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The minimum index of the point. + + + + + Finds the index for a point on the line + which is greater than the given index. + If no such index exists, returns . + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The value the returned index must be greater than. + The index of the point greater than the given minimum index. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline.. + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + + + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line + by clamping the given index to the valid range of index values + + A valid index value + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Finds the nearest index along the linear + to a given after the specified minimum index. + If possible the location returned will be strictly + greater than the . + If this is not possible, the value returned + will equal . + (An example where this is not possible is when + = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + + + + + + + + + + + + + + + + + + Computes the for a given length + along a linear + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + + + + + Computes the for a + given length along a linear . + + The linear geometry to use. + The length index of the location. + The for the length. + + + + Computes the for a + given length along a linear , + with control over how the location + is resolved at component endpoints. + + The linear geometry to use + The length index of the location + If true lengths are resolved to the lowest possible index + + + + Computes the length for a given + on a linear . + + The linear geometry to use. + The index of the location. + The length for the . + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest possible location value. + + The length index. + The corresponding . + + + + Compute the corresponding to a length. + Negative lengths are measured in reverse from end of the linear geometry. + Out-of-range values are clamped. + Ambiguous indexes are resolved to the lowest or highest possible location value, + depending on the value of resolveLower + + The length index + + The corresponding . + + + + + + + + + + + + + + + + + + Builds a linear geometry ( or ) + incrementally (point-by-point). + + + + + Creates an instance of this class. + + The geometry factory to use. + + + + Adds a point to the current line. + + The to add. + + + + Adds a point to the current line. + + The to add. + If true, allows the insertions of repeated points. + + + + Terminate the current . + + + + + + + + + + + + Builds and returns the . + + + + + + Allows invalid lines to be fixed rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + Allows invalid lines to be ignored rather than causing Exceptions. + An invalid line is one which has only one unique point. + + + + + + + + + + An iterator over the components and coordinates of a linear geometry + (s and s. + + + + + + + + + + + + Invariant: currentLine <> null if the iterator is pointing at a valid coordinate + + + + + Creates an iterator initialized to the start of a linear . + + The linear geometry to iterate over. + if is not + + + + Creates an iterator starting at a on a linear . + + The linear geometry to iterate over. + The location to start at. + if is not + + + + Creates an iterator starting at + a component and vertex in a linear . + + The linear geometry to iterate over. + The component to start at. + The vertex to start at. + if is not + + + + + + + + + Tests whether there are any vertices left to iterator over. + Specifically, HasNext() returns true if the + current state of the iterator represents a valid location + on the linear geometry. + + true if there are more vertices to scan. + + + + Jump to the next element of the iteration. + + + + + Checks whether the iterator cursor is pointing to the + endpoint of a component . + + + + + The component index of the vertex the iterator is currently at. + + + + + The vertex index of the vertex the iterator is currently at. + + + + + Gets the component the iterator is current at. + + + + + Gets the first of the current segment + (the coordinate of the current vertex). + + + + + Gets the second of the current segment + (the coordinate of the next vertex). + If the iterator is at the end of a line, null is returned. + + + + + Represents a location along a or .
+ The referenced geometry is not maintained within this location, + but must be provided for operations which require it. + Various methods are provided to manipulate the location value + and query the geometry it references. +
+
+ + + Gets a location which refers to the end of a linear . + + The linear geometry. + A new LinearLocation. + + + + Computes the of a point a given fraction + along the line segment (p0, p1). + + + + If the fraction is greater than 1.0 the last + point of the segment is returned. + If the fraction is less than or equal to 0.0 the first point + of the segment is returned. + + The Z ordinate is interpolated from the Z-ordinates of the given points, + if they are specified. + + The first point of the line segment. + The last point of the line segment. + The length to the desired point. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + + + + Initializes a new instance of the class: + creates a location referring to the start of a linear geometry. + + Index of the component. + Index of the segment. + The segment fraction. + If true, ensures the individual values are locally valid. + + + + Creates a new location equal to a given one. + + A linear location + + + + Ensures the individual values are locally valid. + Does not ensure that the indexes are valid for + a particular linear geometry. + + + + + Ensures the indexes are valid for a given linear . + + A linear geometry. + + + + Snaps the value of this location to + the nearest vertex on the given linear , + if the vertex is closer than . + + A linear geometry. + The minimum allowable distance to a vertex. + + + + Gets the length of the segment in the given + Geometry containing this location. + + A linear geometry. + The length of the segment. + + + + Sets the value of this location to + refer to the end of a linear geometry. + + The linear geometry to use to set the end. + + + + Gets the along the + given linear which is + referenced by this location. + + A linear geometry. + The at the location. + + + + Gets a representing the segment of the given linear which contains this location. + + A linear geometry + the LineSegment containing the location + + + + Tests whether this location refers to a valid + location on the given linear . + + A linear geometry. + true if this location is valid. + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + is not the same type as this instance. + + + + + Compares the current instance with another object of the same type. + + + The LineStringLocation with which this + Coordinate is being compared. + + + A negative integer, zero, or a positive integer as this + LineStringLocation is less than, equal to, + or greater than the specified LineStringLocation. + + + + + Compares this object with the specified index values for order. + + The component index. + The segment index. + The segment fraction. + + A negative integer, zero, or a positive integer as this LineStringLocation + is less than, equal to, or greater than the specified locationValues. + + + + + Compares two sets of location values for order. + + The first component index. + The first segment index. + The first segment fraction. + The second component index. + The second segment index. + The second segment fraction. + + A negative integer, zero, or a positive integer + as the first set of location values is less than, equal to, + or greater than the second set of locationValues. + + + + + Tests whether two locations are on the same segment in the parent . + + A location on the same geometry + true if the locations are on the same segment of the parent geometry + + + + Tests whether this location is an endpoint of + the linear component it refers to. + + The linear geometry referenced by this location + True if the location is a component endpoint + + + + Converts a linear location to the lowest equivalent location index. + The lowest index has the lowest possible component and segment indices. + Specifically: + * if the location point is an endpoint, a location value is returned as (nseg-1, 1.0) + * if the location point is ambiguous (i.e. an endpoint and a startpoint), the lowest endpoint location is returned + If the location index is already the lowest possible value, the original location is returned. + + The linear geometry referenced by this location. + The lowest equivalent location. + + + + Copies this location. + + A copy of this location. + + + + Gets the component index for this location. + + + + + Gets the segment index for this location. + + + + + Gets the segment fraction for this location. + + + + + Tests whether this location refers to a vertex: + returns true if the location is a vertex. + + + + + Supports linear referencing along a linear + using s as the index. + + + + + Constructs an object which allows linear referencing along + a given linear . + + The linear geometry to reference alo + + + + Computes the for the point on the line at the given index. + If the is out of range, + the first or last point on the line will be returned. + + + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point. + The at the given index. + + + + Computes the for the point + on the line at the given index, offset by the given distance. + If the index is out of range the first or last point on the + line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from + the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment + (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the point on the line at the given index, offset by the given distance. + + + If the index is out of range the first or last point on the line will be returned. + The computed point is offset to the left of the line if the offset distance is + positive, to the right if negative. + The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist. + + The index of the desired point + The distance the point is offset from the segment (positive is to the left, negative is to the right) + The Coordinate at the given index + + + + Computes the for the interval + on the line between the given indices. + If the start location is after the end location, + the computed linear geometry has reverse orientation to the input line. + + The index of the start of the interval. + The index of the end of the interval. + The linear interval between the indices. + + + + Computes the index for a given point on the line. + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + A point on the line. + The index of the point. + + + + + Computes the indices for a subline of the line. + (The subline must conform to the line; that is, + all vertices in the subline (except possibly the first and last) + must be vertices of the line and occcur in the same order). + + A subLine of the line. + A pair of indices for the start and end of the subline. + + + + Finds the index for a point on the line which is greater than the given index. + If no such index exists, returns . + + + + This method can be used to determine all indexes for + a point which occurs more than once on a non-simple line. + It can also be used to disambiguate cases where the given point lies + slightly off the line and is equidistant from two different + points on the line. + + + The supplied point does not necessarily have to lie precisely + on the line, but if it is far from the line the accuracy and + performance of this function is not guaranteed. + Use to compute a guaranteed result for points + which may be far from the line. + + + A point on the line + The value the returned index must be greater than + The index of the point greater than the given minimum index + + + + + Computes the index for the closest point on the line to the given point. + If more than one point has the closest distance the first one along the line is returned. + (The point does not necessarily have to lie precisely on the line.) + + A point on the line. + The index of the point. + + + + Tests whether an index is in the valid index range for the line. + + The index to test. + true if the index is in the valid range. + + + + Computes a valid index for this line by clamping + the given index to the valid range of index values. + + + A valid index value. + + + + Returns the index of the start of the line. + + + + + Returns the index of the end of the line. + + + + + Determines the location of a subline along a linear . + The location is reported as a pair of s. + NOTE: Currently this algorithm is not guaranteed to + return the correct substring in some situations where + an endpoint of the test line occurs more than once in the input line. + (However, the common case of a ring is always handled correctly). + + + + + + + + + + + + + Initializes a new instance of the class. + + The linear geom. + + + + + + + + + + + Computes the of the point + on a linear nearest a given . + The nearest point is not necessarily unique; this class + always computes the nearest point closest + to the start of the geometry. + + + + + + + + + + + + + Initializes a new instance of the class. + + A linear geometry. + + + + Find the nearest location along a linear to a given point. + + The coordinate to locate. + The location of the nearest point. + + + + Find the nearest along the linear + to a given after the specified minimum . + If possible the location returned will be strictly greater than the . + If this is not possible, the value returned will equal . + (An example where this is not possible is when = [end of line] ). + + The coordinate to locate. + The minimum location for the point location. + The location of the nearest point. + + + + Implements extended-precision floating-point numbers + which maintain 106 bits (approximately 30 decimal digits) of precision. + + A DoubleDouble uses a representation containing two double-precision values. + A number x is represented as a pair of doubles, x.hi and x.lo, + such that the number represented by x is x.hi + x.lo, where +
+                |x.lo| <= 0.5*ulp(x.hi)
+            
+ and ulp(y) means "unit in the last place of y". + The basic arithmetic operations are implemented using + convenient properties of IEEE-754 floating-point arithmetic. + + The range of values which can be represented is the same as in IEEE-754. + The precision of the representable numbers + is twice as great as IEEE-754 double precision. + + The correctness of the arithmetic algorithms relies on operations + being performed with standard IEEE-754 double precision and rounding. + This is the Java standard arithmetic model, but for performance reasons + Java implementations are not + constrained to using this standard by default. + Some processors (notably the Intel Pentium architecure) perform + floating point operations in (non-IEEE-754-standard) extended-precision. + A JVM implementation may choose to use the non-standard extended-precision + as its default arithmetic mode. + To prevent this from happening, this code uses the + Java strictfp modifier, + which forces all operations to take place in the standard IEEE-754 rounding model. + + The API provides both a set of value-oriented operations + and a set of mutating operations. + Value-oriented operations treat DoubleDouble values as + immutable; operations on them return new objects carrying the result + of the operation. This provides a simple and safe semantics for + writing DoubleDouble expressions. However, there is a performance + penalty for the object allocations required. + The mutable interface updates object values in-place. + It provides optimum memory performance, but requires + care to ensure that aliasing errors are not created + and constant values are not changed. + + This implementation uses algorithms originally designed variously by + Knuth, Kahan, Dekker, and Linnainmaa. + Douglas Priest developed the first C implementation of these techniques. + Other more recent C++ implementation are due to Keith M. Briggs and David Bailey et al. +

References

+ + Priest, D., Algorithms for Arbitrary Precision Floating Point Arithmetic, + in P. Kornerup and D. Matula, Eds., Proc. 10th Symposium on Computer Arithmetic, + IEEE Computer Society Press, Los Alamitos, Calif., 1991. + Yozo Hida, Xiaoye S. Li and David H. Bailey, + Quad-Double Arithmetic: Algorithms, Implementation, and Application, + manuscript, Oct 2000; Lawrence Berkeley National Laboratory Report BNL-46996. + David Bailey, High Precision Software Directory; + http://crd.lbl.gov/~dhbailey/mpdist/index.html + +
+ Martin Davis +
+ + + The value to split a double-precision value on during multiplication + + + + The value nearest to the constant Pi. + + + The value nearest to the constant 2 * Pi. + + + The value nearest to the constant Pi / 2. + + + + The value nearest to the constant e (the natural logarithm base). + + + + + A value representing the result of an operation which does not return a valid number. + + + + + The smallest representable relative difference between two values + + + + + Converts the string argument to a DoubleDouble number. + + A string containing a representation of a numeric value + The extended precision version of the value + Thrown if is not a valid representation of a number + + + Converts the double argument to a DoubleDouble number. + + @param x a numeric value + @return the extended precision version of the value + + + The high-order component of the double-double precision value. + + + The low-order component of the double-double precision value. + + + + Creates a new with value x. + + The initial value + + + + Creates a new with value (hi, lo). + + The high order component + The low order component + + + + Creates a with a value equal to the argument + + The initial value + + + Creates a new DoubleDouble with value equal to the argument. + + @param str the value to initialize by + @throws NumberFormatException if str is not a valid representation of a number + + + + Creates a new with the value of the argument. + + The value to copy + A copy of + + + + Creates and returns a copy of this value. + + Acopy of this value + + + + Returns a whose value is (this + ) + + The addende"/> + (this + ) + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the sum of and . + + The left hand side + The right hand side + The sum of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns the difference of and . + + The left hand side + The right hand side + The difference of and + + + + Returns a whose value is (this + y). + + The addend + (this + y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Computes a new object whose value is (this - y). + + The subtrahend + (this - y) + + + + Returns a whose value is -this. + + -this + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + Returns a new DoubleDouble whose value is (this * y). + + @param y the multiplicand + @return (this * y) + + + ** + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + + Computes a new whose value is (this / y). + + The divisor + A new with the value (this / y) + + + ** + + + Returns a DoubleDouble whose value is 1 / this. + + @return the reciprocal of this value + + + + Computes the minimum of this and another DD number. + + A DD number + The minimum of the two numbers + + + + Computes the maximum of this and another DD number. + + A DD number + The maximum of the two numbers + + + + + + Returns an integer indicating the sign of this value. + + + if this value is > 0, returns 1 + if this value is < 0, returns -1 + if this value is = 0, returns 0 + if this value is NaN, returns 0 + + + + An integer indicating the sign of this value + + + + Rounds this value to the nearest integer. + The value is rounded to an integer by adding 1/2 and taking the floor of the result. + Special cases: + + If this value is NaN, returns NaN. + + + This value rounded to the nearest integer + + + + Returns the integer which is largest in absolute value and not further + from zero than this value. + + Special cases: + + If this value is NaN, returns NaN. + + + + The integer which is largest in absolute value and not further from zero than this value + + + + + Returns the absolute value of this value. + + Special cases: + + if this value is NaN, it is returned. + + + The absolute value of this value + + + + Computes the square of this value. + + The square of this value + + + + Computes the square of this value. + + The square of this value. + + + Computes the positive square root of this value. + If the number is NaN or negative, NaN is returned. + + @return the positive square root of this number. + If the argument is NaN or less than zero, the result is NaN. + + + + Computes the value of this number raised to an integral power. + Follows semantics of .Net Math.Pow as closely as possible. + + The integer exponent + x raised to the integral power exp + + + Converts this value to the nearest double-precision number. + + @return the nearest double-precision number to this value + + + Converts this value to the nearest integer. + + @return the nearest integer to this value + + + + Gets a value indicating whether this object is positive or not + + + + + Gets a value indicating whether this object is positive or not + + + + Tests whether this value is equal to another DoubleDouble value. + + @param y a DoubleDouble value + @return true if this value = y + + + Tests whether this value is greater than another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value > y + + + Tests whether this value is greater than or equals to another DoubleDouble value. + @param y a DoubleDouble value + @return true if this value >= y + + + + Tests whether this value is less than another DoubleDouble value. + + A DoubleDouble value + true if this value is < + + + + Compares two DoubleDouble objects numerically. + + @return -1,0 or 1 depending on whether this value is less than, equal to + or greater than the value of o + + + + Dumps the components of this number to a string. + + A string showing the components of the number + + + + Returns a string representation of this number, in either standard or scientific notation. + If the magnitude of the number is in the range [ 10-3, 108 ] + standard notation will be used. Otherwise, scientific notation will be used. + + A string representation of this number + + + + Returns the string representation of this value in standard notation. + + The string representation in standard notation + + + + Returns the string representation of this value in scientific notation. + + The string representation in scientific notation + + + Extracts the significant digits in the decimal representation of the argument. + A decimal point may be optionally inserted in the string of digits + (as long as its position lies within the extracted digits + - if not, the caller must prepend or append the appropriate zeroes and decimal point). + + @param y the number to extract ( >= 0) + @param decimalPointPos the position in which to insert a decimal point + @return the string containing the significant digits and possibly a decimal point + + + + Returns the string for this value if it has a known representation (e.g. NaN or 0.0). + + The string for this special number
+ or null if the number is not a special number
+
+ + + Determines the decimal magnitude of a number. + The magnitude is the exponent of the greatest power of 10 which is less than + or equal to the number. + + The number to find the magnitude of + The decimal magnitude of + + + + Converts a string representation of a real number into a DoubleDouble value. + The format accepted is similar to the standard Java real number syntax. + It is defined by the following regular expression: +
+            [+|-] {digit} [ . {digit} ] [ ( e | E ) [+|-] {digit}+
+            
+
+ The string to parse + The value of the parsed number + Thrown if str is not a valid representation of a number +
+ + + Gets a value indicating whether this object is zero (0) or not + + + + + Gets a value indicating whether this object is negative or not + + + + + Various utility functions for mathematical and numerical operations. + + + + + Clamps a double value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Clamps a int value to a given range. + + The value to clamp + The minimum value of the range + The maximum value of the range + The clamped value + + + + Computes the base-10 logarithm of a double value. + + + If the argument is NaN or less than zero, then the result is NaN. + If the argument is positive infinity, then the result is positive infinity. + If the argument is positive zero or negative zero, then the result is negative infinity. + + + + A positive number + The value log a, the base-10 logarithm of the input value + + + + + Computes the average of two numbers. + + A number + A number + The average of the inputs + + + + Computes the maximum fo three values + + A number + A number + A number + The maximum value of , and + + + + Computes the maximum of four values + + A number + A number + A number + A number + The maximum value of , , and + + + + Computes the minimum of four values + + A number + A number + A number + The minimum value of , and + + + + Computes the minimum of four values + + A number + A number + A number + A number + The minimum value of , , and + + + + Implements some 2D matrix operations + (in particular, solving systems of linear equations). + + Martin Davis + + + + Solves a system of equations using Gaussian Elimination. + In order to avoid overhead the algorithm runs in-place + on - if should not be modified the client must supply a copy. + + An nxn matrix in row/column order )modified by this method) + A vector of length n + A vector containing the solution (if any)
or null if the system has no or no unique solution +
+ If the matrix has the wrong size +
+ + + Enumeration for the 3 coordinate planes + + + + + Models a plane in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the oriented distance from a point to the plane.
+ The distance is: + + positive if the point lies above the plane (relative to the plane normal) + zero if the point is on the plane + negative if the point lies below the plane (relative to the plane normal) + +
+ The point to compute the distance for + The oriented distance to the plane +
+ + + Computes the axis plane that this plane lies closest to. + + Geometries lying in this plane undergo least distortion + (and have maximum area) + when projected to the closest axis plane. + This provides optimal conditioning for + computing a Point-in-Polygon test. + + The index of the closest axis plane + + + + A 2-dimensional mathematical vector represented by double-precision X and Y components. + + mbdavis + + + + Creates a new vector with given X and Y components. + + The x component + The y component + A new vector + + + + Creates a new vector from an existing one. + + The vector to copy + A new vector + + + + Creates a vector from a . + + The coordinate to copy + A new vector + + + Creates a vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + A new vector + + + The X component of this vector. + + + The Y component of this vector. + + + + Creates an new vector instance + + + + + Creates a new vector instance using the provided and ordinates + + The x-ordinate value + The y-ordinate value + + + + Creates a new vector instance based on . + + The vector + + + Creates a new vector with the direction and magnitude + of the difference between the + and s. + + The origin coordinate + The destination coordinate + + + + Creates a vector from a . + + The coordinate + A new vector + + + + Adds to this vector instance. + + The vector to add + The result vector + + + + Subtracts from this vector instance + + The vector to subtract + The result vector + + + + Multiplies the vector by a scalar value. + + The value to multiply by + A new vector with the value v * d + + + + Divides the vector by a scalar value. + + The value to divide by + A new vector with the value v / d + + + + Negates this vector + + A new vector with [-_x, -_y] + + + + + + + + + + + + + + + + Normalizes the vector + + A new normalized vector + + + + + + + + + + + Computes the weighted sum of this vector + with another vector, + with this vector contributing a fraction + of frac to the total. + + In other words, +
+            sum = frac * this + (1 - frac) * v
+            
+
+ The vector to sum + The fraction of the total contributed by this vector + The weighted sum of the two vectors +
+ + + Computes the distance between this vector and another one. + + A vector + The distance between the vectors + + + + Computes the dot-product of two vectors + + A vector + The dot product of the vectors + + + + Computes the angle this vector describes to the horizontal axis + + The angle + + + + + + + + + + + + + + + + + + Rotates this vector by + + The angle + The rotated vector + + + + Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 + degrees or Pi/2 radians). A positive number rotates counter-clockwise, a + negative number rotates clockwise. Under this operation the magnitude of + the vector and the absolute values of the ordinates do not change, only + their sign and ordinate index. + + The number of quarter-circles to rotate by + The rotated vector. + + + + + + + + + + + Gets a made of this vector translated by . + + The translation coordinate + A coordinate + + + + Gets a from this vector + + A coordinate + + + + Creates a copy of this vector + + A copy of this vector + + + + Gets a string representation of this vector + + A string representing this vector + + + + Tests if a vector has the same values for the x and y components. + + A with which to do the comparison. + true if is a with the same values for the X and Y components. + + + + Gets a hashcode for this vector. + + A hashcode for this vector + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + + Represents a vector in 3-dimensional Cartesian space. + + Martin Davis + + + + Computes the dot product of the 3D vectors AB and CD. + + A coordinate + A coordinate + A coordinate + A coordinate + The dot product + + + + Creates a new vector with given , and components. + + The x component + The y component + The z component + A new vector + + + + Creates a new vector from a . + + The coordinate to copy + A new vector + + + + Computes the 3D dot-product of two s + + The 1st vector + The 2nd vector + The dot product of the (coordinate) vectors + + + + Creates a vector, that is the difference of and + + The origin coordinate + The destination coordinate + + + + Creates a vector with the ordinates , and + + The x-ordinate + The y-ordinate + The z-ordinate + + + + Computes the dot-product of this and + + The 2nd vector + The dot product of the vectors + + + + Function to compute the length of this vector + + The length of this vector + + + + Function to compute the length of vector . + + A coordinate, treated as vector + The length of + + + + Function to compute a normalized form of this vector + + A normalized form of this vector + + + + Function to devide all dimensions of this vector by . + + The divisor + A new (divided) vector + + + + Function to compute a normalized form of vector . + + A coordinate vector + A normalized form of + + + + Gets a value indicating the x-ordinate + + + + + Gets a value indicating the y-ordinate + + + + + Gets a value indicating the z-ordinate + + + + + Functions for performing vector mathematics. + + + + + Computes the normal vector to the triangle p0-p1-p2. In order to compute the normal each + triangle coordinate must have a Z value. If this is not the case, the returned Coordinate + will have NaN values. The returned vector has unit length. + + A point + A point + A point + The normal vector to the triangle -- + + + + Normalizes the vector + + The normalized + + + + Computes the cross product of and + + A vector + A vector + The cross product of and + + + + Computes the dot product of and + + A vector + A vector + The dot product of and + + + + Computes the determinant of a 2x2 matrix + + The m[0,0] value + The m[0,1] value + The m[1,0] value + The m[1,1] value + The determinant + + + + Represents a list of contiguous line segments, + and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + An interface for classes which represent a sequence of contiguous line segments. + SegmentStrings can carry a context object, which is useful + for preserving topological or parentage information. + + + + + Gets/Sets the user-defined data for this segment string. + + + + + Points that make up ISegmentString + + + + + Size of Coordinate Sequence + + + + + States whether ISegmentString is closed + + + + + Creates a new segment string from a list of vertices. + + the vertices of the segment string + the user-defined data of this segment string (may be null) + + + + Gets the octant of the segment starting at vertex index + + the index of the vertex starting the segment. Must not be the last index in the vertex list + octant of the segment at the vertex + + + Gets the user-defined data for this segment string. + + + + + Validates that a collection of s is correctly noded. + Indexing is used to improve performance. + + + + In the most common use case, validation stops after a single + non-noded intersection is detected, + but the class can be requested to detect all intersections + by using the property. + + The validator does not check for a-b-a topology collapse situations. + + The validator does not check for endpoint-interior vertex intersections. + This should not be a problem, since the JTS noders should be + able to compute intersections between vertices correctly. + + + The client may either test the condition, + or request that a suitable be thrown. + + + + + + Creates a new noding validator for a given set of linework. + + A collection of s + + + + Returns an error message indicating the segments containing the intersection. + + an error message documenting the intersection location + + + + Checks for an intersection and throws + a TopologyException if one is found. + + if an intersection is found + + + + Gets or sets whether all intersections should be found. + + + + + Gets a list of all intersections found. + + Intersections are represented as s. + List is empty if none were found. + + + + + + Checks for an intersection and reports if one is found. + + + + + Finds if two sets of s intersect. + + + Uses indexing for fast performance and to optimize repeated tests + against a target set of lines. + Short-circuited to return as soon an intersection is found. + + Immutable and thread-safe. + + + + + Creates an intersection finder against a given set of segment strings. + + The segment strings to search for intersections + + + + Tests for intersections with a given set of target {@link SegmentString}s. + + The SegmentStrings to test + true if an intersection was found + + + + Tests for intersections with a given set of target s. + using a given SegmentIntersectionDetector. + + The SegmentStrings to test + The intersection detector to use + true if the detector reports intersections + + + Gets the segment set intersector used by this class. + This allows other uses of the same underlying indexed structure. + + + + An interface for classes which support adding nodes to a segment string. + + + + Adds an intersection node for a given point and segment to this segment string. + + the location of the intersection + the index of the segment containing the intersection + + + + Computes all intersections between segments in a set of s. + Intersections found are represented as s and added to the + s in which they occur. + As a final step in the noding a new set of segment strings split at the nodes may be returned. + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + + + + + Creates an intersection finder which tests if there is at least one interior intersection. + Uses short-circuiting for efficient performance. + The intersection found is recorded. + + A line intersector. + A intersection finder which tests if there is at least one interior intersection. + + + + Creates an intersection finder which finds all interior intersections. + The intersections are recorded for later inspection. + + A line intersector. + a intersection finder which finds all interior intersections. + + + + Creates an intersection finder which counts all interior intersections. + The intersections are note recorded to reduce memory usage. + + A line intersector. + a intersection finder which counts all interior intersections. + + + + Creates an intersection finder which finds an interior intersection if one exists + + the LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + Tests whether a segment in a is an end segment. + (either the first or last). + + a segment string + the index of a segment in the segment string + true if the segment is an end segment + + + + Gets/Sets whether all intersections should be computed. + + When this is false (the default value), the value of + is true after the first intersection is found. + Default is false. + + + + + + Gets/Sets whether intersection points are recorded. + + If the only need is to count intersection points, this can be set to false. + Default is true. + + + + + + Gets/Sets whether only end segments should be tested for interior intersection. + This is a performance optimization that may be used if + the segments have been previously noded by an appropriate algorithm. + It may be known that any potential noding failures will occur only in + end segments. + + + + + Tests whether an intersection was found. + + + + + Gets the intersections found. + + A list of . + + + + Gets the count of intersections found. + + The intersection count. + + + + Gets the computed location of the intersection. + Due to round-off, the location may not be exact. + + + + + Gets the endpoints of the intersecting segments. + + + + + Computes the possible intersections between two line segments in s + and adds them to each string + using . + + + + + + + + + + + + These variables keep track of what types of intersections were + found during ALL edges that have been intersected. + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + A trivial intersection is an apparent self-intersection which in fact + is simply the point shared by adjacent line segments. + Note that closed edges require a special check for the point shared by the beginning and end segments. + + + + + + + + + + This method is called by clients + of the class to process + intersections for two segments of the being intersected.
+ Note that some clients (such as MonotoneChain") may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Returns the proper intersection point, or null if none was found. + + + + + + + + + + A proper intersection is an intersection which is interior to at least two + line segments. Note that a proper intersection is not necessarily + in the interior of the entire , since another edge may have + an endpoint equal to the intersection, which according to SFS semantics + can result in the point being on the Boundary of the . + + + + + A proper interior intersection is a proper intersection which is not + contained in the set of boundary nodes set for this . + + + + + An interior intersection is an intersection which is + in the interior of some segment. + + + + + Always process all intersections + + + + + Finds interior intersections + between line segments in s, + and adds them as nodes + using . + This class is used primarily for Snap-Rounding. + For general-purpose noding, use . + + + This class is obsolete. + Use instead. + + + + + + + Creates an intersection finder which finds all proper intersections. + + The to use. + + + + This method is called by clients + of the class to process + intersections for two segments of the s being intersected.
+ Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). +
+ + + + +
+ + + + + + + + Always process all intersections + + + + + Nodes a set of s completely. + The set of s is fully noded; + i.e. noding is repeated until no further intersections are detected. + + Iterated noding using a precision model is not guaranteed to converge, + due to roundoff error. This problem is detected and an exception is thrown. + Clients can choose to rerun the noding using a lower precision model. + + + + + + + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Fully nodes a list of s, i.e. peforms noding iteratively + until no intersections are found between segments. + Maintains labelling of edges correctly through the noding. + + A collection of SegmentStrings to be noded. + If the iterated noding fails to converge. + + + + Node the input segment strings once + and create the split edges between the nodes. + + + + + + + Gets/Sets the maximum number of noding iterations performed before + the noding is aborted. Experience suggests that this should rarely need to be changed + from the default. The default is . + + + + + Nodes a set of s using a index based + on s and a . + The used should be something that supports + envelope (range) queries efficiently (such as a Quadtree" + or . + + + + + Base class for s which make a single pass to find intersections. + This allows using a custom + (which for instance may simply identify intersections, rather than insert them). + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Gets/sets the to use with this noder. + A will normally add intersection nodes + to the input segment strings, but it may not - it may + simply record the presence of intersections. + However, some s may require that intersections be added. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + The + + + + + + + + + + + + + Intersects two sets of s using a index based + on s and a . + + Thread-safe and immutable. + + + + + An intersector for the red-blue intersection problem. + In this class of line arrangement problem, + two disjoint sets of linestrings are intersected. + + Implementing classes must provide a way + of supplying the base set of segment strings to + test against (e.g. in the constructor, + for straightforward thread-safety). + + In order to allow optimizing processing, + the following condition is assumed to hold for each set: + + the only intersection between any two linestrings occurs at their endpoints. + + Implementations can take advantage of this fact to optimize processing + (i.e by avoiding testing for intersections between linestrings + belonging to the same set). + + + + + Computes the intersections with a given set of s, + using the supplied . + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of indexed segments. + + + + + + + Gets the index constructed over the base segment strings + + NOTE: To retain thread-safety, treat returned value as immutable + + + + Segment overlap action class + + + + + Creates an instance of this class using the provided + + The segment intersector to use + + + + Validates that a collection of s is correctly noded. + Throws an appropriate exception if an noding error is found. + + + + + Creates a new validator for the given collection + of s. + + The seg strings. + + + + Checks whether the supplied segment strings + are correctly noded. Throws an exception if they are not. + + + + + Checks if a segment string contains a segment pattern a-b-a (which implies a self-intersection). + + + + + Checks all pairs of segments for intersections at an interior point of a segment. + + + + + Checks for intersections between an endpoint of a segment string + and an interior vertex of another segment string + + + + + Octants in the Cartesian plane. + Octants are numbered as follows: + + \2|1/ + 3 \|/ 0 + ---+-- + 4 /|\ 7 + /5|6\ + + If line segments lie along a coordinate axis, the octant is the lower of the two possible values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Methods for computing and working with of the Cartesian plane. + + + + + Returns the octant of a directed line segment (specified as x and y + displacements, which cannot both be 0). + + + + + + + + Returns the octant of a directed line segment from p0 to p1. + + + + + + + + Allows comparing arrays in an orientation-independent way. + + + + + Creates a new } + for the given array. + + + + + + Computes the canonical orientation for a coordinate array. + + + + true if the points are oriented forwards
+ or falseif the points are oriented in reverse. +
+
+ + + Compares two s for their relative order. + + + + -1 this one is smaller;
+ 0 the two objects are equal;
+ 1 this one is greater. +
+
+ + + + + + + + + + + + + Wraps a and transforms its input into the integer domain. + This is intended for use with Snap-Rounding noders, + which typically are only intended to work in the integer domain. + Offsets can be provided to increase the number of digits of available precision. + + Clients should be aware that rescaling can involve loss of precision, + which can cause zero-length line segments to be created. + These in turn can cause problems when used to build a planar graph. + This situation should be checked for and collapsed segments removed if necessary. + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Detects and records an intersection between two s, + if one exists. Only a single intersection is recorded. + + + This strategy can be configured to search for proper intersections. + In this case, the presence of any intersection will still be recorded, + but searching will continue until either a proper intersection has been found + or no intersections are detected. + + + + + Creates an intersection finder using a + + + + + Creates an intersection finder using a given + + The LineIntersector to use + + + + This method is called by clients of the class to process + intersections for two segments of the s being intersected. + + + Note that some clients (such as MonotoneChains) may optimize away + this call for segment pairs which they have determined do not intersect + (e.g. by an disjoint envelope test). + + + + + Gets or sets whether processing must continue until a proper intersection is found + + + + + Gets or sets whether processing can terminate once any intersection is found. + + + + + Tests whether an intersection was found. + + + + + Tests whether a proper intersection was found. + + + + + Tests whether a non-proper intersection was found. + + + + + Gets the computed location of the intersection. Due to round-off, the location may not be exact. + + + + Gets the endpoints of the intersecting segments. + + An array of the segment endpoints (p00, p01, p10, p11) + + + + Tests whether processing can terminate, + because all required information has been obtained + (e.g. an intersection of the desired type has been detected). + + + + + Represents an intersection point between two s. + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + -1 this SegmentNode is located before the argument location;
+ 0 this SegmentNode is at the argument location;
+ 1 this SegmentNode is located after the argument location. +
+
+ + + + + + + + + Gets the giving the location of this node. + + + + + + + + + + + A list of the s present along a noded . + + + + + Initializes a new instance of the class. + + The edge. + + + + Adds an intersection into the list, if it isn't already there. + The input segmentIndex and dist are expected to be normalized. + + + + The SegmentIntersection found or added. + + + + Returns an iterator of SegmentNodes. + + An iterator of SegmentNodes. + + + + Adds nodes for the first and last points of the edge. + + + + + Adds nodes for any collapsed edge pairs. + Collapsed edge pairs can be caused by inserted nodes, or they can be + pre-existing in the edge vertex list. + In order to provide the correct fully noded semantics, + the vertex at the base of a collapsed pair must also be added as a node. + + + + + Adds nodes for any collapsed edge pairs + which are pre-existing in the vertex list. + + + + + + Adds nodes for any collapsed edge pairs caused by inserted nodes + Collapsed edge pairs occur when the same coordinate is inserted as a node + both before and after an existing edge vertex. + To provide the correct fully noded semantics, + the vertex must be added as a node as well. + + + + + + + + + + + + + + + Creates new edges for all the edges that the intersections in this + list split the parent edge into. + Adds the edges to the provided argument list + (this is so a single list can be used to accumulate all split edges + for a set of s). + + + + + + Create a new "split edge" with the section of points between + (and including) the two intersections. + The label for the new edge is the same as the label for the parent edge. + + + + + + + Gets the list of coordinates for the fully noded segment string, + including all original segment string vertices and vertices + introduced by nodes in this list. + Repeated coordinates are collapsed. + + An array of s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Not implemented. + + This method is not implemented. + + + + + + + + + + + + + + + + + + + + Implements a robust method of comparing the relative position of two points along the same segment. + The coordinates are assumed to lie "near" the segment. + This means that this algorithm will only return correct results + if the input coordinates have the same precision and correspond to rounded values + of exact coordinates lying on the segment. + + + + + Compares two s for their relative position along a segment + lying in the specified . + + + + + + -1 if node0 occurs first, or
+ 0 if the two nodes are equal, or
+ 1 if node1 occurs first. +
+
+ + + + + + + + + + + + + + + + + + + Represents a list of contiguous line segments, and supports noding the segments. + The line segments are represented by an array of s. + Intended to optimize the noding of contiguous segments by + reducing the number of allocated objects. + s can carry a context object, which is useful + for preserving topological or parentage information. + All noded substrings are initialized with the same context object. + + + + + Gets the s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A collection of NodedSegmentStrings representing the substrings + + + + Adds the noded s which result from splitting this string at node points. + + A collection of NodedSegmentStrings + A list which will collect the NodedSegmentStrings representing the substrings + + + + Creates a new segment string from a list of vertices. + + The vertices of the segment string. + The user-defined data of this segment string (may be null). + + + + + + + + + + + Gets the octant of the segment starting at vertex index. + + + The index of the vertex starting the segment. + Must not be the last index in the vertex list + + The octant of the segment at the vertex + + + + Adds EdgeIntersections for one or both + intersections found for a segment of an edge to the edge intersection list. + + + + + + + + Add an for intersection intIndex. + An intersection that falls exactly on a vertex + of the is normalized + to use the higher of the two possible segmentIndexes. + + + + + + + + + + + + + + + + Gets/Sets the user-defined data for this segment string. + + + + + + + + + + + + + + + + + + + + + + + + + + Dissolves a noded collection of s to produce + a set of merged linework with unique segments. + + + A custom merging strategy + can be supplied. + This strategy will be called when two identical (up to orientation) + strings are dissolved together. + The default merging strategy is simply to discard one of the merged strings. + + A common use for this class is to merge noded edges + while preserving topological labelling. + This requires a custom merging strategy to be supplied + to merge the topology labels appropriately. + + + + + + Creates a dissolver with a user-defined merge strategy. + + + + + + Creates a dissolver with the default merging strategy. + + + + + Dissolve all s in the input . + + + + + + + + + + + + + Dissolve the given . + + + + + + + + + Gets the collection of dissolved (i.e. unique) s + + + + + A merging strategy which can be used to update the context data of s + which are merged during the dissolve process. + + mbdavis + + + + Updates the context data of a + when an identical (up to orientation) one is found during dissolving. + + The segment string to update. + The segment string being dissolved. + + true if the strings are in the same direction, + false if they are opposite. + + + + + Utility methods for processing s + + Martin Davis + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Extracts all linear components from a given + to s. + The data item is set to be the source . + + The to extract from. + a list of s. + + + + Converts a collection of s into a . + The geometry will be either a + or a (possibly empty). + + A collection of . + A geometry factory + A or a . + + + + Nodes a set of s by + performing a brute-force comparison of every segment to every other one. + This has n^2 performance, so is too slow for use on large numbers of segments. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Intersects two sets of s using + brute-force comparison. + + + + + Constructs a new intersector for a given set of s. + + The base segment strings to intersect + + + + Calls + for all candidate intersections between + the given collection of SegmentStrings and the set of base segments. + + A collection of s to node + The intersection detector to either record intersection occurences + or add intersection nodes to the input segment strings. + + + + Processes all of the segment pairs in the given segment strings + using the given SegmentIntersector. + + A segment string + A segment string + The segment intersector to use + + + + Nodes the linework in a list of s using Snap-Rounding + to a given . + + The input coordinates are expected to be rounded + to the given precision model. + This class does not perform that function. + GeometryPrecisionReducer" may be used to do this. + + This class does not dissolve the output linework, + so there may be duplicate linestrings in the output. + Subsequent processing (e.g. polygonization) may require + the linework to be unique. Using UnaryUnion is one way + to do this (although this is an inefficient approach). + + + + + Creates a new noder which snap-rounds to a grid specified by the given + + The precision model for the grid to snap-round to. + + + + Nodes the linework of a set of Geometrys using SnapRounding. + + A collection of Geometrys of any type + A list of LineStrings representing the noded linework of the input + + + + Gets or sets whether noding validity is checked after noding is performed. + + + + + Implements a "hot pixel" as used in the Snap Rounding algorithm. + A hot pixel contains the interior of the tolerance square and the boundary + minus the top and right segments. + The hot pixel operations are all computed in the integer domain + to avoid rounding problems. + + + + + Initializes a new instance of the class. + + The coordinate at the center of the hot pixel + The scale factor determining the pixel size + THe intersector to use for testing intersection with line segments + + + + Returns a "safe" envelope that is guaranteed to contain the hot pixel. + The envelope returned will be larger than the exact envelope of the pixel. + + An envelope which contains the pixel + + + + + + + + + + + + + + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + The first coordinate of the line segment to test + The second coordinate of the line segment to test + true if the line segment intersects this hot pixel. + + + + Tests whether the line segment (p0-p1) + intersects this hot pixel. + + + + + + + + + + + + + + + Tests whether the segment p0-p1 intersects the hot pixel tolerance square. + Because the tolerance square point set is partially open (along the + top and right) the test needs to be more sophisticated than + simply checking for any intersection. + However, it can take advantage of the fact that the hot pixel edges + do not lie on the coordinate grid. + It is sufficient to check if any of the following occur: + - a proper intersection between the segment and any hot pixel edge. + - an intersection between the segment and BOTH the left and bottom hot pixel edges + (which detects the case where the segment intersects the bottom left hot pixel corner). + - an intersection between a segment endpoint and the hot pixel coordinate. + + + + + + + + Test whether the given segment intersects + the closure of this hot pixel. + This is NOT the test used in the standard snap-rounding + algorithm, which uses the partially closed tolerance square instead. + This routine is provided for testing purposes only. + + + + + + + + Adds a new node (equal to the snap pt) to the specified segment + if the segment passes through the hot pixel + + + + true if a node was added to the segment + + + + Gets the coordinate this hot pixel is based at. + + + + + "Snaps" all s in a containing + s to a given . + + + + + Initializes a new instance of the class. + + + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + The edge containing the vertex, if applicable, or null. + + true if a node was added for this pixel. + + + + Snaps (nodes) all interacting segments to this hot pixel. + The hot pixel may represent a vertex of an edge, + in which case this routine uses the optimization + of not noding the vertex itself + + The hot pixel to snap to. + true if a node was added for this pixel. + + + + + + + + + + + + + + + + + + + + + + + + + + Initializes a new instance of the class. + + + + + + + + + + + + + + + + + + + + Uses Snap Rounding to compute a rounded, + fully noded arrangement from a set of s. + Implements the Snap Rounding technique described in + papers by Hobby, Guibas and Marimont, and Goodrich et al. + Snap Rounding assumes that all vertices lie on a uniform grid; + hence the precision model of the input must be fixed precision, + and all the input vertices must be rounded to that precision. + + This implementation uses a monotone chains and a spatial index to + speed up the intersection tests. + This implementation appears to be fully robust using an integer precision model. + It will function with non-integer precision models, but the + results are not 100% guaranteed to be correctly noded. + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + + Does NOT node the segStrings. + + + + A list of Coordinates for the intersections. + + + + Snaps segments to nodes created by segment intersections. + + + + + + Snaps segments to all vertices + + The list of segment strings to snap together + + + + Snaps segments to the vertices of a Segment String. + + + + + + + Initializes a new instance of the class. + + The to use. + + + + Returns a of fully noded s. + The s have the same context as their parent. + + A Collection of NodedSegmentStrings representing the substrings + + + + Computes the noding for a collection of s. + Some Noders may add all these nodes to the input s; + others may only add some or none at all. + + A collection of NodedSegmentStrings + + + + + + + + + + + Computes all interior intersections in the collection of s, + and returns their s. + Does NOT node the segStrings. + + + + A list of s for the intersections. + + + + Computes nodes introduced as a result of snapping segments to snap points (hot pixels). + + + + + + + + + + + + + + Computes nodes introduced as a result of + snapping segments to vertices of other segments. + + The list of segment strings to snap together + + + + Performs a brute-force comparison of every segment in each . + This has n^2 performance. + + + + + + + A geometry service provider class + + + + + Creates an instance of this class, using the as default and a precision model. No is specified + + + + + Creates an instance of this class, using the provided , and spatial reference Id (. + + The coordinate sequence factory to use. + The precision model. + The default spatial reference ID + + + + Creates a precision model based on given precision model type + + The precision model type + + + + Creates a precision model based on given precision model. + + The precision model + + + + Creates a precision model based on the given scale factor. + + The scale factor + The precision model. + + + + Gets or sets the current instance + + + + + Gets the default spatial reference id + + + + + Gets or sets the coordiate sequence factory to use + + + + + Gets or sets the default precision model + + + + + Gets a value representing the number of geometry factories that have been stored in the cache + + + + + Computes the boundary of a . + Allows specifying the to be used. + This operation will always return a of the appropriate + dimension for the boundary (even if the input geometry is empty). + The boundary of zero-dimensional geometries (Points) is + always the empty . + + Martin Davis + + + + A map which maintains the edges in sorted order around the node. + + + + + Stores an integer count, for use as a Map entry. + + Martin Davis + + + + Builds the buffer geometry for a given input geometry and precision model. + Allows setting the level of approximation for circular arcs, + and the precision model in which to carry out the computation. + + + When computing buffers in floating point double-precision + it can happen that the process of iterated noding can fail to converge (terminate). + In this case a will be thrown. + Retrying the computation in a fixed precision + can produce more robust results. + + + + Compute the change in depth as an edge is crossed from R to L + + + Creates a new BufferBuilder + + + + Inserted edges are checked to see if an identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + + + + Completes the building of the input subgraphs by depth-labelling them, + and adds them to the PolygonBuilder. + + + The subgraph list must be sorted in rightmost-coordinate order. + + the subgraphs to build + the PolygonBuilder which will build the final polygons + + + + Gets the standard result for an empty buffer. + Since buffer always returns a polygonal result, this is chosen to be an empty polygon. + + The empty result geometry + + + + Sets the precision model to use during the curve computation and noding, + if it is different to the precision model of the Geometry. + + + If the precision model is less than the precision of the Geometry precision model, + the Geometry must have previously been rounded to that precision. + + + + + Sets the to use during noding. + This allows choosing fast but non-robust noding, or slower + but robust noding. + + + + + Simplifies a buffer input line to remove concavities with shallow depth. + + + + The most important benefit of doing this + is to reduce the number of points and the complexity of + shape which will be buffered. + It also reduces the risk of gores created by + the quantized fillet arcs (although this issue + should be eliminated in any case by the + offset curve generation logic). + + + A key aspect of the simplification is that it + affects inside (concave or inward) corners only. + Convex (outward) corners are preserved, since they + are required to ensure that the generated buffer curve + lies at the correct distance from the input geometry. + + + Another important heuristic used is that the end segments + of the input are never simplified. This ensures that + the client buffer code is able to generate end caps faithfully. + + + No attempt is made to avoid self-intersections in the output. + This is acceptable for use for generating a buffer offset curve, + since the buffer algorithm is insensitive to invalid polygonal + geometry. However, + this means that this algorithm + cannot be used as a general-purpose polygon simplification technique. + + + Martin Davis + + + + Simplify the input coordinate list. + If the distance tolerance is positive, + concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, + concavities on the RIGHT side of the line are simplified. + + The coordinate list to simplify + simplification distance tolerance to use + The simplified coordinate list + + + + Simplify the input coordinate list. + + + If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. + If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified. + + Simplification distance tolerance to use + + The simplified coordinates list + + + + + Uses a sliding window containing 3 vertices to detect shallow angles + in which the middle vertex can be deleted, since it does not + affect the shape of the resulting buffer in a significant way. + + + + + + Finds the next non-deleted index, or the end of the point array if none + + The start index to search from + The next non-deleted index, if any
+ or _inputLine.Length if there are no more non-deleted indices +
+
+ + + Checks for shallowness over a sample of points in the given section. + This helps to prevent the siplification from incrementally + "skipping" over points which are in fact non-shallow. + + A coordinate of section + A coordinate of section + The start index of section + The end index of section + The tolerated distance + + + + Computes the buffer of a geometry, for both positive and negative buffer distances. + + + + In GIS, the positive (or negative) buffer of a geometry is defined as + the Minkowski sum (or difference) of the geometry + with a circle of radius equal to the absolute value of the buffer distance. + In the CAD/CAM world buffers are known as offset curves. + In morphological analysis the + operation of positive and negative buffering + is referred to as erosion and dilation + + + The buffer operation always returns a polygonal result. + The negative or zero-distance buffer of lines and points is always an empty . + + + Since true buffer curves may contain circular arcs, + computed buffer polygons are only approximations to the true geometry. + The user can control the accuracy of the approximation by specifying + the number of linear segments used to approximate arcs. + This is specified via + or . + + + The of a linear buffer may be specified. + The following end cap styles are supported: +
    +
  • - the usual round end caps
  • +
  • - end caps are truncated flat at the line ends
  • +
  • - end caps are squared off at the buffer distance beyond the line ends
  • +
+
+ + The of the corners in a buffer may be specified. + The following join styles are supported: +
    +
  • - the usual round join
  • +
  • - corners are "sharp" (up to a distance limit})
  • +
  • - corners are beveled (clipped off)
  • +
+
+ + The buffer algorithm can perform simplification on the input to increase performance. + The simplification is performed a way that always increases the buffer area + (so that the simplified input covers the original input). + The degree of simplification can be specified with , + with a used otherwise. + Note that if the buffer distance is zero then so is the computed simplify tolerance, + no matter what the simplify factor. + +
+
+ + + A number of digits of precision which leaves some computational "headroom" + for floating point operations. + + + This value should be less than the decimal precision of double-precision values (16). + + + + + Compute a scale factor to limit the precision of + a given combination of Geometry and buffer distance. + The scale factor is determined by + the number of digits of precision in the (geometry + buffer distance), + limited by the supplied value. + + The scale factor is based on the absolute magnitude of the (geometry + buffer distance). + since this determines the number of digits of precision which must be handled. + + the Geometry being buffered + the buffer distance + the max # of digits that should be allowed by + the precision determined by the computed scale factor + + a scale factor for the buffer computation + + + + Computes the buffer of a geometry for a given buffer distance. + + the geometry to buffer + the buffer distance + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the buffer parameters to use + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the buffer of the input geometry + + + + Comutes the buffer for a geometry for a given buffer distance + and accuracy of approximation. + + the geometry to buffer + the buffer distance + the number of segments used to approximate a quarter circle + the end cap style to use + the buffer of the input geometry + + + + Initializes a buffer computation for the given geometry + + the geometry to buffer + + + + Initializes a buffer computation for the given geometry + with the given set of parameters + + the geometry to buffer + the buffer parameters to use + + + + Returns the buffer computed for a geometry for a given buffer distance. + + the buffer distance + the buffer of the input geometry + + + + Specifies the end cap style of the generated buffer. + The styles supported are , , and . + The default is . + + + + + Sets the number of segments used to approximate a angle fillet + + + + + A value class containing the parameters which + specify how a buffer should be constructed. + + The parameters allow control over: + + Quadrant segments (accuracy of approximation for circular arcs) + End Cap style + Join style + Mitre limit + whether the buffer is single-sided + + + + Martin Davis + + + + The default number of facets into which to divide a fillet of 90 degrees. + A value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + + + + + The default mitre limit + Allows fairly pointy mitres. + + + + + The default simplify factor. + Provides an accuracy of about 1%, which matches + the accuracy of the parameter. + + + + + Creates a default set of parameters + + + + + Creates a set of parameters with the given quadrantSegments value. + + The number of quadrant segments to use + + + + Creates a set of parameters with the + given quadrantSegments and endCapStyle values. + + the number of quadrant segments to use + the end cap style to use + + + + Creates a set of parameters with the + given parameter values. + + the number of quadrant segments to use + the end cap style to use + the join style to use + the mitre limit to use + + + + Computes the maximum distance error due to a given level of approximation to a true arc. + + The number of segments used to approximate a quarter-circle + The error of approximation + + + + Gets/sets the number of quadrant segments which will be used + + + QuadrantSegments is the number of line segments used to approximate an angle fillet. + + QuadrantSegments >>= 1joins are round, and QuadrantSegments indicates the number of segments to use to approximate a quarter-circle. + QuadrantSegments = 0joins are beveled + QuadrantSegments < 0joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |QuadrantSegments| + + For round joins, QuadrantSegments determines the maximum + error in the approximation to the true buffer curve. + The default value of 8 gives less than 2% max error in the buffer distance. + For a max error of < 1%, use QS = 12. + For a max error of < 0.1%, use QS = 18. + The error is always less than the buffer distance + (in other words, the computed buffer curve is always inside the true + curve). + + + + + Gets/Sets the end cap style of the generated buffer. + + + + The styles supported are , + , and + . + + The default is . + + + + + Gets/Sets the join style for outside (reflex) corners between line segments. + + + Allowable values are (which is the default), + and + + + + + Sets the limit on the mitre ratio used for very sharp corners. + + + + The mitre ratio is the ratio of the distance from the corner + to the end of the mitred offset corner. + When two line segments meet at a sharp angle, + a miter join will extend far beyond the original geometry. + (and in the extreme case will be infinitely far.) + To prevent unreasonable geometry, the mitre limit + allows controlling the maximum length of the join corner. + Corners with a ratio which exceed the limit will be beveled. + + + + + + Gets or sets whether the computed buffer should be single-sided. + A single-sided buffer is constructed on only one side of each input line. + + The side used is determined by the sign of the buffer distance: + + a positive distance indicates the left-hand side + a negative distance indicates the right-hand side + + The single-sided buffer of point geometries is the same as the regular buffer. + + The End Cap Style for single-sided buffers is always ignored, + and forced to the equivalent of . + + + + + + Factor used to determine the simplify distance tolerance + for input simplification. + Simplifying can increase the performance of computing buffers. + Generally the simplify factor should be greater than 0. + Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. + Larger values sacrifice accuracy in return for performance. + + + + + A connected subset of the graph of + DirectedEdges and Nodes. + Its edges will generate either + a single polygon in the complete buffer, with zero or more holes, or + one or more connected holes. + + + + + + + + + + Creates the subgraph consisting of all edges reachable from this node. + Finds the edges in the graph and the rightmost coordinate. + + A node to start the graph traversal from. + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + A node known to be in the subgraph. + + + + Adds the argument node and all its out edges to the subgraph + + The node to add. + The current set of nodes being traversed. + + + + + + + + + + + + + + + Compute depths for all dirEdges via breadth-first traversal of nodes in graph. + + Edge to start processing with. + + + + + + + + + + + + + + + + Find all edges whose depths indicates that they are in the result area(s). + Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + BufferSubgraphs are compared on the x-value of their rightmost Coordinate. + This defines a partial ordering on the graphs such that: + g1 >= g2 - Ring(g2) does not contain Ring(g1) + where Polygon(g) is the buffer polygon that is built from g. + This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to + be built before holes. + + + + + + + + + + + + + + + Gets the rightmost coordinate in the edges of the subgraph. + + + + + Computes the raw offset curve for a + single component (ring, line or point). + A raw offset curve line is not noded - + it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded + to a given . + + + + + This method handles single points as well as LineStrings. + LineStrings are assumed not to be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + The vertices of the line to offset + The offset distance + A Coordinate array representing the curve
+ or null if the curve is empty +
+
+ + + This method handles the degenerate cases of single points and lines, + as well as rings. + + A Coordinate array representing the curve
+ or null if the curve is empty
+
+ + + Computes the distance tolerance to use during input + line simplification. + + The buffer distance + The simplification tolerance + + + + Gets the buffer parameters being used to generate the curve. + + + + + Creates all the raw offset curves for a buffer of a Geometry. + Raw curves need to be noded together and polygonized to form the final buffer area. + + + + + + + + + + + + + Computes the set of raw offset curves for the buffer. + Each offset curve has an attached {Label} indicating + its left and right location. + + A Collection of SegmentStrings representing the raw buffer curves. + + + + Creates a {SegmentString} for a coordinate list which is a raw offset curve, + and adds it to the list of buffer curves. + The SegmentString is tagged with a Label giving the topology of the curve. + The curve may be oriented in either direction. + If the curve is oriented CW, the locations will be: + Left: Location.Exterior. + Right: Location.Interior. + + + + + + + + + + + + + + + + + Add a Point to the graph. + + + + + + + + + + + + + + + + + + Adds an offset curve for a polygon ring. + The side and left and right topological location arguments + assume that the ring is oriented CW. + If the ring is in the opposite orientation, + the left and right locations must be interchanged and the side flipped. + + The coordinates of the ring (must not contain repeated points). + The distance at which to create the buffer. + The side of the ring on which to construct the buffer line. + The location on the L side of the ring (if it is CW). + The location on the R side of the ring (if it is CW). + + + + The ringCoord is assumed to contain no repeated points. + It may be degenerate (i.e. contain only 1, 2, or 3 points). + In this case it has no area, and hence has a minimum diameter of 0. + + + + + + + + Tests whether a triangular ring would be eroded completely by the given + buffer distance. + This is a precise test. It uses the fact that the inner buffer of a + triangle converges on the inCentre of the triangle (the point + equidistant from all sides). If the buffer distance is greater than the + distance of the inCentre from a side, the triangle will be eroded completely. + This test is important, since it removes a problematic case where + the buffer distance is slightly larger than the inCentre distance. + In this case the triangle buffer curve "inverts" with incorrect topology, + producing an incorrect hole in the buffer. + + + + + + + + A list of the vertices in a constructed offset curve. + + Automatically removes close adjacent vertices. + Martin Davis + + + + Function to add a point + + + The point is only added if evaluates to false. + + The point to add. + + + + Tests whether the given point duplicates the previous point in the list (up to tolerance) + + The point to test + true if the point duplicates the previous point + + + + Automatically closes the ring (if it not alread is). + + + + + Gets/Sets the precision model to use when adding new points. + + + + + The distance below which two adjacent points on the curve are considered to be coincident. + + This is chosen to be a small fraction of the offset distance. + + + + Gets the Coordinates for the curve. + + + + + Generates segments which form an offset curve. + Supports all end cap and join options + provided for buffering. + This algorithm implements various heuristics to + produce smoother, simpler curves which are + still within a reasonable tolerance of the + true curve. + + Martin Davis + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + The Closing Segment Length Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + Add last offset point + + + + + Adds the offset points for an outside (convex) turn + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point , terminating a line segment coming from + + + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments + around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. + Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc + between two specified angles. + The start and end point for the fillet are not added - + the caller must add them if required. + + Is -1 for a angle, 1 for a angle + The radius of the fillet + + + + Creates a circle around a point + + + + + Creates a square around a point + + + + + Gets whether the input has a narrow concave angle + (relative to the offset distance). + In this case the generated offset curve will contain self-intersections + and heuristic closing segments. + This is expected behaviour in the case of buffer curves. + For pure offset curves, + the output needs to be further treated + before it can be used. + + + + + A dynamic list of the vertices in a constructed offset curve. + Automatically removes adjacent vertices + which are closer than a given tolerance. + + Martin Davis + + + The distance below which two adjacent points on the curve + are considered to be coincident. + This is chosen to be a small fraction of the offset distance. + + + + Tests whether the given point is redundant + relative to the previous + point in the list (up to tolerance). + + + true if the point is redundant + + + + Computes the raw offset curve for a single component (ring, line or point). + + + A raw offset curve line is not noded - it may contain self-intersections (and usually will). + The final buffer polygon is computed by forming a topological graph + of all the noded raw curves and tracing outside contours. + The points in the raw curve are rounded to the required precision model. + + + + Factor which controls how close curve vertices can be to be snapped + + + Factor which controls how close offset segments can be to + skip adding a filler or mitre. + + + Factor which controls how close curve vertices on inside turns can be to be snapped + + + Factor which determines how short closing segs can be for round buffers + + + Use a value which results in a potential distance error which is + significantly less than the error due to + the quadrant segment discretization. + For QS = 8 a value of 100 is reasonable. + This should produce a maximum of 1% distance error. + + + The angle quantum with which to approximate a fillet curve + (based on the input # of quadrant segments) + + + the max error of approximation (distance) between a quad segment and the true fillet curve + + + The Closing Segment Factor controls how long + "closing segments" are. Closing segments are added + at the middle of inside corners to ensure a smoother + boundary for the buffer offset curve. + In some cases (particularly for round joins with default-or-better + quantization) the closing segments can be made quite short. + This substantially improves performance (due to fewer intersections being created). + + A closingSegFactor of 0 results in lines to the corner vertex + A closingSegFactor of 1 results in lines halfway to the corner vertex + A closingSegFactor of 80 results in lines 1/81 of the way to the corner vertex + (this option is reasonable for the very common default situation of round joins + and quadrantSegs >= 8) + + + + + This method handles single points as well as lines. + Lines are assumed to not be closed (the function will not + fail for closed lines, but will generate superfluous line caps). + + a List of Coordinate[] + + + + This method handles the degenerate cases of single points and lines, as well as rings. + + a List of Coordinate[] + + + Computes the distance tolerance to use during input + line simplification. + + @param distance the buffer distance + @return the simplification tolerance + + + + Adds the offset points for an outside (convex) turn + + + + + + + + Adds the offset points for an inside (concave) turn. + + + + + + + Add last offset point + + + + + Compute an offset segment for an input segment on a given side and at a given distance. + The offset points are computed in full double precision, for accuracy. + + The segment to offset + The side of the segment () the offset lies on + The offset distance + The points computed for the offset segment + + + + Add an end cap around point p1, terminating a line segment coming from p0 + + + + + Adds a mitre join connecting the two reflex offset segments. + The mitre will be beveled if it exceeds the mitre ratio limit. + + The base point + The first offset segment + The second offset segment + The offset distance + + + + Adds a limited mitre join connecting the two reflex offset segments. + + + A limited mitre is a mitre which is beveled at the distance + determined by the mitre ratio limit. + + The first offset segment + The second offset segment + The offset distance + The mitre limit ratio + + + + Adds a bevel join connecting the two offset segments around a reflex corner. + + The first offset segment + The second offset segment + + + + Add points for a circular fillet around a reflex corner. Adds the start and end points + + Base point of curve + Start point of fillet curve + Endpoint of fillet curve + The orientation of the fillet + The radius of the fillet + + + + Adds points for a circular fillet arc between two specified angles. + + + The start and end point for the fillet are not added - the caller must add them if required. + + The point around which to add the fillet points + The start angle (in radians) + The end angle (in radians) + Is -1 for a CW angle, 1 for a CCW angle + The radius of the fillet + + + + Adds a CW circle around a point + + + + + Adds a CW square around a point + + + + + A RightmostEdgeFinder find the DirectedEdge in a list which has the highest coordinate, + and which is oriented L to R at that point. (I.e. the right side is on the RHS of the edge.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Locates a subgraph inside a set of subgraphs, + in order to determine the outside depth of the subgraph. + The input subgraphs are assumed to have had depths + already calculated for their edges. + + + + + + + + + + + + + + + + + + Finds all non-horizontal segments intersecting the stabbing line. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + A List of {DepthSegments} intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the list of dirEdges. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + Finds all non-horizontal segments intersecting the stabbing line + in the input dirEdge. + The stabbing line is the ray to the right of stabbingRayLeftPt. + + The left-hand origin of the stabbing line. + + The current list of DepthSegments intersecting the stabbing line. + + + + A segment from a directed edge which has been assigned a depth value + for its sides. + + + + + + + + + + + + Defines a comparison operation on DepthSegments + which orders them left to right. + Assumes the segments are normalized. + + The definition of ordering is: + + -1 : if DS1.seg is left of or below DS2.seg (DS1 < DS2). + 1 : if DS1.seg is right of or above DS2.seg (DS1 > DS2). + 0 : if the segments are identical + + + + Known Bugs: + + The logic does not obey the contract. + This is acceptable for the intended usage, but may cause problems if used with some + utilities in the .Net standard library (e.g. . + + + A DepthSegment + The comparison value + + + + Compare two collinear segments for left-most ordering. + If segs are vertical, use vertical ordering for comparison. + If segs are equal, return 0. + Segments are assumed to be directed so that the second coordinate is >= to the first + (e.g. up and to the right). + + A segment to compare. + A segment to compare. + + + + + + + + + + Finds the approximate maximum distance from a buffer curve to + the originating geometry. + + The approximate maximum distance is determined by testing + all vertices in the buffer curve, as well + as midpoints of the curve segments. + Due to the way buffer curves are constructed, this + should be a very close approximation. + This is similar to the Discrete Oriented Hausdorff distance + from the buffer curve to the input. + + mbdavis + + + + Validates that a given buffer curve lies an appropriate distance + from the input generating it. + + + Useful only for round buffers (cap and join). + Can be used for either positive or negative distances. + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + mbdavis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + + Checks that two geometries are at least a minumum distance apart. + + A geometry + A geometry + The minimum distance the geometries should be separated by + + + + Checks that the furthest distance from the buffer curve to the input + is less than the given maximum distance. + + + This uses the Oriented Hausdorff distance metric. It corresponds to finding + the point on the buffer curve which is furthest from some point on the input. + + A geometry + A geometry + The maximum distance that a buffer result can be from the input + + + + Gets a geometry which indicates the location and nature of a validation failure. + + The indicator is a line segment showing the location and size + of the distance discrepancy. + + + A geometric error indicator + or null, if no error was found + + + + Validates that the result of a buffer operation + is geometrically correct, within a computed tolerance. + + + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + This test may be (much) more expensive than the original buffer computation. + + Martin Davis + + + Maximum allowable fraction of buffer distance the + actual distance can differ by. + 1% sometimes causes an error - 1.2% should be safe. + + + Checks whether the geometry buffer is valid, and returns an error message if not. + + + + + An appropriate error message
+ or nullif the buffer is valid
+ +
+ + + Gets the error message + + + + + Gets the error location + + + + + Gets a geometry which indicates the location and nature of a validation failure. + + If the failure is due to the buffer curve being too far or too close + to the input, the indicator is a line segment showing the location and size + of the discrepancy. + + + A geometric error indicator
+ or null, if no error was found
+
+ + + Computes the Euclidean distance (L2 metric) from a Point to a Geometry. + Also computes two points which are separated by the distance. + + + + + Contains a pair of points and the distance between them. + Provides methods to update with a new point pair with + either maximum or minimum distance. + + + + + Initializes the points, avoiding recomputing the distance. + + The first point + The second point + The distance between and + + + + A wrapper which + projects 3D coordinates into one of the + three Cartesian axis planes, + using the standard orthonormal projection + (i.e. simply selecting the appropriate ordinates into the XY ordinates). + The projected data is represented as 2D coordinates. + + Martin Davis + + + + Creates a wrapper projecting to the XY plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the XZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Creates a wrapper projecting to the YZ plane. + + The sequence to be projected + A sequence which projects coordinates + + + + Find two points on two 3D s which lie within a given distance, + or else are the nearest points on the geometries (in which case this also + provides the distance between the geometries). + + 3D geometries have vertex Z ordinates defined. + 3D s are assumed to lie in a single plane (which is enforced if not actually the case). + 3D s and s may have any configuration. + + The distance computation also finds a pair of points in the input geometries + which have the minimum distance between them. If a point lies in the interior + of a line segment, the coordinate computed is a close approximation to the + exact point. + + The algorithms used are straightforward O(n^2) comparisons. This worst-case + performance could be improved on by using Voronoi techniques or spatial + indexes. + + 1.13 + + + + Compute the distance between the nearest points of two geometries. + + A geometry + A geometry + The distance between the geometries + + + + Test whether two geometries lie within a given distance of each other. + + A geometry + A geometry + The distance to test + true if g0.distance(g1) <= + + + + Compute the the nearest points of two geometries. The points are + presented in the same order as the input Geometries. + + A geometry + A geometry + The nearest points in the geometries + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + + + + Constructs a DistanceOp that computes the distance and nearest points + between the two specified geometries. + + A geometry + A geometry + The distance on which to terminate the search + + + + Report the distance between the nearest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty
+ Thrown if either input geometry is null. +
+ + + Report the coordinates of the nearest points in the input geometries. The + points are presented in the same order as the input Geometries. + + A pair of s of the nearest points + + + + Gets the locations of the nearest points in the input geometries. The + locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points + + + + Finds the index of the "most polygonal" input geometry. + This optimizes the computation of the best-fit plane, + since it is cached only for the left-hand geometry. + + The index of the most polygonal geometry + + + + Convenience method to create a Plane3DPolygon + + + + + Computes distance between two polygons. + + + To compute the distance, compute the distance + between the rings of one polygon and the other polygon, + and vice-versa. + If the polygons intersect, then at least one ring must + intersect the other polygon. + Note that it is NOT sufficient to test only the shell rings. + A counter-example is a "figure-8" polygon A + and a simple polygon B at right angles to A, with the ring of B + passing through the holes of A. + The polygons intersect, + but A's shell does not intersect B, and B's shell does not intersect A. + + + Compute distance between a polygon and the rings of another. + + + Computes a point at a distance along a segment + specified by two relatively proportional values. + The fractional distance along the segment is d0/(d0+d1). + + @param p0 + start point of the segment + @param p1 + end point of the segment + @param d0 + proportional distance from start point to computed point + @param d1 + proportional distance from computed point to end point + @return the computed point + + + + Models a polygon lying in a plane in 3-dimensional Cartesian space. + The polygon representation is supplied + by a , + containing coordinates with XYZ ordinates. + 3D polygons are assumed to lie in a single plane. + The plane best fitting the polygon coordinates is + computed and is represented by a . + + Martin Davis + + + + Computes an average normal vector from a list of polygon coordinates. + Uses Newell's method, which is based + on the fact that the vector with components + equal to the areas of the projection of the polygon onto + the Cartesian axis planes is normal. + + @param seq the sequence of coordinates for the polygon + @return a normal vector + + + Computes a point which is the average of all coordinates + in a sequence. + If the sequence lies in a single plane, + the computed point also lies in the plane. + + @param seq a coordinate sequence + @return a Coordinate with averaged ordinates + + + + A ConnectedElementPointFilter extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list. The elements of the list are + com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + Returns a list containing a point from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. The elements of the list + are com.vividsolutions.jts.operation.distance.GeometryLocations. + + + + + + + + + + + + + + + + + Extracts a single point + from each connected element in a Geometry + (e.g. a polygon, linestring or point) + and returns them in a list + + + + + Returns a list containing a Coordinate from each Polygon, LineString, and Point + found inside the specified point. Thus, if the specified point is + not a GeometryCollection, an empty list will be returned. + + + + + + + + + + + + + + + + + Computes the distance and + closest points between two Geometrys. + The distance computation finds a pair of points in the input geometries + which have minimum distance between them. These points may + not be vertices of the geometries, but may lie in the interior of + a line segment. In this case the coordinate computed is a close + approximation to the exact point. + The algorithms used are straightforward O(n^2) + comparisons. This worst-case performance could be improved on + by using Voronoi techniques. + + + + + Compute the distance between the closest points of two geometries. + + A Geometry. + Another Geometry. + The distance between the geometries. + + + + Test whether two geometries lie within a given distance of each other. + + + + + + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Compute the the closest points of two geometries. + The points are presented in the same order as the input Geometries. + + A Geometry. + Another Geometry. + The closest points in the geometries. + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + + + + Constructs a that computes the distance and closest points between + the two specified geometries. + + + + The distance on which to terminate the search. + + + + Report the distance between the closest points on the input geometries. + + The distance between the geometries
+ or 0 if either input geometry is empty.
+ if either input geometry is null +
+ + + Report the coordinates of the closest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the closest points. + + + + Report the locations of the closest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the closest points. + + + + Report the coordinates of the nearest points in the input geometries. + The points are presented in the same order as the input Geometries. + + A pair of Coordinates of the nearest points. + + + + Report the locations of the nearest points in the input geometries. + The locations are presented in the same order as the input Geometries. + + A pair of s for the nearest points. + + + + + + + + + + + + + + + + + + + + + + + + + + + Computes distance between facets (lines and points) of input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a sequence of facets (points or line segments) of a + specified by a subsequence of a . + + Martin Davis + + + + Creates a new section based on a CoordinateSequence. + + The sequence holding the points in the section + The index of the start point + The index of the end point + 1 + + + + Creates a new sequence for a single point from a CoordinateSequence. + + The sequence holding the points in the facet sequence + the index of the point + + + + Gets the coordinate at the given index + + The index + The coordinate at the given index + + + + Computes the distance to another facet sequence + + The other facet sequence + The distance between this and . + + + + Gets the envelope of this facet sequence + + + + + Gets the number of coordinates in this facet sequence + + + + + Tests if this facet sequence consists of only one point + + + + + Utility class to build facet sequencs STRtrees- + + + + + + + + + + + + Creates facet sequences from a given geometry + + The geometry + A list of s + + + + Represents the location of a point on a Geometry. + Maintains both the actual point location + (which may not be exact, if the point is not a vertex) + as well as information about the component + and segment index where the point occurs. + Locations inside area Geometrys will not have an associated segment index, + so in this case the segment index will have the sentinel value of . + + + + + A special value of segmentIndex used for locations inside area geometries. + These locations are not located on a segment, + and thus do not have an associated segment index. + + + + + Constructs a GeometryLocation specifying a point on a point, as well as the + segment that the point is on (or if the point is not on a segment). + + The component of the geometry containing the point + The segment index of the location, or + The coordinate of the location + + + + Constructs a GeometryLocation specifying a point inside an area point. + + The component of the geometry containing the point + The coordinate of the location + + + + Returns the geometry component on (or in) which this location occurs. + + + + + Returns the segment index for this location. If the location is inside an + area, the index will have the value . + + + + + Returns the of this location. + + + + + Tests whether this location represents a point inside an area geometry. + + + + + Computes the distance between the facets (segments and vertices) + of two s + using a Branch-and-Bound algorithm. + The Branch-and-Bound algorithm operates over a + traversal of R-trees built + on the target and possibly also the query geometries. + + This approach provides the following benefits: + + + Performance is improved due to the effects of the R-tree index + and the pruning due to the Branch-and-Bound approach + + The spatial index on the target geometry can be cached + to allow reuse in an incremental query situation. + + Using this technique can be much more performant + than using + when one or both input geometries are large, + or when evaluating many distance computations against + a single geometry. + + + This class is not thread-safe. + + Martin Davis + + + + + Computes the distance between two geometries using the indexed approach. + + + For geometries with many segments or points, + this can be faster than using a simple distance + algorithm. + + A geometry + A geometry + The distance between the two geometries + + + + Creates a new distance-finding instance for a given target . + + + + Distances will be computed to all facets of the input geometry. + The facets of the geometry are the discrete segments and points + contained in its components. + + In the case of and inputs, + this is equivalent to computing the conventional distance. + + In the case of inputs, this is equivalent + to computing the distance to the polygons boundaries. + + + A Geometry, which may be of any type. + + + + Computes the distance from the base geometry to the given geometry. + + The geometry to compute the distance to. + The computed distance + + + * Tests whether the base geometry lies within + * a specified distance of the given geometry. + * + //* @param g the geomtry to test + //* @param maximumDistance the maximum distance to test + //* @return true if the geometry lies with the specified distance + + + + The base class for operations that require s. + + + + + + + + + + The operation args into an array so they can be accessed by index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether a is simple. + In general, the SFS specification of simplicity + follows the rule: + + + A Geometry is simple if and only if the only self-intersections are at boundary points. + + + + + Simplicity is defined for each } subclass as follows: + + Valid geometries are simple by definition, so + IsSimple trivially returns true.
+ (Note: this means that IsSimple cannot be used to test + for (invalid) self-intersections in Polygons. + In order to check if a Polygonal geometry has self-intersections, + use ).
+ geometries are simple if and only if they do not self-intersect at interior points + (i.e. points other than boundary points). + This is equivalent to saying that no two linear components satisfy the SFS + predicate. + Zero-dimensional () geometries are simple if and only if they have no + repeated points. + Empty s are always simple by definition. +
+ For geometries the evaluation of simplicity + can be customized by supplying a + to define how boundary points are determined. + The default is the SFS-standard . + Note that under the Mod-2 rule, closed LineStrings (rings) + will never satisfy the touches predicate at their endpoints, since these are + interior points, not boundary points. + If it is required to test whether a set of LineStrings touch + only at their endpoints, use IsSimpleOp with {@link BoundaryNodeRule#ENDPOINT_BOUNDARY_RULE}. + For example, this can be used to validate that a set of lines form a topologically valid + linear network. +
+
+ + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + + + + Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule + + The geometry to test + + + + Creates a simplicity checker using a given + + The geometry to test + The rule to use + + + + Tests whether the geometry is simple. + + true if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + Reports whether a is simple. + + The lineal geometry to test + True if the geometry is simple + + + + A MultiPoint is simple if it has no repeated points. + + + + + Computes simplicity for polygonal geometries. + Polygonal geometries are simple if and only if + all of their component rings are simple. + + A Polygonal geometry + true if the geometry is simple + + + Semantics for GeometryCollection is + simple iff all components are simple. + A GeometryCollection + true if the geometry is simple + + + + For all edges, check if there are any intersections which are NOT at an endpoint. + The Geometry is not simple if there are intersections not at endpoints. + + + + + + Tests that no edge intersection is the endpoint of a closed line. + This ensures that closed lines are not touched at their endpoint, + which is an interior point according to the Mod-2 rule + To check this we compute the degree of each endpoint. + The degree of endpoints of closed lines + must be exactly 2. + + + + + Add an endpoint to the map, creating an entry for it if none exists. + + + + + + + + Gets a coordinate for the location where the geometry fails to be simple. + (i.e. where it has a non-boundary self-intersection). + must be called before this location is accessed + + a coordinate for the location of the non-boundary self-intersection + or null if the geometry is simple + + + + + + + + + Creates an instance of this class + + The endpoint + + + + A sequence of LineMergeDirectedEdges forming one of the lines that will + be output by the line-merging process. + + + + + Constructs an EdgeString with the given factory used to convert this EdgeString + to a LineString. + + + + + + Adds a directed edge which is known to form part of this line. + + + + + + Converts this EdgeString into a LineString. + + + + + + + + + + A com.vividsolutions.jts.planargraph.DirectedEdge of a LineMergeGraph. + + + + + Represents a directed edge in a PlanarGraph. A DirectedEdge may or + may not have a reference to a parent Edge (some applications of + planar graphs may not require explicit Edge objects to be created). Usually + a client using a PlanarGraph will subclass DirectedEdge + to add its own application-specific data and methods. + + + + + The base class for all graph component classes. + Maintains flags of use in generic graph algorithms. + Provides two flags: + marked - typically this is used to indicate a state that persists + for the course of the graph's lifetime. For instance, it can be + used to indicate that a component has been logically deleted from the graph. + visited - this is used to indicate that a component has been processed + or visited by an single graph algorithm. For instance, a breadth-first traversal of the + graph might use this to indicate that a node has already been traversed. + The visited flag may be set and cleared many times during the lifetime of a graph. + + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Sets the state + for all s in an . + + A to scan. + The state to set the flag to. + + + + Finds the first + in a set + which has the specified state. + + A to scan. + The state to test. + The first found, or null if none found. + + + + Tests if a component has been visited during the course of a graph algorithm. + + + + + Gets/Sets the visited flag for this component. + + + + + Tests if a component has been marked at some point during the processing + involving this graph. + + + + + Gets/Sets the marked flag for this component. + + + + + Tests whether this component has been removed from its containing graph. + + + + + Gets or sets user defined data for this component + + + + + Returns a List containing the parent Edge (possibly null) for each of the given + DirectedEdges. + + + + + + + Constructs a DirectedEdge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Returns 1 if this DirectedEdge has a greater angle with the + positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. + Using the obvious algorithm of simply computing the angle is not robust, + since the angle calculation is susceptible to roundoff. A robust algorithm + is: + first compare the quadrants. If the quadrants are different, it it + trivial to determine which vector is "greater". + if the vectors lie in the same quadrant, the robust + RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) + function can be used to decide the relative orientation of the vectors. + + + + + + + Writes a detailed string representation of this DirectedEdge to the given PrintStream. + + + + + + Removes this directed edge from its containing graph. + + + + + Returns this DirectedEdge's parent Edge, or null if it has none. + Associates this DirectedEdge with an Edge (possibly null, indicating no associated + Edge). + + + + + Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's + orientation lies. + + + + + Returns a point to which an imaginary line is drawn from the from-node to + specify this DirectedEdge's orientation. + + + + + Returns whether the direction of the parent Edge (if any) is the same as that + of this Directed Edge. + + + + + Returns the node from which this DirectedEdge leaves. + + + + + Returns the node to which this DirectedEdge goes. + + + + + Returns the coordinate of the from-node. + + + + + Returns the angle that the start of this DirectedEdge makes with the + positive x-axis, in radians. + + + + + Returns the symmetric DirectedEdge -- the other DirectedEdge associated with + this DirectedEdge's parent Edge. + Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite + direction. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeDirectedEdge connecting the from node to the to node. + + + + + specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the directed edge that starts at this directed edge's end point, or null + if there are zero or multiple directed edges starting there. + + + + + An edge of a LineMergeGraph. The marked field indicates + whether this Edge has been logically deleted from the graph. + + + + + Represents an undirected edge of a {PlanarGraph}. An undirected edge + in fact simply acts as a central point of reference for two opposite + DirectedEdges. + Usually a client using a PlanarGraph will subclass Edge + to add its own application-specific data and methods. + + + + + The two DirectedEdges associated with this Edge. + + + + + Constructs an Edge whose DirectedEdges are not yet set. Be sure to call + SetDirectedEdges(DirectedEdge, DirectedEdge). + + + + + Constructs an Edge initialized with the given DirectedEdges, and for each + DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds + this Edge to its from-Node. + + + + + + + Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the + Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node. + + + + + + + Returns one of the DirectedEdges associated with this Edge. + + 0 or 1. + + + + + Returns the DirectedEdge that starts from the given node, or null if the + node is not one of the two nodes associated with this Edge. + + + + + + + If node is one of the two nodes associated with this Edge, + returns the other node; otherwise returns null. + + + + + + + Removes this edge from its containing graph. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + Constructs a LineMergeEdge with vertices given by the specified LineString. + + + + + + Returns the LineString specifying the vertices of this edge. + + + + + A planar graph of edges that is analyzed to sew the edges together. The + marked flag on com.vividsolutions.planargraph.Edges + and com.vividsolutions.planargraph.Nodes indicates whether they have been + logically deleted from the graph. + + + + + Represents a directed graph which is embeddable in a planar surface. + This class and the other classes in this package serve as a framework for + building planar graphs for specific algorithms. This class must be + subclassed to expose appropriate methods to construct the graph. This allows + controlling the types of graph components ({DirectedEdge}s, + Edges and Nodes) which can be added to the graph. An + application which uses the graph framework will almost always provide + subclasses for one or more graph components, which hold application-specific + data and graph algorithms. + + + + + + + + + + + + + + + + + + + + Returns the at the given location, or null if no was there. + + The location + The node found
+ or null if this graph contains no node at the location +
+
+ + + Adds a node to the map, replacing any that is already at that location. + Only subclasses can add Nodes, to ensure Nodes are of the right type. + + + The added node. + + + + Adds the Edge and its DirectedEdges with this PlanarGraph. + Assumes that the Edge has already been created with its associated DirectEdges. + Only subclasses can add Edges, to ensure the edges added are of the right class. + + + + + + Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, + to ensure the edges added are of the right class. + + + + + + Returns an IEnumerator over the Nodes in this PlanarGraph. + + + + + + Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they + were added. + + + + + + Returns an Iterator over the Edges in this PlanarGraph, in the order in which they + were added. + + + + + + Removes an Edge and its associated DirectedEdges from their from-Nodes and + from this PlanarGraph. Note: This method does not remove the Nodes associated + with the Edge, even if the removal of the Edge reduces the degree of a + Node to zero. + + + + + + Removes a from its from- and from this PlanarGraph. + + + This method does not remove the s associated with the DirectedEdge, + even if the removal of the DirectedEdge reduces the degree of a Node to zero. + + + + + + Removes a node from the graph, along with any associated DirectedEdges and + Edges. + + + + + + Returns all Nodes with the given number of Edges around it. + + + + + + + Returns the Nodes in this PlanarGraph. + + + + + Returns the Edges that have been added to this PlanarGraph. + + + + + Adds an Edge, DirectedEdges, and Nodes for the given LineString representation + of an edge. + + + + + + + + + + + + Sews together a set of fully noded LineStrings. + + + Sewing stops at nodes of degree 1 + or 3 or more -- the exception is an isolated loop, which only has degree-2 nodes, + in which case a node is simply chosen as a starting point. The direction of each + merged LineString will be that of the majority of the LineStrings from which it + was derived. + + Any dimension of Geometry is handled -- the constituent linework is extracted to + form the edges. The edges must be correctly noded; that is, they must only meet + at their endpoints. The LineMerger will still run on incorrectly noded input + but will not form polygons from incorrected noded edges. + + NOTE:once merging has been performed, no more + + + + + Adds a Geometry to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + Adds a collection of Geometries to be processed. May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be + extracted. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the LineStrings built by the merging process. + + + + + + + + + + + + + + + + + + + + + + + + Builds a sequence from a set of s, + so that they are ordered end to end. + A sequence is a complete non-repeating list of the linear + components of the input. Each linestring is oriented + so that identical endpoints are adjacent in the list. + + + The input linestrings may form one or more connected sets. + The input linestrings should be correctly noded, or the results may + not be what is expected. + The output of this method is a single , + containing the ordered linestrings in the sequence. + + + The sequencing employs the classic 'Eulerian path' graph algorithm. + Since Eulerian paths are not uniquely determined, further rules are used to + make the computed sequence preserve as much as possible of the input ordering. + Within a connected subset of lines, the ordering rules are: + - If there is degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If there is a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + + + Not all arrangements of lines can be sequenced. + For a connected set of edges in a graph, + Euler's Theorem states that there is a sequence containing each edge once + if and only if there are no more than 2 nodes of odd degree. + If it is not possible to find a sequence, the + property will return false. + + + + + + Tests whether a is sequenced correctly. + s are trivially sequenced. + s are checked for correct sequencing. + Otherwise, IsSequenced is defined + to be true for geometries that are not lineal. + + The to test. + + true if the is sequenced or is not lineal. + + + + + Adds a of s to be sequenced. + May be called multiple times. + Any dimension of Geometry may be added; the constituent linework will be extracted. + + A of geometries to add. + + + + Adds a to be sequenced. + May be called multiple times. + Any dimension of may be added; + the constituent linework will be extracted. + + + + + + Tests whether the arrangement of linestrings has a valid sequence. + + true if a valid sequence exists. + + + + Returns the or + built by the sequencing process, if one exists. + + The sequenced linestrings, + or null if a valid sequence does not exist. + + + + Tests whether a complete unique path exists in a graph + using Euler's Theorem. + + The containing the edges. + true if a sequence exists. + + + + Finds an for an unvisited edge (if any), + choosing the which preserves orientation, if possible. + + The to examine. + + The found, + or null if none were unvisited. + + + + + Computes a version of the sequence which is optimally + oriented relative to the underlying geometry. + + Heuristics used are: + - If the path has a degree-1 node which is the start + node of an linestring, use that node as the start of the sequence. + - If the path has a degree-1 node which is the end + node of an linestring, use that node as the end of the sequence. + - If the sequence has no degree-1 nodes, use any node as the start + (NOTE: in this case could orient the sequence according to the majority of the + linestring orientations). + + + A of s. + + A of s oriented appropriately. + + + + + Reverse the sequence. + This requires reversing the order of the s, + and flipping each as well. + + + A enumeration of s, + in sequential order. + + The reversed sequence. + + + + Builds a geometry ( or ) + representing the sequence. + + + An enumeration of s of s + with s as their parent edges. + + + The sequenced geometry, or null if no sequence exists. + + + + + A private implementation for + + + + + Initializes a new instance of the class. + + The sequencer. + + + + Performs an operation with or on + + + A to which the filter is applied. + + + + + Nodes a set of edges. + Takes one or more sets of edges and constructs a + new set of edges consisting of all the split edges created by + noding the input edges together. + + + + + + + + + + + + + + + + + + + + + + Forms NTS LineStrings out of a the graph of DirectedEdges + created by an OverlayOp. + + + + + + + + + + + + + + + + + A list of the LineStrings in the result of the specified overlay operation. + + + + + Find and mark L edges which are "covered" by the result area (if any). + L edges at nodes which also have A edges can be checked by checking + their depth at that node. + L edges at nodes which do not have A edges can be checked by doing a + point-in-polygon test with the previously computed result areas. + + + + + + + + + + + + + + + + + + + Collect edges from Area inputs which should be in the result but + which have not been included in a result area. + This happens ONLY: + during an intersection when the boundaries of two + areas touch in a line segment + OR as a result of a dimensional collapse. + + + + + + + + + + + + + + + + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A ring of edges which may contain nodes of degree > 2. + A MaximalEdgeRing may represent two different spatial entities: + a single polygon possibly containing inversions (if the ring is oriented CW) + a single hole possibly containing exversions (if the ring is oriented CCW) + If the MaximalEdgeRing represents a polygon, + the interior of the polygon is strongly connected. + These are the form of rings used to define polygons under some spatial data models. + However, under the OGC SFS model, MinimalEdgeRings are required. + A MaximalEdgeRing can be converted to a list of MinimalEdgeRings using the + BuildMinimalRings() method. + + + + + + + + + + + + + + + + + + + + + + + + + + For all nodes in this EdgeRing, + link the DirectedEdges at the node to form minimalEdgeRings + + + + + + + + + + + A ring of edges with the property that no node + has degree greater than 2. These are the form of rings required + to represent polygons under the OGC SFS spatial data model. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates nodes for use in the PlanarGraphs constructed during + overlay operations. + + + + + + + + + + + + The spatial functions supported by this class. + These operations implement various bool combinations of the resultants of the overlay. + + + + + The code for the Intersection overlay operation + + + + + The code for the Union overlay operation + + + + + The code for the Difference overlay operation + + + + + The code for the Symmetric Difference overlay operation + + + + + Computes the geometric overlay of two s. The overlay + can be used to determine any bool combination of the geometries. + + + + + Computes an overlay operation + for the given geometry arguments. + + The first geometry argument + The second geometry argument + The code for the desired overlay operation + The result of the overlay operation + Thrown if a robustness problem is encountered. + + + + Tests whether a point with a given topological + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + The topological label of the point + The code for the overlay operation to test + true if the label locations correspond to the overlayOpCode + + + + Tests whether a point with given s + relative to two geometries is contained in + the result of overlaying the geometries using + a given overlay operation. + + The method handles arguments of correctly + + the code for the location in the first geometry + the code for the location in the second geometry + the code for the overlay operation to test + true if the locations correspond to the overlayOpCode. + + + + Constructs an instance to compute a single overlay operation + for the given geometries. + + The first geometry argument + The second geometry argument + + + + Gets the result of the overlay for a given overlay operation. + + Note: this method can be called once only. + + The code of the overlay operation to perform + The computed result geometry + Thrown if a robustness problem is encountered + + + + Insert an edge from one of the noded input graphs. + Checks edges that are inserted to see if an + identical edge already exists. + If so, the edge is not inserted, but its label is merged + with the existing edge. + + The edge to insert + + + + Update the labels for edges according to their depths. + For each edge, the depths are first normalized. + Then, if the depths for the edge are equal, + this edge must have collapsed into a line edge. + If the depths are not equal, update the label + with the locations corresponding to the depths + (i.e. a depth of 0 corresponds to a Location of Exterior, + a depth of 1 corresponds to Interior) + + + + + If edges which have undergone dimensional collapse are found, + replace them with a new edge which is a L edge + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a previously computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Compute initial labelling for all DirectedEdges at each node. + In this step, DirectedEdges will acquire a complete labelling + (i.e. one with labels for both Geometries) + only if they + are incident on a node which has edges for both Geometries + + + + + For nodes which have edges from only one Geometry incident on them, + the previous step will have left their dirEdges with no labelling for the other + Geometry. However, the sym dirEdge may have a labelling for the other + Geometry, so merge the two labels. + + + + + Incomplete nodes are nodes whose labels are incomplete. + (e.g. the location for one Geometry is null). + These are either isolated nodes, + or nodes which have edges from only a single Geometry incident on them. + Isolated nodes are found because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + When each node labelling is completed, the labelling of the incident + edges is updated, to complete their labelling as well. + + + + + Label an isolated node with its relationship to the target point. + + + + + Find all edges whose label indicates that they are in the result area(s), + according to the operation being performed. Since we want polygon shells to be + oriented CW, choose dirEdges with the interior of the result on the RHS. + Mark them as being in the result. + Interior Area edges are the result of dimensional collapses. + They do not form part of the result area boundary. + + + + + If both a dirEdge and its sym are marked as being in the result, cancel + them out. + + + + + Tests if a point node should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Line or Area geometry. + + + + Tests if an L edge should be included in the result or not. + + The point coordinate + true if the coordinate point is covered by a result Area geometry. + + + + true if the coord is located in the interior or boundary of + a point in the list. + + + + + Creates an empty result geometry of the appropriate dimension, + based on the given overlay operation and the dimensions of the inputs. + The created geometry is always an atomic geometry, + not a collection. + + The empty result is constructed using the following rules: + + - result has the dimension of the lowest input dimension + - result has the dimension of the highest input dimension + - result has the dimension of the left-hand input + - result has the dimension of the highest input dimension + (since symDifference is the union of the differences). + + + The overlay operation being performed + An input geometry + An input geometry + The geometry factory being used for the operation + An empty atomic geometry of the appropriate dimension + + + + Disable + when an intersection is made (), + so performances are dramatically improved but failures are not managed. + + + Use ay your own risk! + + + + + Gets the graph constructed to compute the overlay. + + + + + Constructs Points from the nodes of an overlay graph. + + + + + + + + + + + + + + + + + A list of the Points in the result of the specified overlay operation. + + + + + + + + + + + + This method simplifies the resultant Geometry by finding and eliminating + "covered" points. + A point is covered if it is contained in another element Geometry + with higher dimension (e.g. a point might be contained in a polygon, + in which case the point can be eliminated from the resultant). + + + + + + + Forms Polygons out of a graph of {DirectedEdge}s. + The edges to use are marked as being in the result Area. + + + + + + + + + + + Add a complete graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + Add a set of edges and nodes, which form a graph. + The graph is assumed to contain one or more polygons, + possibly with holes. + + + + + + + For all DirectedEdges in result, form them into MaximalEdgeRings. + + + + + + + + + + + + + + + + This method takes a list of MinimalEdgeRings derived from a MaximalEdgeRing, + and tests whether they form a Polygon. This is the case if there is a single shell + in the list. In this case the shell is returned. + The other possibility is that they are a series of connected holes, in which case + no shell is returned. + + The shell EdgeRing, if there is one
or + null, if all the rings are holes.
+
+ + + This method assigns the holes for a Polygon (formed from a list of + MinimalEdgeRings) to its shell. + Determining the holes for a MinimalEdgeRing polygon serves two purposes: + it is faster than using a point-in-polygon check later on. + it ensures correctness, since if the PIP test was used the point + chosen might lie on the shell, which might return an incorrect result from the + PIP test. + + + + + + + For all rings in the input list, + determine whether the ring is a shell or a hole + and add it to the appropriate list. + Due to the way the DirectedEdges were linked, + a ring is a shell if it is oriented CW, a hole otherwise. + + + + + + + + This method determines finds a containing shell for all holes + which have not yet been assigned to a shell. + These "free" holes should + all be properly contained in their parent shells, so it is safe to use the + findEdgeRingContaining method. + (This is the case because any holes which are NOT + properly contained (i.e. are connected to their + parent shell) would have formed part of a MaximalEdgeRing + and been handled in a previous step). + + + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
or + null if no containing EdgeRing is found.
+
+ + + + + + + + + + Checks the current set of shells (with their associated holes) to + see if any of them contain the point. + + + + + + + + + + + + Snaps the vertices and segments of a + to another Geometry's vertices. + A snap distance tolerance is used to control where snapping is performed. + Snapping one geometry to another can improve + robustness for overlay operations by eliminating + nearly-coincident edges + (which cause problems during noding and intersection calculation). + It can also be used to eliminate artifacts such as narrow slivers, spikes and gores. + Too much snapping can result in invalid topology + beging created, so the number and location of snapped vertices + is decided using heuristics to determine when it + is safe to snap. + This can result in some potential snaps being omitted, however. + + Martin Davis + + + + Estimates the snap tolerance for a Geometry, taking into account its precision model. + + + The estimated snap tolerance + + + + + + + + + + + + + + + + + + + Snaps two geometries together with a given tolerance. + + + + + + + + + Snaps a geometry to itself. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + Snapping a geometry to itself can remove artifacts such as very narrow slivers, gores and spikes. + + the geometry to snap + the snapping tolerance + whether the result should be made valid + a new snapped + + + + Creates a new snapper acting on the given geometry + + the geometry to snap + + + + Snaps the vertices in the component s + of the source geometry to the vertices of the given snap geometry. + + a geometry to snap the source to + + a new snapped Geometry + + + Snaps the vertices in the component s + of the source geometry to the vertices of the same geometry. + Allows optionally cleaning the result to ensure it is topologically valid + (which fixes issues such as topology collapses in polygonal inputs). + The snapping tolerance + Whether the result should be made valid + The geometry snapped to itself + + + + + + + + + + + Computes the snap tolerance based on the input geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snaps the vertices and segments of a + to a set of target snap vertices. + A snap distance tolerance is used to control where snapping is performed. + The implementation handles empty geometry and empty snap vertex sets. + + + + + Creates a new snapper using the points in the given + as target snap points. + + A LineString to snap (may be empty) + the snap tolerance to use + + + + Creates a new snapper using the given points + as source points to be snapped. + + + + + + + Snaps the vertices and segments of the source LineString + to the given set of snap points. + + the vertices to snap to + list of the snapped points + + + + Snap source vertices to vertices in the target. + + the points to snap + the points to snap to + + + + + + + + + + + + Snap segments of the source to nearby snap vertices. + Source segments are "cracked" at a snap vertex. + A single input segment may be snapped several times + to different snap vertices. + For each distinct snap vertex, at most one source segment + is snapped to. This prevents "cracking" multiple segments + at the same point, which would likely cause + topology collapse when being used on polygonal linework. + + The coordinates of the source linestring to snap + The target snap vertices + + + + Finds a src segment which snaps to (is close to) the given snap point + Only a single segment is selected for snapping. + This prevents multiple segments snapping to the same snap vertex, + which would almost certainly cause invalid geometry + to be created. + (The heuristic approach of snapping used here + is really only appropriate when + snap pts snap to a unique spot on the src geometry) + Also, if the snap vertex occurs as a vertex in the src coordinate list, + no snapping is performed. + + The point to snap to + The source segment coordinates + The index of the snapped segment
+ or -1 if no segment snaps to the snap point.
+
+ + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class only uses snapping + if an error is detected when running the standard JTS overlay code. + Errors detected include thrown exceptions + (in particular, ) + and invalid overlay computations. + + + + + Performs an overlay operation using snapping and enhanced precision + to improve the robustness of the result. + This class always uses snapping. + This is less performant than the standard JTS overlay code, + and may even introduce errors which were not present in the original data. + For this reason, this class should only be used + if the standard overlay code fails to produce a correct result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds the most likely of a point relative to + the polygonal components of a geometry, using a tolerance value. + + + If a point is not clearly in the Interior or Exterior, + it is considered to be on the Boundary. + In other words, if the point is within the tolerance of the Boundary, + it is considered to be on the Boundary; otherwise, + whether it is Interior or Exterior is determined directly. + + Martin Davis + + + + Extracts linework for polygonal components. + + The geometry from which to extract + A lineal geometry containing the extracted linework + + + + Extracts the LineStrings in the boundaries of all the polygonal elements in the target . + + Martin Davis + + + + Filters out all linework for polygonal elements + + + + + Gets the list of polygonal linework. + + + + + Generates points offset by a given distance from both sides of the midpoint of all segments in a . + + + + Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. + + + The input geometry may have any orientation for its rings, + but is + only meaningful if the orientation is known. + + + Martin Davis + + + Set the sides on which to generate offset points. + + @param doLeft + @param doRight + + + + Gets the computed offset points. + + + + + Generates the two points which are offset from the + midpoint of the segment (p0, p1) by the offsetDistance + + The first point of the segment to offset from. + The second point of the segment to offset from + + + + + + Validates that the result of an overlay operation is geometrically correct within a determined tolerance. + Uses fuzzy point location to find points which are + definitely in either the interior or exterior of the result + geometry, and compares these results with the expected ones. + + + This algorithm is only useful where the inputs are polygonal. + This is a heuristic test, and may return false positive results + (I.e. it may fail to detect an invalid result.) + It should never return a false negative result, however + (I.e. it should never report a valid result as invalid.) + + Martin Davis + + + + + Represents a ring of PolygonizeDirectedEdges which form + a ring of a polygon. The ring may be either an outer shell or a hole. + + + + + Find the innermost enclosing shell EdgeRing containing the argument EdgeRing, if any. + The innermost enclosing ring is the smallest enclosing ring. + The algorithm used depends on the fact that: + ring A contains ring B iff envelope(ring A) contains envelope(ring B). + This routine is only safe to use if the chosen point of the hole + is known to be properly contained in a shell + (which is guaranteed to be the case if the hole does not touch its shell). + + + + Containing EdgeRing, if there is one
+ or null if no containing EdgeRing is found.
+
+ + + Finds a point in a list of points which is not contained in another list of points. + + The Coordinates to test. + An array of Coordinates to test the input points against. + A Coordinate from testPts which is not in pts,
+ or null.
+
+ + + Tests whether a given point is in an array of points. + Uses a value-based test. + + A Coordinate for the test point. + An array of Coordinates to test, + true if the point is in the array. + + + Traverses a ring of DirectedEdges, accumulating them into a list. + This assumes that all dangling directed edges have been removed + from the graph, so that there is always a next dirEdge. + + @param startDE the DirectedEdge to start traversing at + @return a List of DirectedEdges that form a ring + + + + + + + + + + Adds a DirectedEdge which is known to form part of this ring. + + The DirectedEdge to add. + + + + Computes whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + + + + Adds a hole to the polygon formed by this ring. + + The LinearRing forming the hole. + + + + Adds a hole to the polygon formed by this ring. + + the forming the hole. + + + + + + + + + + + + Updates the included status for currently non-included shells + based on whether they are adjacent to an included shell. + + + + + Gets a string representation of this object. + + + + + Tests whether this ring is a hole. + Due to the way the edges in the polyongization graph are linked, + a ring is a hole if it is oriented counter-clockwise. + + true if this ring is a hole. + + + + Computes and returns the Polygon formed by this ring and any contained holes. + + + + + Tests if the ring formed by this edge ring is topologically valid. + + true if the ring is valid. + + + + Computes and returns the list of coordinates which are contained in this ring. + The coordinatea are computed once only and cached. + + + + + Gets the coordinates for this ring as a LineString. + Used to return the coordinates in this ring + as a valid point, when it has been detected that the ring is topologically + invalid. + + + + + Returns this ring as a LinearRing, or null if an Exception occurs while + creating it (such as a topology problem). Details of problems are written to + standard output. + + + + + Gets or sets a value indicating the containing shell ring of a ring that has been determined to be a hole. + + + + + Gets a value indicating whether this ring has a shell assigned to it. + + + + + Tests whether this ring is an outer hole. + A hole is an outer hole if it is not contained by a shell. + + + + + Tests whether this ring is an outer shell. + + + + + Gets or sets a value indicating whether this ring has been processed. + + + + + Compares EdgeRings based on their envelope, + using the standard lexicographic ordering. + This ordering is sufficient to make edge ring sorting deterministic. + + mbdavis + + + + A DirectedEdge of a PolygonizeGraph, which represents + an edge of a polygon formed by the graph. + May be logically deleted from the graph by setting the marked flag. + + + + + Constructs a directed edge connecting the from node to the + to node. + + + + + Specifies this DirectedEdge's direction (given by an imaginary + line from the from node to directionPt). + + + Whether this DirectedEdge's direction is the same as or + opposite to that of the parent Edge (if any). + + + + + Returns the identifier attached to this directed edge. + Attaches an identifier to this directed edge. + + + + + Returns the next directed edge in the EdgeRing that this directed edge is a member of. + Sets the next directed edge in the EdgeRing that this directed edge is a member of. + + + + + Returns the ring of directed edges that this directed edge is + a member of, or null if the ring has not been set. + + + + + Gets/Sets the ring of directed edges that this directed edge is + a member of. + + + + + An edge of a polygonization graph. + + + + + + + + + + + + + + + + Represents a planar graph of edges that can be used to compute a + polygonization, and implements the algorithms to compute the + EdgeRings formed by the graph. + The marked flag on DirectedEdges is used to indicate that a directed edge + has be logically deleted from the graph. + + + + + + + + + + + + + + + + + + + + Deletes all edges at a node. + + + + + + Create a new polygonization graph. + + + + + + Add a LineString forming an edge of the polygon graph. + + The line to add. + + + + + + + + + + + + + + + + Convert the maximal edge rings found by the initial graph traversal + into the minimal edge rings required by NTS polygon topology rules. + + The list of start edges for the edgeRings to convert. + + + + Finds all nodes in a maximal edgering which are self-intersection nodes + + + + + The list of intersection nodes found, + or null if no intersection nodes were found. + + + + + Computes the minimal EdgeRings formed by the edges in this graph. + + A list of the{EdgeRings found by the polygonization process. + + + + Finds and labels all edgerings in the graph. + The edge rings are labeling with unique integers. + The labeling allows detecting cut edges. + + A List of the DirectedEdges in the graph. + A List of DirectedEdges, one for each edge ring found. + + + + Finds and removes all cut edges from the graph. + + A list of the LineStrings forming the removed cut edges. + + + + + + + + + + + + + + + + + Computes the next edge pointers going CCW around the given node, for the + given edgering label. + This algorithm has the effect of converting maximal edgerings into minimal edgerings + + + + + + + + + + + + + + Marks all edges from the graph which are "dangles". + Dangles are which are incident on a node with degree 1. + This process is recursive, since removing a dangling edge + may result in another edge becoming a dangle. + In order to handle large recursion depths efficiently, + an explicit recursion stack is used. + + A List containing the s that formed dangles. + + + + Traverses the polygonized edge rings in the graph + and computes the depth parity (odd or even) + relative to the exterior of the graph. + + If the client has requested that the output + be polygonally valid, only odd polygons will be constructed. + + + + + Traverses all connected edges, computing the depth parity of the associated polygons. + + + + + + Polygonizes a set of s which contain linework that + represents the edges of a planar graph. + + + All types of Geometry are accepted as input; + the constituent linework is extracted as the edges to be polygonized. + The processed edges must be correctly noded; that is, they must only meet + at their endpoints. Polygonization will accept incorrectly noded input + but will not form polygons from non-noded edges, + and reports them as errors. + + The Polygonizer reports the follow kinds of errors: + Dangles - edges which have one or both ends which are not incident on another edge endpoint + Cut Edges - edges which are connected at both ends but which do not form part of polygon + Invalid Ring Lines - edges which form rings which are invalid + (e.g. the component lines contain a self-intersection). + + Polygonization supports extracting only polygons which form a valid polygonal geometry. + The set of extracted polygons is guaranteed to be edge-disjoint. + This is useful for situations where it is known that the input lines form a + valid polygonal geometry. + + + + + + The default polygonizer output behavior + + + + + Default linestring adder. + + + + + Creates a polygonizer with the same + as the input Geometrys. + The output mask is + + + + + + Creates a polygonizer and allow specifyng if only polygons which form a valid polygonal geometry are to be extracted. + + true if only polygons which form a valid polygonal geometry are to be extracted + + + + Adds a collection of s to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used. + + A list of Geometrys with linework to be polygonized. + + + + Adds a to the linework to be polygonized. + May be called multiple times. + Any dimension of Geometry may be added; + the constituent linework will be extracted and used + + A Geometry with linework to be polygonized. + + + + Adds a to the graph of polygon edges. + + The to add. + + + + Gets the list of polygons formed by the polygonization. + + + + + Gets a geometry representing the polygons formed by the polygonization. + If a valid polygonal geometry was extracted the result is a geometry. + + A geometry containing the polygons + + + + Gets the list of dangling lines found during polygonization. + + + + + Gets the list of cut edges found during polygonization. + + + + + Gets the list of lines forming invalid rings found during polygonization. + + + + + Performs the polygonization, if it has not already been carried out. + + + + + For each outer hole finds and includes a single outer shell. + This seeds the travesal algorithm for finding only polygonal shells. + + The list of shell EdgeRings + + + + Allows disabling the valid ring checking, + to optimize situations where invalid rings are not expected. + + The default is true + + + + Adds every linear element in a into the polygonizer graph. + + + + + Filters all geometry instances + + The geometry instance + + + + Optimized implementation of spatial predicate "contains" + for cases where the first Geometry is a rectangle. + As a further optimization, + this class can be used directly to test many geometries against a single rectangle. + + + + + + + + + + + + + Create a new contains computer for two geometries. + + A rectangular geometry. + + + + + + + + + + + + + + + + + + + + + + + + + Tests if a point is contained in the boundary of the target rectangle. + + the point to test + true if the point is contained in the boundary + + + + Tests if a linestring is completely contained in the boundary of the target rectangle. + + the linestring to test + true if the linestring is contained in the boundary + + + + Tests if a line segment is contained in the boundary of the target rectangle. + + an endpoint of the segment + an endpoint of the segment + true if the line segment is contained in the boundary + + + I + Implementation of the Intersects spatial predicate + optimized for the case where one is a rectangle. + + + This class works for all input geometries, including s. + + As a further optimization, this class can be used in batch style + to test many geometries against a single rectangle. + + + + + Crossover size at which brute-force intersection scanning + is slower than indexed intersection detection. + Must be determined empirically. Should err on the + safe side by making value smaller rather than larger. + + + + + Tests whether a rectangle intersects a given geometry. + + A rectangular polygon + A geometry of any kind + true if the geometries intersect. + + + + Create a new intersects computer for a rectangle. + + A rectangular polygon. + + + + Tests whether the given Geometry intersects the query rectangle. + + The Geometry to test (may be of any type) + true if an intersection must occur + or false if no conclusion about intersection can be made + + + + Tests whether it can be concluded that a rectangle intersects a geometry, + based on the relationship of the envelope(s) of the geometry. + + Martin Davis + + + + Creates an instance of this class using the provided Envelope + + The query envelope + + + + + + + + + + + + + + + + Reports whether it can be concluded that an intersection occurs, + or whether further testing is required. + + true if an intersection must occur
+ or false if no conclusion about intersection can be made
+
+ + + A visitor which tests whether it can be + concluded that a geometry contains a vertex of + a query geometry. + + Martin Davis + + + + + + + + + + + + + + + + + + + + + + Gets a value indicating whether it can be concluded that a corner point of the rectangle is + contained in the geometry, or whether further testing is required. + + true if a corner point is contained + or false if no conclusion about intersection can be made + + + + + A visitor to test for intersection between the query rectangle and the line segments of the geometry. + + Martin Davis + + + + Creates a visitor for checking rectangle intersection with segments + + the query rectangle + + + Reports whether any segment intersection exists. + true if a segment intersection exists or + false if no segment intersection exists + + + + Tests if any line segments in two sets of intersect. + Optimized for use when at least one input is of small size. + Short-circuited to return as soon an intersection is found. + + + + + + + + + + + + + + + + + + + + + An EdgeEndBuilder creates EdgeEnds for all the "split edges" + created by the intersections determined for an Edge. + Computes the EdgeEnds which arise from a noded Edge. + + + + + + + + + + + + Creates stub edges for all the intersections in this + Edge (if any) and inserts them into the graph. + + + + + + + Create a EdgeStub for the edge before the intersection eiCurr. + The previous intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the previous point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiPrev may be null. + + + + + + + + + Create a StubEdge for the edge after the intersection eiCurr. + The next intersection is provided + in case it is the endpoint for the stub edge. + Otherwise, the next point from the parent edge will be the endpoint. + eiCurr will always be an EdgeIntersection, but eiNext may be null. + + + + + + + + + A collection of EdgeStubs which obey the following invariant: + They originate at the same node and have the same direction. + Contains all EdgeEnds which start at the same point and are parallel. + + + + + + + + + + + + + + + + + + + + + + + + This computes the overall edge label for the set of + edges in this EdgeStubBundle. It essentially merges + the ON and side labels for each edge. + These labels must be compatible + + + + + + Compute the overall ON location for the list of EdgeStubs. + (This is essentially equivalent to computing the self-overlay of a single Geometry) + edgeStubs can be either on the boundary (eg Polygon edge) + OR in the interior (e.g. segment of a LineString) + of their parent Geometry. + In addition, GeometryCollections use the to determine + whether a segment is on the boundary or not. + Finally, in GeometryCollections it can occur that an edge is both + on the boundary and in the interior (e.g. a LineString segment lying on + top of a Polygon edge.) In this case the Boundary is given precendence. + These observations result in the following rules for computing the ON location: + if there are an odd number of Bdy edges, the attribute is Bdy + if there are an even number >= 2 of Bdy edges, the attribute is Int + if there are any Int edges, the attribute is Int + otherwise, the attribute is Null. + + + + + + + Compute the labelling for each side + + + + + + To compute the summary label for a side, the algorithm is: + FOR all edges + IF any edge's location is Interior for the side, side location = Interior + ELSE IF there is at least one Exterior attribute, side location = Exterior + ELSE side location = Null + Note that it is possible for two sides to have apparently contradictory information + i.e. one edge side may indicate that it is in the interior of a point, while + another edge side may indicate the exterior of the same point. This is + not an incompatibility - GeometryCollections may contain two Polygons that touch + along an edge. This is the reason for Interior-primacy rule above - it + results in the summary label having the Geometry interior on both sides. + + + + + + + Update the IM with the contribution for the computed label for the EdgeStubs. + + + + + + + + + + + + + + + + + An ordered list of EdgeEndBundles around a RelateNode. + They are maintained in CCW order (starting with the positive x-axis) around the node + for efficient lookup and topology building. + + + + + Insert a EdgeEnd in order in the list. + If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is + added to the bundle. Otherwise, a new EdgeEndBundle is created + to contain the EdgeEnd. + + + + + + Update the IM with the contribution for the EdgeStubs around the node. + + + + + + Computes the topological relationship between two Geometries. + RelateComputer does not need to build a complete graph structure to compute + the IntersectionMatrix. The relationship between the geometries can + be computed by simply examining the labelling of edges incident on each node. + RelateComputer does not currently support arbitrary GeometryCollections. + This is because GeometryCollections can contain overlapping Polygons. + In order to correct compute relate on overlapping Polygons, they + would first need to be noded and merged (if not explicitly, at least + implicitly). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule) + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + For all intersections on the edges of a Geometry, + label the corresponding node IF it doesn't already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + + + + + + If the Geometries are disjoint, we need to enter their dimension and + boundary dimension in the Ext rows in the IM + + + + + + + + + + + Update the IM with the sum of the IMs for each component. + + + + + + Processes isolated edges by computing their labelling and adding them + to the isolated edges list. + Isolated edges are guaranteed not to touch the boundary of the target (since if they + did, they would have caused an intersection to be computed and hence would + not be isolated). + + + + + + + Label an isolated edge of a graph with its relationship to the target point. + If the target has dim 2 or 1, the edge can either be in the interior or the exterior. + If the target has dim 0, the edge must be in the exterior. + + + + + + + + Isolated nodes are nodes whose labels are incomplete + (e.g. the location for one Geometry is null). + This is the case because nodes in one graph which don't intersect + nodes in the other are not completely labelled by the initial process + of adding nodes to the nodeList. + To complete the labelling we need to check for nodes that lie in the + interior of edges, and in the interior of areas. + + + + + Label an isolated node with its relationship to the target point. + + + + + + + A RelateNode is a Node that maintains a list of EdgeStubs + for the edges that are incident on it. + + + + + + + + + + + + Update the IM with the contribution for this component. + A component only contributes if it has a labelling for both parent geometries. + + + + + Update the IM with the contribution for the EdgeEnds incident on this node. + + + + + + Used by the NodeMap in a RelateNodeGraph to create RelateNodes. + + + + + + + + + + + + Implements the simple graph of Nodes and EdgeEnd which is all that is + required to determine topological relationships between Geometries. + Also supports building a topological graph of a single Geometry, to + allow verification of valid topology. + It is not necessary to create a fully linked + PlanarGraph to determine relationships, since it is sufficient + to know how the Geometries interact locally around the nodes. + In fact, this is not even feasible, since it is not possible to compute + exact intersection points, and hence the topology around those nodes + cannot be computed robustly. + The only Nodes that are created are for improper intersections; + that is, nodes which occur at existing vertices of the Geometries. + Proper intersections (e.g. ones which occur between the interior of line segments) + have their topology determined implicitly, without creating a Node object + to represent them. + + + + + + + + + + + + + + + + + Insert nodes for all intersections on the edges of a Geometry. + Label the created nodes the same as the edge label if they do not already have a label. + This allows nodes created by either self-intersections or + mutual intersections to be labelled. + Endpoint nodes will already be labelled from when they were inserted. + Precondition: edge intersections have been computed. + + + + + + + Copy all nodes from an arg point into this graph. + The node label in the arg point overrides any previously computed + label for that argIndex. + (E.g. a node may be an intersection node with + a computed label of Boundary, + but in the original arg Geometry it is actually + in the interior due to the Boundary Determination Rule). + + + + + + + + + + + + + Implements the SFS relate() generalized spatial predicate on two s. +
+ The class supports specifying a custom + to be used during the relate computation. +
+ + If named spatial predicates are used on the result + of the RelateOp, the result may or not be affected by the + choice of BoundaryNodeRule, depending on the exact nature of the pattern. + For instance, is insensitive + to the choice of BoundaryNodeRule, + whereas is affected by the rule chosen. + + Note: custom Boundary Node Rules do not (currently) + affect the results of other methods (such + as . The results of + these methods may not be consistent with the relationship computed by + a custom Boundary Node Rule. + +
+ + + Computes the for the spatial relationship + between two s, using the default (OGC SFS) Boundary Node Rule + + A geometry to test + A geometry to test + The IntersectonMatrix for the spatial relationship between the geometries + + + + Computes the for the spatial relationship + between two s, using the specified Boundary Node Rule + + A geometry to test + A geometry to test + The Boundary Node Rule to use + The IntersectonMatrix for the spatial relationship between the geometries + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + + + + Creates a new Relate operation, using the default (OGC SFS) Boundary Node Rule. + + a Geometry to relate + another Geometry to relate + The Boundary Node Rule to use + + + + Gets the IntersectionMatrix for the spatial relationship + between the input geometries. + + + + + Provides an efficient method of unioning a collection of + geometrys. + The geometries are indexed using a spatial index, + and unioned recursively in index order. + For geometries with a high degree of overlap, + this has the effect of reducing the number of vertices + early in the process, which increases speed + and robustness. + + This algorithm is faster and more robust than + the simple iterated approach of + repeatedly unioning each polygon to a result geometry. + + The buffer(0) trick is sometimes faster, but can be less robust and + can sometimes take a long time to complete. + This is particularly the case where there is a high degree of overlap + between the polygons. In this case, buffer(0) is forced to compute + with all line segments from the outset, + whereas cascading can eliminate many segments + at each stage of processing. + The best situation for using buffer(0) is the trivial case + where there is no overlap between the input geometries. + However, this case is likely rare in practice. + + Martin Davis + + + + The effectiveness of the index is somewhat sensitive + to the node capacity. + Testing indicates that a smaller capacity is better. + For an STRtree, 4 is probably a good number (since + this produces 2x2 "squares"). + + + + Computes the union of + a collection of s. + + A collection of s. + + + + + Creates a new instance to union + the given collection of s. + + A collection of s + + + + Computes the union of the input geometries. + + + + This method discards the input geometries as they are processed. + In many input cases this reduces the memory retained + as the operation proceeds. + Optimal memory usage is achieved + by disposing of the original input collection + before calling this method. + + The union of the input geometries, + or null if no input geometries were provided + + if this method is called more than once + + + + Unions a list of geometries + by treating the list as a flattened binary tree, + and performing a cascaded union on the tree. + + The list of geometries to union + The union of the list + + + + Unions a section of a list using a recursive binary union on each half + of the section. + + The list of geometries containing the section to union + The start index of the section + The index after the end of the section + The union of the list section + + + + Gets the element at a given list index, or + null if the index is out of range. + + The list of geometries + The index + The geometry at the given index or + null if the index is out of range + + + + Reduces a tree of geometries to a list of geometries + by recursively unioning the subtrees in the list. + + A tree-structured list of geometries + A list of Geometrys + + + + Computes the union of two geometries, + either or both of which may be null. + + A Geometry + A Geometry + The union of the input(s) or + null if both inputs are null + + + + Unions two polygonal geometries, restricting computation + to the envelope intersection where possible. + The case of MultiPolygons is optimized to union only + the polygons which lie in the intersection of the two geometry's envelopes. + Polygons outside this region can simply be combined with the union result, + which is potentially much faster. + This case is likely to occur often during cascaded union, and may also + occur in real world data (such as unioning data for parcels on different street blocks). + + A polygonal geometry + A polygonal geometry + The intersection of the envelopes of the inputs + The union of the inputs + + + + Encapsulates the actual unioning of two polygonal geometries. + + + + Computes a containing only components. + Extracts the s from the input + and returns them as an appropriate geometry. + + If the input is already Polygonal, it is returned unchanged. + + A particular use case is to filter out non-polygonal components + returned from an overlay operation. + + The geometry to filter + A polygonal geometry + + + + Computes the union of a geometry with + another arbitrary . + Does not copy any component geometries. + + + + + + + + Unions a Collection of s or a single Geometry (which may be a ) together. + + + + By using this special-purpose operation over a collection of geometries + it is possible to take advantage of various optimizations to improve performance. + + + Heterogeneous s are fully supported. + + + The result obeys the following contract: + + Unioning a set of s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together). + Unioning a set of s has the effect of fully noding + and dissolving the input linework. + In this context "fully noded" means that there will be + an endpoint or node in the result + for every endpoint or line segment crossing in the input. + "Dissolved" means that any duplicate (e.g. coincident) line segments or portions + of line segments will be reduced to a single line segment in the output. + This is consistent with the semantics of the + operation. + If merged linework is required, the class can be used. + Unioning a set of s has the effect of merging all identical points (producing a set with no duplicates). + + + UnaryUnion always operates on the individual components of MultiGeometries. + So it is possible to use it to "clean" invalid self-intersecting MultiPolygons + (although the polygon components must all still be individually valid.) + + + + mbdavis + + + + + Computes the geometric union of a + + A collection of geometries + The union of the geometries, + or null if the input is empty + + + + Computes the geometric union of a + If no input geometries were provided but a was provided, + an empty is returned. + + A collection of geometries + The geometry factory to use if the collection is empty + The union of the geometries + or an empty GEOMETRYCOLLECTION + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + The union of the elements of the geometry + or an empty GEOMETRYCOLLECTION + + + + Constructs a unary union operation for an enumeration + of s, using the + of the input geometries. + + An enumeration of geometries + + + + Constructs a unary union operation for an enumeration + of s. + If no input geometries were provided but a was provided, + + An enumeration of geometries + The geometry factory to use if the enumeration is empty + + + + Constructs a unary union operation for a + (which may be a ). + + A geometry to union + + + + Gets the union of the input geometries. + If no input geometries were provided but a was provided, + an empty is returned. + Otherwise, the return value is null + + + A Geometry containing the union + or an empty if no geometries were provided in the input, + or null if not GeometryFactory was provided + + + + + Computes the union of two geometries, either of both of which may be null. + + + + + The union of the input(s) + or null if both inputs are null + + + + + Computes a unary union with no extra optimization, and no short-circuiting. + + + Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. + + A geometry + The union of the input geometry + + + + Experimental code to union MultiPolygons with processing limited to the elements which actually interact. + + Not currently used, since it doesn't seem to offer much of a performance advantage. + mbdavis + + + + This class tests that the interior of an area + ( or ) + is connected. An area Geometry is invalid if the interior is disconnected. + This can happen if: + - a shell self-intersects, + - one or more holes form a connected chain touching a shell at two different points, + - one or more holes form a ring around a subset of the interior. + If a disconnected situation is found the location of the problem is recorded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form s in graph into Minimal EdgeRings. + (Minimal Edgerings must be used, because only they are guaranteed to provide + a correct isHole computation). + + + + + + + Mark all the edges for the edgeRings corresponding to the shells of the input polygons. + Only ONE ring gets marked for each shell - if there are others which remain unmarked + this indicates a disconnected interior. + + + + + + + + + + + + + + + + + + + + Check if any shell ring has an unvisited edge. + A shell ring is a ring which is not a hole and which has the interior + of the parent area on the RHS. + (Note that there may be non-hole rings with the interior on the LHS, + since the interior of holes will also be polygonized into CW rings + by the LinkAllDirectedEdges() step). + + + true if there is an unvisited edge in a non-hole ring. + + + + + + + + + Checks that a {GeometryGraph} representing an area + (a Polygon or MultiPolygon ) + is consistent with the SFS semantics for area geometries. + Checks include: + Testing for rings which self-intersect (both properly and at nodes). + Testing for duplicate rings. + If an inconsistency if found the location of the problem is recorded. + + + + + + + + + + + Returns the intersection point, or null if none was found. + + + + + + + + + + Check all nodes to see if their labels are consistent. + If any are not, return false. + + + + + Checks for two duplicate rings in an area. + Duplicate rings are rings that are topologically equal + (that is, which have the same sequence of points up to point order). + If the area is topologically consistent (determined by calling the + isNodeConsistentArea, + duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. + (This is because topologically consistent areas cannot have two rings sharing + the same line segment, unless the rings are equal). + The start point of one of the equal rings will be placed in invalidPoint. + Returns true if this area Geometry is topologically consistent but has two duplicate rings. + + + + Tests whether any of a set of {@link LinearRing}s are + nested inside another ring in the set, using a spatial + index to speed up the comparisons. + + @version 1.7 + + + + Implements the algorithsm required to compute the + method for s. + See the documentation for the various geometry types for a specification of validity. + + + + + Checks whether a coordinate is valid for processing. + Coordinates are valid iff their x and y ordinates are in the + range of the floating point representation. + + The coordinate to validate. + true if the coordinate is valid. + + + + Find a point from the list of testCoords + that is NOT a node in the edge for the list of searchCoords. + + + + + The point found, or null if none found. + + + If the following condition is TRUE JTS will validate inverted shells and exverted holes (the ESRI SDE model). + + + + + + + + + + + + + + + + Checks validity of a Point. + + + + + + Checks validity of a MultiPoint. + + + + + + Checks validity of a LineString. + Almost anything goes for lineStrings! + + + + + + Checks validity of a LinearRing. + + + + + + Checks the validity of a polygon and sets the validErr flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check that there is no ring which self-intersects (except of course at its endpoints). + This is required by OGC topology rules (but not by other models + such as ESRI SDE, which allow inverted shells and exverted holes). + + + + + + Check that a ring does not self-intersect, except at its endpoints. + Algorithm is to count the number of times each node along edge occurs. + If any occur more than once, that must be a self-intersection. + + + + + Tests that each hole is inside the polygon shell. + This routine assumes that the holes have previously been tested + to ensure that all vertices lie on the shell or inside it. + A simple test of a single point in the hole can be used, + provide the point is chosen such that it does not lie on the + boundary of the shell. + + The polygon to be tested for hole inclusion. + A GeometryGraph incorporating the polygon. + + + + Tests that no hole is nested inside another hole. + This routine assumes that the holes are disjoint. + To ensure this, holes have previously been tested + to ensure that: + They do not partially overlap + (checked by checkRelateConsistency). + They are not identical + (checked by checkRelateConsistency). + + + + + Tests that no element polygon is wholly in the interior of another element polygon. + Preconditions: + Shells do not partially overlap. + Shells do not touch along an edge. + No duplicate rings exists. + This routine relies on the fact that while polygon shells may touch at one or + more vertices, they cannot touch at ALL vertices. + + + + + Check if a shell is incorrectly nested within a polygon. This is the case + if the shell is inside the polygon shell, but not inside a polygon hole. + (If the shell is inside a polygon hole, the nesting is valid.) + The algorithm used relies on the fact that the rings must be properly contained. + E.g. they cannot partially overlap (this has been previously checked by + CheckRelateConsistency). + + + + + This routine checks to see if a shell is properly contained in a hole. + It assumes that the edges of the shell and hole do not + properly intersect. + + + + + + null if the shell is properly contained, or + a Coordinate which is not inside the hole if it is not. + + + + + + + + + + + + Gets/Sets whether polygons using Self-Touching Rings to form + holes are reported as valid. + If this flag is set, the following Self-Touching conditions + are treated as being valid: + - The shell ring self-touches to create a hole touching the shell. + - A hole ring self-touches to create two holes touching at a point. + + + The default (following the OGC SFS standard) + is that this condition is not valid (false). + + + This does not affect whether Self-Touching Rings + disconnecting the polygon interior are considered valid + (these are considered to be invalid under the SFS, and many other + spatial models as well). + This includes "bow-tie" shells, + which self-touch at a single point causing the interior to be disconnected, + and "C-shaped" holes which self-touch at a single point causing an island to be formed. + + + States whether geometry with this condition is valid. + + + + Computes the validity of the geometry, + and returns true if it is valid. + + + + + Computes the validity of the geometry, + and if not valid returns the validation error for the geometry, + or null if the geometry is valid. + + The validation error, if the geometry is invalid
+ or null if the geometry is valid
+
+ + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a Quadtree + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Implements the appropriate checks for repeated points + (consecutive identical coordinates) as defined in the + NTS spec. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a simple O(n^2) + comparison. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests whether any of a set of LinearRings are + nested inside another ring in the set, using a SweepLineIndex + index to speed up the comparisons. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about the nature and location of + a validation error. + + + + + Not used. + + + + + No longer used: + repeated points are considered valid as per the SFS. + + + + + Indicates that a hole of a polygon lies partially + or completely in the exterior of the shell. + + + + + Indicates that a hole lies + in the interior of another hole in the same polygon. + + + + + Indicates that the interior of a polygon is disjoint + (often caused by set of contiguous holes splitting + the polygon into two parts). + + + + + Indicates that two rings of a polygonal geometry intersect. + + + + + Indicates that a ring self-intersects. + + + + + Indicates that a polygon component of a + lies inside another polygonal component. + + + + + Indicates that a polygonal geometry + contains two rings which are identical. + + + + + Indicates that either: + - A contains a single point. + - A contains 2 or 3 points. + + + + + Indicates that the X or Y ordinate of + a is not a valid + numeric value (e.g. ). + + + + + Indicates that a ring is not correctly closed + (the first and the last coordinate are different). + + + + + Contains information about the nature and location of a Geometry + validation error. + + + + + These messages must synch up with the indexes above + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Finds all connected s of a . + + + + + Initializes a new instance of the class. + + The . + + + + Adds all nodes and edges reachable from this node to the subgraph. + Uses an explicit stack to avoid a large depth of recursion. + + + + + + + Adds the argument node and all its out edges to the subgraph. + + + + + + + + A sorted collection of DirectedEdges which leave a Node + in a PlanarGraph. + + + + + The underlying list of outgoing DirectedEdges. + + + + + Adds a new member to this DirectedEdgeStar. + + + + + + Drops a member of this DirectedEdgeStar. + + + + + + Returns an Iterator over the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the zero-based index of the given DirectedEdge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Returns the remainder when i is divided by the number of edges in this + DirectedEdgeStar. + + + + + + + Returns the on the left-hand + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + + + Returns the on the right-hand (CW) + side of the given + (which must be a member of this DirectedEdgeStar). + + + + + Returns the number of edges around the Node associated with this DirectedEdgeStar. + + + + + Returns the coordinate for the node at wich this star is based. + + + + + Returns the DirectedEdges, in ascending order by angle with the positive x-axis. + + + + + A node in a PlanarGraph is a location where 0 or more Edges + meet. A node is connected to each of its incident Edges via an outgoing + DirectedEdge. Some clients using a PlanarGraph may want to + subclass Node to add their own application-specific + data and methods. + + + + + Returns all Edges that connect the two nodes (which are assumed to be different). + + + + + + + + The location of this Node. + + + + + The collection of DirectedEdges that leave this Node. + + + + + Constructs a Node with the given location. + + + + + + Constructs a Node with the given location and collection of outgoing DirectedEdges. + + + + + + + Adds an outgoing DirectedEdge to this Node. + + + + + + Returns the zero-based index of the given Edge, after sorting in ascending order + by angle with the positive x-axis. + + + + + + + Removes a incident on this node. Does not change the state of the directed edge. + + + + + Removes this node from its containing graph. + + + + + + + + + + + Returns the location of this Node. + + + + + Returns the collection of DirectedEdges that leave this Node. + + + + + Returns the number of edges around this Node. + + + + + Tests whether this component has been removed from its containing graph. + + + + + + A map of nodes, indexed by the coordinate of the node. + + + + + Adds a node to the map, replacing any that is already at that location. + + + The added node. + + + + Removes the Node at the given location, and returns it (or null if no Node was there). + + + + + + + Returns the Node at the given location, or null if no Node was there. + + + + + + + Returns an Iterator over the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the Nodes in this NodeMap, sorted in ascending order + by angle with the positive x-axis. + + + + + Returns the number of Nodes in this NodeMap. + + + + + A subgraph of a . + A subgraph may contain any subset of s + from the parent graph. + It will also automatically contain all s + and s associated with those edges. + No new objects are created when edges are added - + all associated components must already exist in the parent graph. + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new subgraph of the given . + + + + + + Gets the which this subgraph is part of. + + + + + + Adds an to the subgraph. + The associated s and s are also added. + + The to add. + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph, + in the order in which they were added. + + + + + + Returns an over the s in this graph. + + + + + + Tests whether an is contained in this subgraph. + + The to test. + true if the is contained in this subgraph. + + + + Determines the maximum number of common most-significant + bits in the mantissa of one or numbers. + Can be used to compute the double-precision number which + is represented by the common bits. + If there are no common bits, the number computed is 0.0. + + + + + Computes the bit pattern for the sign and exponent of a + double-precision number. + + + The bit pattern for the sign and exponent. + + + + This computes the number of common most-significant bits in the mantissas + of two double-precision numbers. + It does not count the hidden bit, which is always 1. + It does not determine whether the numbers have the same exponent - if they do + not, the value computed by this function is meaningless. + + + /// + The number of common most-significant mantissa bits. + + + + Zeroes the lower n bits of a bitstring. + + The bitstring to alter. + the number of bits to zero. + The zeroed bitstring. + + + + Extracts the i'th bit of a bitstring. + + The bitstring to extract from. + The bit to extract. + The value of the extracted bit. + + + + + + + + + + A representation of the Double bits formatted for easy readability + + + + + + + + + + + + Provides versions of Geometry spatial functions which use + common bit removal to reduce the likelihood of robustness problems. + In the current implementation no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + Client classes should check the validity of the returned result themselves. + + + + + Creates a new instance of class, which reshifts result Geometrys. + + + + + Creates a new instance of class, specifying whether + the result Geometrys should be reshifted. + + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry, to be subtracted from the first. + The Geometry representing the set-theoretic difference of the input Geometries. + + + Computes the set-theoretic symmetric difference of two geometries, + using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer a point, using enhanced precision. + + The Geometry to buffer. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + If required, returning the result to the orginal precision if required. + In this current implementation, no rounding is performed on the + reshifted result point, which means that it is possible + that the returned Geometry is invalid. + + The result Geometry to modify. + The result Geometry with the required precision. + + + + Computes a copy of the input Geometry with the calculated common bits + removed from each coordinate. + + The Geometry to remove common bits from. + A copy of the input Geometry with common bits removed. + + + + Computes a copy of each input Geometrys with the calculated common bits + removed from each coordinate. + + A Geometry to remove common bits from. + A Geometry to remove common bits from. + + An array containing copies + of the input Geometry's with common bits removed. + + + + + Removes common most-significant mantissa bits + from one or more s. + + The CommonBitsRemover "scavenges" precision + which is "wasted" by a large displacement of the geometry + from the origin. + For example, if a small geometry is displaced from the origin + by a large distance, + the displacement increases the significant figures in the coordinates, + but does not affect the relative topology of the geometry. + Thus the geometry can be translated back to the origin + without affecting its topology. + In order to compute the translation without affecting + the full precision of the coordinate values, + the translation is performed at the bit level by + removing the common leading mantissa bits. + + If the geometry envelope already contains the origin, + the translation procedure cannot be applied. + In this case, the common bits value is computed as zero. + + If the geometry crosses the Y axis but not the X axis + (and mutatis mutandum), + the common bits for Y are zero, + but the common bits for X are non-zero. + + + + + Add a point to the set of geometries whose common bits are + being computed. After this method has executed the + common coordinate reflects the common bits of all added + geometries. + + A Geometry to test for common bits. + + + + Removes the common coordinate bits from a Geometry. + The coordinates of the Geometry are changed. + + The Geometry from which to remove the common coordinate bits. + The shifted Geometry. + + + + Adds the common coordinate bits back into a Geometry. + The coordinates of the Geometry are changed. + + The Geometry to which to add the common coordinate bits. + + + + The common bits of the Coordinates in the supplied Geometries. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The coordinate sequence + + + + Reduces the precision of the s in a + to match the supplied . + + + Uses . + The input is modified in-place, so + it should be cloned beforehand if the + original should not be modified. + + mbdavis + + + + Creates a new precision reducer filter. + + The PrecisionModel to use + + + + Rounds the Coordinates in the sequence to match the PrecisionModel + + + + + Always runs over all geometry components. + + + + + Always reports that the geometry has changed + + + + + Provides versions of Geometry spatial functions which use + enhanced precision techniques to reduce the likelihood of robustness problems. + + + + + Only static methods! + + + + + Computes the set-theoretic intersection of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic intersection of the input Geometries. + + + + Computes the set-theoretic union of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic union of the input Geometries. + + + + Computes the set-theoretic difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic difference of the input Geometries. + + + + Computes the set-theoretic symmetric difference of two Geometrys, using enhanced precision. + + The first Geometry. + The second Geometry. + The Geometry representing the set-theoretic symmetric difference of the input Geometries. + + + + Computes the buffer of a Geometry, using enhanced precision. + This method should no longer be necessary, since the buffer algorithm + now is highly robust. + + The first Geometry. + The buffer distance. + The Geometry representing the buffer of the input Geometry. + + + + Reduces the precision of a + according to the supplied , + ensuring that the result is topologically valid. + + + + + Convenience method for doing precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + and preserving polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Convenience method for doing pointwise precision reduction + on a single geometry, + with collapses removed + and keeping the geometry precision model the same, + but NOT preserving valid polygonal topology. + + The geometry to reduce + The precision model to use + The reduced geometry + + + + Duplicates a geometry to one that uses a different PrecisionModel, + without changing any coordinate values. + + The geometry to duplicate + The precision model to use + The geometry value with a new precision model + + + Gets or sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + The default is to remove collapsed components. + + + + + /// Gets or sets whether the of the new reduced Geometry + will be changed to be the supplied to + specify the precision reduction. + + The default is to not change the precision model + + + + + Gets or sets whether the precision reduction will be done + in pointwise fashion only. + Pointwise precision reduction reduces the precision + of the individual coordinates only, but does + not attempt to recreate valid topology. + This is only relevant for geometries containing polygonal components. + + + + + Computes the Minimum Clearance of a . + + The Minimum Clearance is a measure of + what magnitude of perturbation of + the vertices of a geometry can be tolerated + before the geometry becomes topologically invalid. + The smaller the Minimum Clearance distance, + the less vertex pertubation the geometry can tolerate + before becoming invalid. + + + The concept was introduced by Thompson and Van Oosterom + [TV06], based on earlier work by Milenkovic [Mi88]. + + The Minimum Clearance of a geometry G + is defined to be the value r + such that "the movement of all points by a distance + of r in any direction will + guarantee to leave the geometry valid" [TV06]. + An equivalent constructive definition [Mi88] is that + r is the largest value such: + + No two distinct vertices of G are closer than r. + No vertex of G is closer than r to an edge of G of which the vertex is not an endpoint + + The following image shows an example of the Minimum Clearance + of a simple polygon. + +
+ + If G has only a single vertex (i.e. is a + ), the value of the minimum clearance + is . + + If G is a or geometry, + then in fact no amount of perturbation + will render the geometry invalid. + In this case a Minimum Clearance is still computed + based on the vertex and segment distances + according to the constructive definition. + + It is possible for no Minimum Clearance to exist. + For instance, a with all members identical + has no Minimum Clearance + (i.e. no amount of perturbation will cause + the member points to become non-identical). + Empty geometries also have no such distance. + The lack of a meaningful MinimumClearance distance is detected + and suitable values are returned by + and . + + The computation of Minimum Clearance utilizes + the + method to provide good performance even for + large inputs. + + An interesting note is that for the case of s, + the computed Minimum Clearance line + effectively determines the Nearest Neighbours in the collection. +

References

+ + [Mi88] Milenkovic, V. J., + Verifiable implementations of geometric algorithms + using finite precision arithmetic. + in Artificial Intelligence, 377-401. 1988 + [TV06] Thompson, Rod and van Oosterom, Peter, + Interchange of Spatial Data-Inhibiting Factors, + Agile 2006, Visegrad, Hungary. 2006 + +
+ /// Martin Davis +
+ + + Computes the Minimum Clearance distance for + the given Geometry. + + The input geometry + The minimum clearance + + + + Gets a LineString containing two points + which are at the Minimum Clearance distance + for the given Geometry. + + The input geometry + The value of the minimum clearance distance
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + Creates an object to compute the Minimum Clearance for the given Geometry + + The input geometry + + + + Gets the Minimum Clearance distance. + If no distance exists + (e.g. in the case of two identical points) + is returned. + + + The value of the minimum clearance distance
+ or if no Minimum Clearance distance exists +
+
+ + + Gets a LineString containing two points + which are at the Minimum Clearance distance. + If no distance could be found + (e.g. in the case of two identical points) + LINESTRING EMPTY is returned. + + The value of the minimum clearance distance,
+ or LINESTRING EMPTY if no minimum clearance distance exists.
+
+ + + + Reduces the precision of the coordinates of a Geometry + according to the supplied {PrecisionModel}, without + attempting to preserve valid topology. + + + In case of geometries, + the topology of the resulting geometry may be invalid if + topological collapse occurs due to coordinates being shifted. + It is up to the client to check this and handle it if necessary. + Collapses may not matter for some uses. An example + is simplifying the input to the buffer algorithm. + The buffer algorithm does not depend on the validity of the input point. + + + + + Convenience method for doing precision reduction on a single geometry, + with collapses removed and keeping the geometry precision model the same. + + The reduced geometry + + + + + + + + + + + + + + + + + Sets whether the reduction will result in collapsed components + being removed completely, or simply being collapsed to an (invalid) + Geometry of the same type. + + + + + Gets/Sets whether the PrecisionModel of the new reduced Geometry + will be changed to be the PrecisionModel supplied to + specify the precision reduction. + The default is to not change the precision model. + + + + + + + + + + + + + + + + + + + + + + + + Computes the minimum clearance of a geometry or + set of geometries. + The Minimum Clearance is a measure of + what magnitude of perturbation of its vertices can be tolerated + by a geometry before it becomes topologically invalid. + + This class uses an inefficient O(N^2) scan. + It is primarily for testing purposes. + + + Martin Davis + + + + Gets or sets the total number of points in the created . + The created geometry will have no more than this number of points, + unless more are needed to create a valid geometry. + + + + + The height of an equilateral triangle of side one + + + + + Creates random point sets contained in a + region defined by either a rectangular or a polygonal extent. + + mbdavis + + + + Create a shape factory which will create shapes using the default + . + + + + + Create a shape factory which will create shapes using the given + + + The factory to use + + + + Sets a polygonal mask. + + if the mask is not polygonal + + + + Creates random point sets where the points + are constrained to lie in the cells of a grid. + + mbdavis + + + + Create a builder which will create shapes using the default + . + + + + + Create a builder which will create shapes using the given + . + + The factory to use + + + + Gets the containing the generated point + + A MultiPoint + + + + Gets or sets whether generated points are constrained to lie + within a circle contained within each grid cell. + This provides greater separation between points + in adjacent cells. + + The default is to not be constrained to a circle. + + + + + Gets or sets the fraction of the grid cell side which will be treated as + a gutter, in which no points will be created. + + The provided value is clamped to the range [0.0, 1.0]. + + + + + Simplifies a line (sequence of points) using + the standard Douglas-Peucker algorithm. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a using the Douglas-Peucker algorithm. + + + Ensures that any polygonal geometries returned are valid. + Simple lines are not guaranteed to remain simple after simplification. + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + Note that in general D-P does not preserve topology - + e.g. polygons can be split, collapse to lines or disappear + holes can be created or disappear, + and lines can cross. + To simplify point while preserving topology use TopologySafeSimplifier. + (However, using D-P is significantly faster). + + KNOWN BUGS: + In some cases the approach used to clean invalid simplified polygons + can distort the output geometry severely. + + + + + + Simplifies a geometry using a given tolerance. + + The geometry to simplify. + The tolerance to use. + A simplified version of the geometry. + + + + Creates a simplifier for a given geometry. + + The geometry to simplify. + + + + Gets the simplified geometry. + + The simplified geometry. + + + + The distance tolerance for the simplification. + + + All vertices in the simplified geometry will be within this + distance of the original geometry. + The tolerance value must be non-negative. + + + + + Controls whether simplified polygons will be "fixed" + to have valid topology. + + + The caller may choose to disable this because: + + valid topology is not required + fixing topology is a relative expensive operation + in some pathological cases the topology fixing operation may either fail or run for too long + + The default is to fix polygon topology. + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a polygon, fixing it if required. + + + + + + + + Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component. + + null if the simplification results in a degenerate ring + + + + + + + + + + + + Creates a valid area point from one that possibly has + bad topology (i.e. self-intersections). + Since buffer can handle invalid topology, but always returns + valid point, constructing a 0-width buffer "corrects" the + topology. + Note this only works for area geometries, since buffer always returns + areas. This also may return empty geometries, if the input + has no actual area. + + An area point possibly containing self-intersections. + A valid area point. + + + + An index of LineSegments. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemVisitor subclass to reduce volume of query results. + + + + + + + + + + + + + + + + + + + + + + A LineSegment which is tagged with its location in a Geometry. + Used to index the segments in a point and recover the segment locations + from the index. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a collection of TaggedLineStrings, preserving topology + (in the sense that no new intersections are introduced). + This class is essentially just a container for the common + indexes used by . + + + + + Simplifies a collection of TaggedLineStrings. + + The collection of lines to simplify. + + + + Gets or sets the distance tolerance for the simplification.
+ Points closer than this tolerance to a simplified segment may + be removed. +
+
+ + + Represents a which can be modified to a simplified shape. + This class provides an attribute which specifies the minimum allowable length + for the modified result. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simplifies a TaggedLineString, preserving topology + (in the sense that no new intersections are introduced). + Uses the recursive Douglas-Peucker algorithm. + + + + + Simplifies the given + using the distance tolerance specified. + + The linestring to simplify. + + + + Flattens a section of the line between + indexes and , + replacing them with a line between the endpoints. + The input and output indexes are updated + to reflect this. + + The start index of the flattened section. + The end index of the flattened section. + The new segment created. + + + + Tests whether a segment is in a section of a . + + + + + + + + + Remove the segs in the section of the line. + + + + + + + + Sets the distance tolerance for the simplification. + All vertices in the simplified geometry will be within this + distance of the original geometry. + + + + + Simplifies a point and ensures that + the result is a valid point having the + same dimension and number of components as the input, + and with the components having the same topological + relationship. + + If the input is a polygonal geometry + ( or ): + + The result has the same number of shells and holes as the input, + with the same topological structure + The result rings touch at no more than the number of touching points in the input + (although they may touch at fewer points). + The key implication of this statement is that if the + input is topologically valid, so is the simplified output. + + For linear geometries, if the input does not contain + any intersecting line segments, this property + will be preserved in the output. + + For all geometry types, the result will contain + enough vertices to ensure validity. For polygons + and closed linear geometries, the result will have at + least 4 vertices; for open linestrings the result + will have at least 2 vertices. + + All geometry types are handled. + Empty and point geometries are returned unchanged. + Empty geometry components are deleted. + + The simplification uses a maximum-distance difference algorithm + similar to the Douglas-Peucker algorithm. + + +

KNOWN BUGS

+ + May create invalid topology if there are components which are small + relative to the tolerance value. + In particular, if a small hole is very near an edge, + it is possible for the edge to be moved by a relatively large tolerance value + and end up with the hole outside the result shell (or inside another hole). + Similarly, it is possible for a small polygon component to end up inside + a nearby larger polygon. + A workaround is to test for this situation in post-processing and remove + any invalid holes or polygons. + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A filter to add linear geometries to the linestring map + with the appropriate minimum size constraint. + Closed s (including s + have a minimum output size constraint of 4, + to ensure the output is valid. + For all other linestrings, the minimum size is 2 points. + + Martin Davis + + + + Filters linear geometries. + + A geometry of any type + + + + A utility class which creates Conforming Delaunay Trianglulations + from collections of points and linear constraints, and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Sets the sites (point or vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + The site vertices do not have to contain the constraint + vertices as well; any site vertices which are + identical to a constraint vertex will be removed + from the site vertex set. + + The geometry from which the sites will be extracted. + + + + Gets the QuadEdgeSubdivision which models the computed triangulation. + + The subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + The geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the linear constraints to be conformed to. + All linear components in the input will be used as constraints. + The constraint vertices do not have to be disjoint from + the site vertices. + The constraints must not contain duplicate segments (up to orientation). + + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + + Creates a Conforming Delaunay Triangulation based on the given + unconstrained initial vertices. The initial vertex set should not contain + any vertices which appear in the constraint set. + + a collection of + the distance tolerance below which points are considered identical + + + + Sets the constraints to be conformed to by the computed triangulation. + The constraints must not contain duplicate segments (up to orientation). + The unique set of vertices (as es) + forming the constraints must also be supplied. + Supplying it explicitly allows the ConstraintVertexes to be initialized + appropriately(e.g. with external data), and avoids re-computing the unique set + if it is already available. + + list of the constraint {@link Segment}s + the set of unique es referenced by the segments + + + + Creates a vertex on a constraint segment + + the location of the vertex to create + the constraint segment it lies on + the new constraint vertex + + + + Inserts all sites in a collection + + a collection of ConstraintVertex + + + + Inserts a site into the triangulation, maintaining the conformal Delaunay property. + This can be used to further refine the triangulation if required + (e.g. to approximate the medial axis of the constraints, + or to improve the grading of the triangulation). + + the location of the site to insert + + + + Computes the Delaunay triangulation of the initial sites. + + + + + Enforces the supplied constraints into the triangulation. + + + if the constraints cannot be enforced + + + + Given a set of points stored in the kd-tree and a line segment defined by + two points in this set, finds a in the circumcircle of + the line segment, if one exists. This is called the Gabriel point - if none + exists then the segment is said to have the Gabriel condition. Uses the + heuristic of finding the non-Gabriel point closest to the midpoint of the + segment. + + the line segment + + A point which is non-Gabriel, + or null if no point is non-Gabriel + + + + + Gets or sets the to be + used during constraint enforcement. + Different splitting strategies may be appropriate + for special situations. + + the ConstraintSplitPointFinder to be used + + + + Gets the tolerance value used to construct the triangulation. + + a tolerance value + + + + Gets and sets the used to create new constraint vertices at split points. + + Allows the setting of a custom {@link ConstraintVertexFactory} to be used + to allow vertices carrying extra information to be created. + + + + + Gets the which represents the triangulation. + + + + + Gets the which contains the vertices of the triangulation. + + + + + Gets the sites (vertices) used to initialize the triangulation. + + + + + Gets the s which represent the constraints. + + + + + Gets the convex hull of all the sites in the triangulation, + including constraint vertices. + Only valid after the constraints have been enforced. + + the convex hull of the sites + + + + Indicates a failure during constraint enforcement. + + Martin Davis + 1.0 + + + + Creates a new instance with a given message. + + a string + + + + Creates a new instance with a given message and approximate location. + + a string + the location of the error + + + + Gets the approximate location of this error. + + a location + + + + A vertex in a Constrained Delaunay Triangulation. + The vertex may or may not lie on a constraint. + If it does it may carry extra information about the original constraint. + + Martin Davis + + + + Models a site (node) in a . + The sites can be points on a line string representing a + linear site. + The vertex can be considered as a vector with a norm, length, inner product, cross + product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle + defined by this point and two others, etc.) are also defined in this class. + + It is common to want to attach user-defined data to + the vertices of a subdivision. + One way to do this is to subclass Vertex + to carry any desired information. + + David Skea + Martin Davis + + + + Creates an instance of this class using the given x- and y-ordinate valuse + + x-ordinate value + y-ordinate value + + + + Creates an instance of this class using the given x-, y- and z-ordinate values + + x-ordinate value + y-ordinate value + z-ordinate value + + + + Creates an instance of this class using a clone of the given . + + The coordinate + + + + Computes the cross product k = u X v. + + a vertex + returns the magnitude of u X v + + + + Computes the inner or dot product + + A vertex + The dot product u.v + + + + Computes the scalar product c(v) + + A vertex + The scaled vector + + + + Tests if this is inside the circle defined by the points a, b, c. This test uses simple + double-precision arithmetic, and thus may not be robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + true if this vertex is inside the circumcircle (a, b, c) + + + + Tests whether the triangle formed by this vertex and two + other vertices is in CCW orientation. + + a vertex + a vertex + true if the triangle is oriented CCW + + + + Computes the value of the ratio of the circumradius to shortest edge. If smaller than some + given tolerance B, the associated triangle is considered skinny. For an equal lateral + triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: + circumRadius/shortestEdge = 1/(2sin(theta)). + + second vertex of the triangle + third vertex of the triangle + ratio of circumradius to shortest edge. + + + + returns a new vertex that is mid-way between this vertex and another end point. + + the other end point. + the point mid-way between this and that. + + + + Computes the centre of the circumcircle of this vertex and two others. + + + + the Coordinate which is the circumcircle of the 3 points. + + + + For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate + a z value from the surrounding vertices. + + + + + Interpolates the Z-value (height) of a point enclosed in a triangle + whose vertices all have Z values. + The containing triangle must not be degenerate + (in other words, the three vertices must enclose a + non-zero area). + + The point to interpolate the Z value of + A vertex of a triangle containing the + A vertex of a triangle containing the + A vertex of a triangle containing the + The interpolated Z-value (height) of the point + + + + Computes the interpolated Z-value for a point p lying on the segment p0-p1 + + The point to interpolate the Z value of + A vertex of the segment is lying on + A vertex of the segment is lying on + The interpolated Z-value (height) of the point + + + + Gets the x-ordinate value + + + + + Gets the y-ordinate value + + + + + Gets the z-ordinate value + + + + + Gets the coordinate + + + + + Creates a new constraint vertex + + the location of the vertex + + + + Merges the constraint data in the vertex other into this vertex. + This method is called when an inserted vertex is + very close to an existing vertex in the triangulation. + + the constraint vertex to merge + + + + Gets or sets whether this vertex lies on a constraint. + + true if the vertex lies on a constraint + + + + Gets or sets the external constraint object + + object which carries information about the constraint this vertex lies on + + + + An interface for factories which create a {@link ConstraintVertex} + + Martin Davis + + + + A utility class which creates Delaunay Trianglulations + from collections of points and extract the resulting + triangulation edges or triangles as geometries. + + Martin Davis + + + + Extracts the unique s from the given . + + the geometry to extract from + a List of the unique Coordinates + + + + Converts all s in a collection to es. + + the coordinates to convert + a List of Vertex objects + + + + Computes the of a collection of s. + + a List of Coordinates + the envelope of the set of coordinates + + + + Sets the sites (vertices) which will be triangulated. + All vertices of the given geometry will be used as sites. + + the geometry from which the sites will be extracted. + + + + Sets the sites (vertices) which will be triangulated + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed triangulation. + + the subdivision containing the triangulation + + + + Gets the edges of the computed triangulation as a . + + the geometry factory to use to create the output + the edges of the triangulation + + + + Gets the faces of the computed triangulation as a + of . + + the geometry factory to use to create the output + the faces of the triangulation + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + + + + An interface for strategies for determining the location of split points on constraint segments. + The location of split points has a large effect on the performance and robustness of enforcing a + constrained Delaunay triangulation. Poorly chosen split points can cause repeated splitting, + especially at narrow constraint angles, since the split point will end up encroaching on the + segment containing the original encroaching point. With detailed knowledge of the geometry of the + constraints, it is sometimes possible to choose better locations for splitting. + + mbdavis + + + + Finds a point at which to split an encroached segment to allow the original segment to appear + as edges in a constrained Delaunay triangulation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a Delauanay Triangulation of a set of es, using an + incrementatal insertion algorithm. + + Martin Davis + 1.0 + + + + Creates a new triangulator using the given . + The triangulator uses the tolerance of the supplied subdivision. + + a subdivision in which to build the TIN + + + + Inserts all sites in a collection. The inserted vertices MUST be + unique up to the provided tolerance value. (i.e. no two vertices should be + closer than the provided tolerance value). They do not have to be rounded + to the tolerance grid, however. + + a Collection of Vertex + if the location algorithm fails to converge in a reasonable number of iterations + + + + Inserts a new point into a subdivision representing a Delaunay + triangulation, and fixes the affected edges so that the result is still a + Delaunay triangulation. + + a quadedge containing the inserted vertex + + + + A simple split point finder which returns the midpoint of the split segment. This is a default + strategy only. Usually a more sophisticated strategy is required to prevent repeated splitting. + Other points which could be used are: +
    +
  • The projection of the encroaching point on the segment
  • +
  • A point on the segment which will produce two segments which will not be further encroached
  • +
  • The point on the segment which is the same distance from an endpoint as the encroaching
  • + point +
+
+ Martin Davis +
+ + + Gets the midpoint of the split segment + + + + + A strategy for finding constraint split points which attempts to maximise the length of the split + segments while preventing further encroachment. (This is not always possible for narrow angles). + + Martin Davis + + + + A basic strategy for finding split points when nothing extra is known about the geometry of + the situation. + + the encroached segment + the encroaching point + the point at which to split the encroached segment + + + + Computes a split point which is the projection of the encroaching point on the segment + + The segment + The enchroaching point + A split point on the segment + + + + A framework to visit sets of edge-connected s in breadth-first order + + Martin Davis + 1.0 + + + + Called to initialize the traversal queue with a given set of s + + a collection of QuadEdgeTriangle + + + + Subclasses call this method to perform the visiting process. + + + + + An interface for classes which locate an edge in a + which either contains a given V + or is an edge of a triangle which contains V. + Implementors may utilized different strategies for + optimizing locating containing edges/triangles. + + Martin Davis + + + + Interface for classes which process triangles visited during travesals of a + + + Martin Davis + + + + Visits a triangle during a traversal of a . An implementation of + this method may perform processing on the current triangle. It must also decide whether a + neighbouring triangle should be added to the queue so its neighbours are visited. Often it + will perform processing on the neighbour triangle as well, in order to mark it as processed + (visited) and/or to determine if it should be visited. Note that choosing not to + visit the neighbouring triangle is the terminating condition for many traversal algorithms. + In particular, if the neighbour triangle has already been visited, it should not be visited + again. + + the current triangle being processed + the index of the edge in the current triangle being traversed + a neighbouring triangle next in line to visit + true if the neighbour triangle should be visited + + + + An interface for algorithms which process the triangles in a . + + Martin Davis + 1.0 + + + + + Locates s in a , + optimizing the search by starting in the + locality of the last edge found. + + Martin Davis + + + + Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. + The search starts from the last located edge amd proceeds on the general direction of v. + + + + + A class that represents the edge data structure which implements the quadedge algebra. + The quadedge algebra was described in a well-known paper by Guibas and Stolfi, + "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", + ACM Transactions on Graphics, 4(2), 1985, 75-123. + + Each edge object is part of a quartet of 4 edges, + linked via their Rot references. + Any edge in the group may be accessed using a series of operations. + Quadedges in a subdivision are linked together via their Next references. + The linkage between the quadedge quartets determines the topology + of the subdivision. + + + The edge class does not contain separate information for vertice or faces; a vertex is implicitly + defined as a ring of edges (created using the Next field). + + + David Skea + Martin Davis + + + + Creates a new QuadEdge quartet from o to d. + + the origin Vertex + the destination Vertex + the new QuadEdge quartet + + + + Creates a new QuadEdge connecting the destination of a to the origin of + b, in such a way that all three have the same left face after the + connection is complete. Additionally, the data pointers of the new edge + are set. + + the connected edge + + + + Splices two edges together or apart. + Splice affects the two edge rings around the origins of a and b, and, independently, the two + edge rings around the left faces of a and b. + In each case, (i) if the two rings are distinct, + Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it + into two separate pieces. Thus, Splice can be used both to attach the two edges together, and + to break them apart. + + an edge to splice + an edge to splice + + + + Turns an edge counterclockwise inside its enclosing quadrilateral. + + the quadedge to turn + + + + Quadedges must be made using {@link makeEdge}, + to ensure proper construction. + + + + + Gets the primary edge of this quadedge and its sym. + The primary edge is the one for which the origin + and destination coordinates are ordered + according to the standard ordering + + the primary quadedge + + + + Marks this quadedge as being deleted. + This does not free the memory used by + this quadedge quartet, but indicates + that this edge no longer participates + in a subdivision. + + + + + Sets the connected edge + + edge + + + + Tests if this quadedge and another have the same line segment geometry, + regardless of orientation. + + a quadege + true if the quadedges are based on the same line segment regardless of orientation + + + + Tests if this quadedge and another have the same line segment geometry + with the same orientation. + + a quadege + true if the quadedges are based on the same line segment + + + + Creates a representing the + geometry of this edge. + + a LineSegment + + + + Converts this edge to a WKT two-point LINESTRING indicating + the geometry of this edge. + + a String representing this edge's geometry + + + + Gets or sets the external data value for this edge. + + + an object containing external data + + + + + Tests whether this edge has been deleted. + + true if this edge has not been deleted. + + + + Gets the dual of this edge, directed from its right to its left. + + Gets or Sets the rotated edge + + + + Gets the dual of this edge, directed from its left to its right. + + Gets the inverse rotated edge. + + + + Gets the edge from the destination to the origin of this edge. + + Gets the sym of the edge. + + + + Gets the next CCW edge around the origin of this edge. + + Gets the next linked edge. + + + + Gets the next CW edge around (from) the origin of this edge. + + Gets the previous edge. + + + + Gets the next CCW edge around (into) the destination of this edge. + + Get the next destination edge. + + + + Gets the next CW edge around (into) the destination of this edge. + + Get the previous destination edge. + + + + Gets the CCW edge around the left face following this edge. + + Gets the next left face edge. + + + + Gets the CCW edge around the left face before this edge. + + Get the previous left face edge. + + + + Gets the edge around the right face ccw following this edge. + + Gets the next right face edge. + + + + Gets the edge around the right face ccw before this edge. + + Gets the previous right face edge. + + + + Gets or sets the vertex for the edge's origin + + Gets the origin vertex + + + + Gets or sets the vertex for the edge's destination + + Gets the destination vertex + + + + Gets the length of the geometry of this quadedge. + + Gets the length of the quadedge + + + + A class that contains the s representing a planar + subdivision that models a triangulation. + The subdivision is constructed using the + quadedge algebra defined in the classs . + All metric calculations + are done in the class. + In addition to a triangulation, subdivisions + support extraction of Voronoi diagrams. + This is easily accomplished, since the Voronoi diagram is the dual + of the Delaunay triangulation. + + Subdivisions can be provided with a tolerance value. Inserted vertices which + are closer than this value to vertices already in the subdivision will be + ignored. Using a suitable tolerance value can prevent robustness failures + from happening during Delaunay triangulation. + + + Subdivisions maintain a frame triangle around the client-created + edges. The frame is used to provide a bounded "container" for all edges + within a TIN. Normally the frame edges, frame connecting edges, and frame + triangles are not included in client processing. + + + David Skea + Martin Davis + + + + Gets the edges for the triangle to the left of the given . + + + + if the edges do not form a triangle + + + + Creates a new instance of a quad-edge subdivision based on a frame triangle + that encloses a supplied bounding box. A new super-bounding box that + contains the triangle is computed and stored. + + the bouding box to surround + the tolerance value for determining if two sites are equal + + + + Gets the collection of base s (one for every pair of + vertices which is connected). + + a collection of QuadEdges + + + + Sets the to use for locating containing triangles + in this subdivision. + + a QuadEdgeLocator + + + + Creates a new quadedge, recording it in the edges list. + + The origin vertex + The destination vertex + A new quadedge + + + + Creates a new QuadEdge connecting the destination of a to the origin of b, + in such a way that all three have the same left face after the connection + is complete. The quadedge is recorded in the edges list. + + A quadedge + A quadedge + A quadedge + + + + Deletes a quadedge from the subdivision. Linked quadedges are updated to + reflect the deletion. + + the quadedge to delete + + + + Locates an edge of a triangle which contains a location + specified by a Vertex v. + The edge returned has the + property that either v is on e, or e is an edge of a triangle containing v. + The search starts from startEdge amd proceeds on the general direction of v. + + + This locate algorithm relies on the subdivision being Delaunay. For + non-Delaunay subdivisions, this may loop for ever. + + the location to search for + an edge of the subdivision to start searching at + a QuadEdge which contains v, or is on the edge of a triangle containing v + + if the location algorithm fails to converge in a reasonable + number of iterations + + + + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the vertex to locate + a quadedge on the edge of a triangle which touches or contains the location
+ or null if no such triangle exists +
+
+ + + Finds a quadedge of a triangle containing a location + specified by a , if one exists. + + the Coordinate to locate + a quadedge on the edge of a triangle which touches or contains the location, + or null if no such triangle exists + + + + + Locates the edge between the given vertices, if it exists in the + subdivision. + + a coordinate + another coordinate + the edge joining the coordinates, if present, + or null if no such edge exists + + + + + Inserts a new site into the Subdivision, connecting it to the vertices of + the containing triangle (or quadrilateral, if the split point falls on an + existing edge). + + + + This method does NOT maintain the Delaunay condition. If desired, this must + be checked and enforced by the caller. + + + This method does NOT check if the inserted vertex falls on an edge. This + must be checked by the caller, since this situation may cause erroneous + triangulation + + + the vertex to insert + a new quad edge terminating in v + + + + Tests whether a QuadEdge is an edge incident on a frame triangle vertex. + + the edge to test + true if the edge is connected to the frame triangle + + + + Tests whether a QuadEdge is an edge on the border of the frame facets and + the internal facets. E.g. an edge which does not itself touch a frame + vertex, but which touches an edge which does. + + the edge to test + true if the edge is on the border of the frame + + + + Tests whether a vertex is a vertex of the outer triangle. + + the vertex to test + true if the vertex is an outer triangle vertex + + + + Tests whether a {@link Coordinate} lies on a {@link QuadEdge}, up to a + tolerance determined by the subdivision tolerance. + + a QuadEdge + a point + true if the vertex lies on the edge + + + + Tests whether a is the start or end vertex of a + , up to the subdivision tolerance distance. + + + + true if the vertex is a endpoint of the edge + + + + Gets the unique es in the subdivision, + including the frame vertices if desired. + + true if the frame vertices should be included + a collection of the subdivision vertices + + + + + Gets a collection of s whose origin + vertices are a unique set which includes + all vertices in the subdivision. + The frame vertices can be included if required. + + + This is useful for algorithms which require traversing the + subdivision starting at all vertices. + Returning a quadedge for each vertex + is more efficient than + the alternative of finding the actual vertices + using and then locating + quadedges attached to them. + + true if the frame vertices should be included + a collection of QuadEdge with the vertices of the subdivision as their origins + + + + Gets all primary quadedges in the subdivision. + A primary edge is a + which occupies the 0'th position in its array of associated quadedges. + These provide the unique geometric edges of the triangulation. + + true if the frame edges are to be included + a List of QuadEdges + + + + The quadedges forming a single triangle. + Only one visitor is allowed to be active at a + time, so this is safe. + + + + + Stores the edges for a visited triangle. Also pushes sym (neighbour) edges + on stack to visit later. + + + + + + the visited triangle edges,
+ or null if the triangle should not be visited (for instance, if it is outer) +
+
+ + + Gets a list of the triangles + in the subdivision, specified as + an array of the primary quadedges around the triangle. + + true if the frame triangles should be included + a List of QuadEdge[3] arrays + + + + Gets a list of the triangles in the subdivision, + specified as an array of the triangle es. + + true if the frame triangles should be included + a List of Vertex[3] arrays + + + + Gets the coordinates for each triangle in the subdivision as an array. + + true if the frame triangles should be included + a list of Coordinate[4] representing each triangle + + + + Gets the geometry for the edges in the subdivision as a + containing 2-point lines. + + the GeometryFactory to use + a IMultiLineString + + + + Gets the geometry for the triangles in a triangulated subdivision as a + of triangular s. + + the GeometryFactory to use + a GeometryCollection of triangular Polygons + + + + Gets the cells in the Voronoi diagram for this triangulation. + The cells are returned as a of s + + + The userData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a GeometryCollection of Polygons + + + + Gets a List of s for the Voronoi cells + of this triangulation. + + + The UserData of each polygon is set to be the + of the cell site. This allows easily associating external + data associated with the sites to the cells. + + a geometry factory + a List of Polygons + + + + Gets the Voronoi cell around a site specified + by the origin of a QuadEdge. + + + The userData of the polygon is set to be the + of the site. This allows attaching external + data associated with the site to this cell polygon. + + a quadedge originating at the cell site + a factory for building the polygon + a polygon indicating the cell extent + + + + Gets the vertex-equality tolerance value + used in this subdivision + + Gets the tolerance value + + + + Gets the envelope of the Subdivision (including the frame). + + Gets the envelope + + + + A TriangleVisitor which computes and sets the + circumcentre as the origin of the dual + edges originating in each triangle. + + mbdavis + + + + Models a triangle formed from s in a + which forms a triangulation. The class provides methods to access the + topological and geometric properties of the triangle and its neighbours in + the triangulation. Triangle vertices are ordered in CCW orientation in the + structure. + + + QuadEdgeTriangles support having an external data attribute attached to them. + Alternatively, this class can be subclassed and attributes can + be defined in the subclass. Subclasses will need to define + their own BuilderVisitor class + and CreateOn method. + + Martin Davis + 1.0 + + + + Creates s for all facets of a + representing a triangulation. + The data attributes of the s in the subdivision + will be set to point to the triangle which contains that edge. + This allows tracing the neighbour triangles of any given triangle. + + The QuadEdgeSubdivision to create the triangles on. + A List of the created QuadEdgeTriangles + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 Vertexes + the point to test + true if the point is contained in the triangle + + + + Tests whether the point pt is contained in the triangle defined by 3 es. + + an array containing at least 3 QuadEdges + the point to test + true if the point is contained in the triangle + + + + Creates a new triangle from the given edges. + + An array of the edges of the triangle in CCW order + + + + Gets the vertices for this triangle. + + a new array containing the triangle vertices + + + + Gets the index for the given edge of this triangle + + a QuadEdge + the index of the edge in this triangle,
+ or -1 if the edge is not an edge of this triangle +
+
+ + + Gets the index for the edge that starts at vertex v. + + the vertex to find the edge for + the index of the edge starting at the vertex,
+ or -1 if the vertex is not in the triangle +
+
+ + + Tests whether this triangle is adjacent to the outside of the subdivision. + + true if the triangle is adjacent to the subdivision exterior + + + + Gets the triangles which are adjacent (include) to a + given vertex of this triangle. + + The vertex to query + A list of the vertex-adjacent triangles + + + + Gets the neighbours of this triangle. If there is no neighbour triangle, the array element is + null + + an array containing the 3 neighbours of this triangle + + + + Gets or sets the external data value for this triangle. + + + + + Gets all edges which are incident on the origin of the given edge. + + the edge to start at + a List of edges which have their origin at the origin of the given + edge + + + + Algorithms for computing values and predicates + associated with triangles. + + + For some algorithms extended-precision + implementations are provided, which are more robust + (i.e. they produce correct answers in more cases). + Also, some more robust formulations of + some algorithms are provided, which utilize + normalization to the origin. + + Martin Davis + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This test uses simple + double-precision arithmetic, and thus is not 100% robust. + However, by using normalization to the origin + it provides improved robustness and increased performance. + Based on code by J.R.Shewchuk. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the + triangle is oriented counterclockwise. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The area of the triangle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + This method uses more robust computation. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + x ordinate of a vertex of the triangle + y ordinate of a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + Tests if a point is inside the circle defined by + the triangle with vertices a, b, c (oriented counter-clockwise). + + + The computation uses arithmetic for robustness, but a faster approach. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + true if this point is inside the circle defined by the points a, b, c + + + + Computes twice the area of the oriented triangle (a, b, c), i.e., the area + is positive if the triangle is oriented counterclockwise. + + + The computation uses {@link DD} arithmetic for robustness. + + a vertex of the triangle + a vertex of the triangle + a vertex of the triangle + The area of a triangle defined by the points a, b and c + + + + + + + + + + + + + + Computes the inCircle test using distance from the circumcentre. + Uses standard double-precision arithmetic. + + + In general this doesn't + appear to be any more robust than the standard calculation. However, there + is at least one case where the test point is far enough from the + circumcircle that this test gives the correct answer. +
+            LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
+            1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
+            
+
+ A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + The area of a triangle defined by the points a, b and c +
+ + + Checks if the computed value for isInCircle is correct, using + double-double precision arithmetic. + + A vertex of the triangle + A vertex of the triangle + A vertex of the triangle + The point to test + + + + + Creates a new instance for the given ordinates. + + + + + Creates a new instance for the given ordinates, with associated external data. + + + + + Creates a new instance for the given points, with associated external data. + + the start point + the end point + an external data object + + + + Creates a new instance for the given points. + + the start point + the end point + + + + Determines whether two segments are topologically equal. + I.e. equal up to orientation. + + a segment + true if the segments are topologically equal + + + + Computes the intersection point between this segment and another one. + + a segment + the intersection point, or null if there is none + + + + Computes a string representation of this segment. + + a string + + + + Gets the start coordinate of the segment + + a Coordinate + + + + Gets the end coordinate of the segment + + a Coordinate + + + + Gets the start X ordinate of the segment + + the X ordinate value + + + + Gets the start Y ordinate of the segment + + the Y ordinate value + + + + Gets the start Z ordinate of the segment + + the Z ordinate value + + + + Gets the end X ordinate of the segment + + the X ordinate value + + + + Gets the end Y ordinate of the segment + + he Y ordinate value + + + + Gets the end Z ordinate of the segment + + the Z ordinate value + + + + Gets a LineSegment modelling this segment. + + a LineSegment + + + + Gets or sets the external data associated with this segment + + a data object + + + + Models a constraint segment which can be split in two in various ways, + according to certain geometric constraints. + + Martin Davis + + + + Computes the {@link Coordinate} that lies a given fraction along the line defined by the + reverse of the given segment. A fraction of 0.0 returns the end point of the + segment; a fraction of 1.0 returns the start point of the segment. + + the LineSegment + the fraction of the segment length along the line + the point at that distance + + + + Creates a map between the vertex s of a + set of s, + and the parent geometry, and transfers the source geometry + data objects to geometry components tagged with the coordinates. + + + This class can be used in conjunction with + to transfer data objects from the input site geometries + to the constructed Voronoi polygons. + + Martin Davis + + + + + Input is assumed to be a multiGeometry + in which every component has its userData + set to be a Coordinate which is the key to the output data. + The Coordinate is used to determine + the output data object to be written back into the component. + + + + + + A utility class which creates Voronoi Diagrams + from collections of points. + The diagram is returned as a of s, + representing the faces of the Voronoi diagram. + /// The faces are clipped to the larger of: + + + an envelope supplied by . + + + an envelope determined by the input sites. + + + The userData attribute of each face Polygon is set to + the Coordinate of the corresponding input site. + This allows using a Map to link faces to data associated with sites. + + Martin Davis + + + + Sets the sites (point or vertices) which will be diagrammed. + All vertices of the given geometry will be used as sites. + + geom the geometry from which the sites will be extracted. + + + + Sets the sites (point or vertices) which will be diagrammed + from a collection of s. + + a collection of Coordinates. + + + + Gets the which models the computed diagram. + + the subdivision containing the triangulation + + + + Gets the faces of the computed diagram as a + of s, clipped as specified. + + The attribute of each face is set to + the Coordinate of the corresponding input site. + This allows using a to link faces to data associated with sites. + + the geometry factory to use to create the output + a containg the face s of the diagram + + + + Sets the envelope to clip the diagram to. + The diagram will be clipped to the larger + of this envelope or an envelope surrounding the sites. + + the clip envelope. + + + + Sets the snapping tolerance which will be used + to improved the robustness of the triangulation computation. + A tolerance of 0.0 specifies that no snapping will take place. + + tolerance the tolerance distance to use + + + + A utility for making programming assertions. + + + + + + + + + + + + + + + + + + + + + A supoort class: the purpose is to integrate System.BitConverter methods not presents in .NET Compact Framework. + + + + + + + + + + + + + + + + + + + Static utility class for casting objects + + + + + Cast function from arbitrary-type to + + The output type + The sequence of items to cast. + as an enumerable of + Thrown if cast cannot be performed + + + + Cast function from sub-type to super-type + + The output (super/base) type + The input (sub/derived) type + The sequence of items to cast. + as an enumerable of + + + + Cast function from super-type to sub-type + + The input (sub/derived) type + The output (super/base) type + The sequence of items to cast. + as an enumerable of + + + + Executes a transformation function on each element of a collection + and returns the results in a new List. + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + and returns the results in a new . + + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + but does not accumulate the result. + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Executes a function on each item in a + and collects all the entries for which the result + of the function is equal to true. + + + + + + + + Copies s in an array to an object array + + + + the source array + An array of objects + + + + + + + + + + + + + + + + + + + + + A CoordinateFilter that creates an array containing every coordinate in a Geometry. + + + + + Constructs a CoordinateArrayFilter. + + The number of points that the CoordinateArrayFilter will collect. + + + + + + + + + + Returns the Coordinates collected by this CoordinateArrayFilter. + + + + + CoordinateCompare is used in the sorting of arrays of Coordinate objects. + Implements a lexicographic comparison. + + + + + Compares two object and returns a value indicating whether one is less than, equal to or greater + than the other. + + First Coordinate object to compare. + Second Coordinate object to compare. + + <table cellspacing="0" class="dtTABLE"> + <TR VALIGN="top"> + <TH width=50%>Value</TH> + <TH width=50%>Condition</TH> + </TR> + <TR VALIGN="top"> + <TD width=50%>Less than zero</TD> + <TD width=50%><I>a</I> is less than <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Zero</TD> + <TD width=50%><I>a</I> equals <I>b</I>.</TD> + </TR> + <TR VALIGN="top"> + <TD width=50%>Greater than zero</TD> + <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> + </TR> + </table> + + If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b + implements IComparable, then b. CompareTo (a) is returned. + Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not + generate an exception when using IComparable. When sorting, a null reference (Nothing) is + considered to be less than any other object. + + + + + A CoordinateFilter that counts the total number of coordinates + in a Geometry. + + + + + + + + + + + Returns the result of the filtering. + + + + + Converts degrees to radians. + + + + + Converts degrees to radians. + + The angle in degrees. + The angle in radians. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only static methods! + + + + + Convert the given numeric value (passed as string) of the base specified by baseIn + to the value specified by baseOut. + + Numeric value to be converted, as string. + Base of input value. + Base to use for conversion. + Converted value, as string. + + + + Utility functions to report memory usage. + + mbdavis + + + + A priority queue over a set of objects. + + Objects to add + Martin Davis + + + Insert into the priority queue. Duplicates are allowed. + + The item to insert. + + + + Test if the priority queue is logically empty. + + true if empty, false otherwise. + + + + Make the priority queue logically empty. + + + + + Remove the smallest item from the priority queue. + + The smallest item, or default(T) if empty. + + + + Returns size. + + + + + Converts radians to degress. + + + + + Converts radians to degress. + + Angle in radians. + The angle in degrees. + + + + + + + + + + + + + + + + + Buffer for characters. This approximates StringBuilder + but is designed to be faster for specific operations. + This is about 30% faster for the operations I'm interested in + (Append, Clear, Length, ToString). + This trades off memory for speed. + + + To make Remove from the head fast, this is implemented + as a ring buffer. + This uses head and tail indices into a fixed-size + array. This will grow the array as necessary. + + + + + Default constructor. + + + + + Construct with a specific capacity. + + + + + + Reallocate the buffer to be larger. For the new size, this + uses the max of the requested length and double the current + capacity. + This does not shift, meaning it does not change the head or + tail indices. + + The new requested length. + + + + Ensure that we're set for the requested length by + potentially growing or shifting contents. + + + + + + Move the buffer contents such that headIndex becomes 0. + + + + + Overwrite this object's underlying buffer with the specified + buffer. + + The character array. + The number of characters to consider filled + in the input buffer. + + + + Append a character to this buffer. + + + + + + Append a string to this buffer. + + The string to append. + + + + Append a string to this buffer. + + The string to append. + + + + Remove a character at the specified index. + + The index of the character to remove. + + + + + Remove a specified number of characters at the specified index. + + The index of the characters to remove. + The number of characters to remove. + + + + Find the first instance of a character in the buffer, and + return its index. This returns -1 if the character is + not found. + + The character to find. + The index of the specified character, or -1 + for not found. + + + + Empty the buffer. + + + + + Return the current contents as a string. + + The new string. + + + + Gets/Sets the number of characters in the character buffer. + Increasing the length this way provides indeterminate results. + + + + + Returns the capacity of this character buffer. + + + + + Indexer. + + + + + Exception class for unterminated tokens. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated quotes. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Exception class for unterminated block comments. + + + + + Construct with a particular message. + + The message to store in this object. + + + + Bitwise enumeration for character types. + + + + word characters (usually alpha, digits, and domain specific) + + + # or something for line comments + + + whitespace + + + ' or " type + + + usually 0 to 9 + + + usually 0 to 9, a-f and A-F + + + eof char + + + + This contains the settings that control the behavior of the tokenizer. + This is separated from the StreamTokenizer so that common settings + are easy to package and keep together. + + + + + Default constructor. + + + + + Copy constructor. + + + + + Sets this object to be the same as the specified object. + Note that some settings which are entirely embodied by the character + type table. + + + + + Setup default parse behavior. + This resets to same behavior as on construction. + + bool - true for success. + + + + Apply settings which are commonly used for code parsing + C-endCapStyle code, including C++, C#, and Java. + + + + + + Clear the character type settings. This leaves them unset, + as opposed to the default. Use SetDefaults() for default + settings. + + + + + Specify that a particular character is a word character. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + The character. + + + + Specify that a range of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + First character. + Last character. + + + + Specify that a string of characters are word characters. + Character table type manipulation method. + This adds the type to the char(s), rather + than overwriting other types. + + + + + + Specify that a character is a whitespace character. + Character table type manipulation method. + This type is exclusive with other types. + + The character. + + + + Specify that a range of characters are whitespace characters. + Character table type manipulation method. + This adds the characteristic to the char(s), rather + than overwriting other characteristics. + + First character. + Last character. + + + + Remove other type settings from a range of characters. + Character table type manipulation method. + + + + + + + Remove other type settings from a character. + Character table type manipulation method. + + + + + + Specify that a particular character is a comment-starting character. + Character table type manipulation method. + + + + + + Specify that a particular character is a quote character. + Character table type manipulation method. + + + + + + Return a string representation of a character type setting. + Since the type setting is bitwise encoded, a character + can have more than one type. + + The character type byte. + The string representation of the type flags. + + + + Check whether the specified char type byte has a + particular type flag set. + + The char type byte. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Check whether the specified char has a + particular type flag set. + + The character. + The CharTypeBits entry to compare to. + bool - true or false + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + This is the character type table. Each byte is bitwise encoded + with the character attributes, such as whether that character is + word or whitespace. + + + + + Whether or not to return whitespace tokens. If not, they're ignored. + + + + + Whether or not to return EolTokens on end of line. Eol tokens will not + break up other tokens which can be multi-line. For example block comments + and quotes will not be broken by Eol tokens. Therefore the number of + Eol tokens does not give you the line count of a stream. + + + + + Whether or not to look for // comments + + + + + Whether or not to look for /* */ block comments. + + + + + Whether or not to return comments. + + + + + Whether or not to check for unterminated quotes and block comments. + If true, and one is encoutered, an exception is thrown of the appropriate type. + + + + + Whether or not digits are specified as Digit type in the + character table. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + This setting may become incorrect if you modify the character + types table directly. + + + + + Whether or not to parse Hex (0xABCD...) numbers. + This setting is based on the character types table, so this + setting interacts with character type table manipulation. + + + + + A StreamTokenizer similar to Java's. This breaks an input stream + (coming from a TextReader) into Tokens based on various settings. The settings + are stored in the TokenizerSettings property, which is a + StreamTokenizerSettings instance. + + + + This is configurable in that you can modify TokenizerSettings.CharTypes[] array + to specify which characters are which type, along with other settings + such as whether to look for comments or not. + + + WARNING: This is not internationalized. This treats all characters beyond + the 7-bit ASCII range (decimal 127) as Word characters. + + + There are two main ways to use this: 1) Parse the entire stream at + once and get an ArrayList of Tokens (see the Tokenize* methods), + and 2) call NextToken() successively. + This reads from a TextReader, which you can set directly, and this + also provides some convenient methods to parse files and strings. + This returns an Eof token if the end of the input is reached. + + + Here's an example of the NextToken() endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer(); + tokenizer.GrabWhitespace = true; + tokenizer.Verbosity = VerbosityLevel.Debug; // just for debugging + tokenizer.TextReader = File.OpenText(fileName); + Token token; + while (tokenizer.NextToken(out token)) log.Info("Token = '{0}'", token); + + + + Here's an example of the Tokenize... endCapStyle of use: + + StreamTokenizer tokenizer = new StreamTokenizer("some string"); + ArrayList tokens = new ArrayList(); + if (!tokenizer.Tokenize(tokens)) + { + // error handling + } + foreach (Token t in tokens) Console.WriteLine("t = {0}", t); + + + + Comment delimiters are hardcoded (// and /*), not affected by char type table. + + + This sets line numbers in the tokens it produces. These numbers are normally + the line on which the token starts. + There is one known caveat, and that is that when GrabWhitespace setting + is true, and a whitespace token contains a newline, that token's line number + will be set to the following line rather than the line on which the token + started. + + + + + + This is the number of characters in the character table. + + + + + Default constructor. + + + + + Construct and set this object's TextReader to the one specified. + + The TextReader to read from. + + + + Construct and set a string to tokenize. + + The string to tokenize. + + + + Utility function, things common to constructors. + + + + + Clear the stream settings. + + + + + Display the state of this object. + + + + + Display the state of this object, with a per-line prefix. + + The pre-line prefix. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + The state. + + + + Pick the next state given just a single character. This is used + at the start of a new token. + + The type of the character. + The character. + Exclude this state from the possible next state. + The state. + + + + Read the next character from the stream, or from backString + if we backed up. + + The next character. + + + + Get the next token. The last token will be an EofToken unless + there's an unterminated quote or unterminated block comment + and Settings.DoUntermCheck is true, in which case this throws + an exception of type StreamTokenizerUntermException or sub-class. + + The output token. + bool - true for success, false for failure. + + + + Starting from current stream location, scan forward + over an int. Determine whether it's an integer or not. If so, + push the integer characters to the specified CharBuffer. + If not, put them in backString (essentially leave the + stream as it was) and return false. + + If it was an int, the stream is left 1 character after the + end of the int, and that character is output in the thisChar parameter. + + The formats for integers are: 1, +1, and -1 + The + and - signs are included in the output buffer. + + The CharBuffer to append to. + Whether or not to consider + to be part + of an integer. + The last character read by this method. + true for parsed an int, false for not an int + + + + Parse the rest of the stream and put all the tokens + in the input ArrayList. This resets the line number to 1. + + The ArrayList to append to. + bool - true for success + + + + Parse all tokens from the specified TextReader, put + them into the input ArrayList. + + The TextReader to read from. + The ArrayList to append to. + bool - true for success, false for failure. + + + + Parse all tokens from the specified string, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Parse all tokens from the specified Stream, put + them into the input ArrayList. + + + The ArrayList to put tokens in. + bool - true for success, false for failure. + + + + Gibt einen Enumerator zurück, der die Auflistung durchläuft. + + + Ein , der zum Durchlaufen der Auflistung verwendet werden kann. + + 1 + + + + Gibt einen Enumerator zurück, der eine Auflistung durchläuft. + + + Ein -Objekt, das zum Durchlaufen der Auflistung verwendet werden kann. + + 2 + + + + This is the TextReader that this object will read from. + Set this to set the input reader for the parse. + + + + + The settings which govern the behavior of the tokenization. + + + + + The states of the state machine. + + + + + A CoordinateFilter that builds a set of Coordinates. + The set of coordinates contains no duplicate points. + + + + + Convenience method which allows running the filter over an array of s. + + an array of coordinates + an array of the unique coordinates + + + + + + + + + + Returns the gathered s. + + +
+
Index: packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/PowerCollections.dll =================================================================== diff -u Binary files differ Index: packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/PowerCollections.xml =================================================================== diff -u --- packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/PowerCollections.xml (revision 0) +++ packages/NetTopologySuite.1.14/lib/portable-net403+sl5+netcore45+wpa81+wp8+MonoAndroid10+XamariniOS10+MonoTouch10/PowerCollections.xml (revision 71ed7567af664066cc36baab032ea66401e433ce) @@ -0,0 +1,10916 @@ + + + + PowerCollections + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + +
+