contains

operator fun <P : Position<P>> PositionBasedFilter<*>.contains(position: P): Boolean

Enables the Kotlin in operator for PositionBasedFilter instances.

This is a convenience extension that allows writing position in filter instead of filter.contains(position), even when the filter is available with a star-projected type.

Since PositionBasedFilter is generic in the position type, this operator performs an unchecked cast to PositionBasedFilter<P>. The caller is responsible for ensuring that the runtime filter expects positions compatible with P; otherwise, the underlying implementation may throw at runtime or behave unexpectedly.

Return

true if position is contained in this filter, false otherwise.

Parameters

position

the position being tested for inclusion.

Type Parameters

P

the position type.