A leaderboard helper for a single recognition period: pages through ranked results and looks up the current user's own ranking, caching each lookup so repeated calls do not re-run the underlying query.
Properties
| Property | Returns | Description |
|---|---|---|
| resultForCurrentUser | RecognitionPeriodResult | The current user's own result within this period, if they have one. |
| results | List<RecognitionPeriodResult> | The first page (up to 100) of ranked results for this period, cached after the first call - see the paged and highestResults overloads, which share this same cache, so whichever is called first determines what every subsequent call on this instance returns. |
Methods
getResults()
Returns: List<RecognitionPeriodResult>
The first page (up to 100) of ranked results for this period, cached after the first call - see the paged and highestResults overloads, which share this same cache, so whichever is called first determines what every subsequent call on this instance returns.
getResults(int startPos, int pageSize)
Returns: List<RecognitionPeriodResult>
A page of ranked results for this period, cached after the first call on this instance - a later call with different arguments (or a call to highestResults) still returns the first page that was actually loaded, since the underlying cache is shared and only loads once.
| Parameter | Description |
|---|---|
startPos | the zero-based index of the first result to return |
pageSize | the maximum number of results to return |
highestResults(int num)
Returns: List<RecognitionPeriodResult>
The highest-ranked results for this period, up to a maximum count, cached after the first call on this instance - shares its cache with the getResults overloads, so whichever of these methods is called first on this instance determines what every subsequent call returns, regardless of the arguments given.
| Parameter | Description |
|---|---|
num | the maximum number of results to return |
getResultForCurrentUser()
Returns: RecognitionPeriodResult
The current user's own result within this period, if they have one.
findResult(BaseEntity participant)
Returns: RecognitionPeriodResult
Finds a specific participant's result within this period.
| Parameter | Description |
|---|---|
participant | the participant to find the result for |