API Reference > imodeljs-frontend > LocatingElements > HitList HitList<T extends HitDetail> Class The result of a "locate" is a sorted list of objects that satisfied the search criteria (a HitList). Earlier hits in the list are somehow better than those later on. Methods Name Description addHit(newHit: T extends HitDetail): number Add a new hit to the list. compare(hit1: HitDetail | undefined, hit2: HitDetail | undefined): -1 | 1 | 0 compare two hits for insertion into list. dropNulls(): void empty(): void getCurrentHit(): T extends HitDetail | undefined getHit(hitNum: number): T extends HitDetail | undefined Get a hit from a particular index into a HitList getNextHit(): T extends HitDetail | undefined insertHit(i: number, hit: T extends HitDetail): void Insert a new hit into the list at the supplied index. removeCurrentHit(): void remove the current hit from the list. removeHit(hitNum: number): void remove a hit in the list. removeHitsFrom(sourceId: string): boolean search through list and remove any hits that contain a specified element id. resetCurrentHit(): void setCurrentHit(hit: T extends HitDetail): void setHit(i: number, p: T extends HitDetail | undefined): void When setting one or more indices to undefined you must call dropNulls afterwards Properties Name Type Description currHit number hits T extends HitDetail[] length Accessor ReadOnly number Defined in core/frontend/src/HitDetail.ts Line 367 Last Updated: 13 June, 2024