com.mapinfo.midev.language.filter

## Class NearestFilterBuilder

- java.lang.Object
- - com.mapinfo.midev.language.filter.NearestFilterBuilder

    public final class NearestFilterBuilder
    extends Object

A builder for the `NearestFilter`.

### Method Summary

All Methods Instance Methods Concrete Methods
`NearestFilter` `build()` Create the filter from the specified parameters.
`NearestFilterBuilder` `distanceColumn(String distanceColumn)` Set the name of the column that will hold the distance between the search geometry and the table geometry.
`NearestFilterBuilder` `distanceType(DistanceFilterType distanceType)` Set the type of distance comparison to perform.
`NearestFilterBuilder` `distanceUnit(LinearUnit unit)` Set the units that the `NearestFilterBuilder.distanceColumn(String)` is in.
`NearestFilterBuilder` `geometryPointColumn(String geometryPointColumn)` Set the name of the column that will hold the `IPoint` that is on the search geometry the closest point to the table geometry.
`NearestFilterBuilder` `maxCandidates(int maxCandidates)` Set the maximum number of candidates to return.
`NearestFilterBuilder` `maxDistance(Length maxDistance)` Set maxmimum distance from the search geometry to search within.
`NearestFilterBuilder` `tablePointColumn(String tablePointColumn)` Set the name of the column that will hold the `IPoint` that is on the geometry in the table that is the closest point to the search geometry.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### maxDistance

    public NearestFilterBuilder maxDistance(Length maxDistance)

Set maxmimum distance from the search geometry to search within.

Parameters:
  `maxDistance` - The maxmimum distance from the search geometry to search within.
Returns:
  `this`

#### distanceType

    public NearestFilterBuilder distanceType(DistanceFilterType distanceType)

Set the type of distance comparison to perform.

Parameters:
  `distanceType` - The type of distance comparison to perform.
Returns:
  `this`

#### maxCandidates

    public NearestFilterBuilder maxCandidates(int maxCandidates)

Set the maximum number of candidates to return. Must be greater than 0.

Parameters:
  `maxCandidates` - The maximum number of candidates to return. Must be greater than 0.
Returns:
  `this`

#### distanceColumn

    public NearestFilterBuilder distanceColumn(String distanceColumn)

Set the name of the column that will hold the distance between the search geometry and the table geometry. If `null` then the attribute will not be added to the projection list.

Parameters:
  `distanceColumn` - The name of the column that will hold the distance between the search geometry and the table geometry.
Returns:
  `this`

#### distanceUnit

    public NearestFilterBuilder distanceUnit(LinearUnit unit)

Set the units that the `NearestFilterBuilder.distanceColumn(String)` is in.

Parameters:
  `unit` - The units that the `NearestFilterBuilder.distanceColumn(String)` is in.
Returns:
  `this`

#### tablePointColumn

    public NearestFilterBuilder tablePointColumn(String tablePointColumn)

Set the name of the column that will hold the `IPoint` that is on the geometry in the table that is the closest point to the search geometry. If `null` the the attribute will not be added to the projection list.

Parameters:
  `tablePointColumn` - The name of the column that will hold the `IPoint` that is on the geometry in the table that is the closest point to the search geometry.
Returns:
  `this`

#### geometryPointColumn

    public NearestFilterBuilder geometryPointColumn(String geometryPointColumn)

Set the name of the column that will hold the `IPoint` that is on the search geometry the closest point to the table geometry. If `null` the the attribute will not be added to the projection list.

Parameters:
  `geometryPointColumn` - The name of the column that will hold the `IPoint` that is on the search geometry the closest point to the table geometry.
Returns:
  `this`

#### build

    public NearestFilter build()

Create the filter from the specified parameters.