// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.logging; /** * A wrapper for hit counts, modelled after a search system. * Advanced database searches and similar could use these * structures as well. * * @author Steinar Knutsen */ public class HitCounts { // see the javadoc for the accessors for short comments on each field private final int retrievedHits; private final int summaryCount; private final long totalHitCount; private final int requestedHits; private final int requestedOffset; public HitCounts( int retrievedHits, int summaryCount, long totalHitCount, int requestedHits, int requestedOffset) { this.retrievedHits = retrievedHits; this.summaryCount = summaryCount; this.totalHitCount = totalHitCount; this.requestedHits = requestedHits; this.requestedOffset = requestedOffset; } /** * The number of hits returned by the server. * Compare to getRequestedHits(). */ public int getRetrievedHitCount() { return retrievedHits; } /** * The number of hit summaries ("document contents") fetched. */ public int getSummaryCount() { return summaryCount; } /** * The total number of matching hits * for the request. */ public long getTotalHitCount() { return totalHitCount; } /** * The number of hits requested by the user. * Compare to getRetrievedHitCount(). */ public int getRequestedHits() { return requestedHits; } /** * The user requested offset into the linear mapping of the result space. */ public int getRequestedOffset() { return requestedOffset; } }