LRUQueryCache.CacheAndCount (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.search, class: LRUQueryCache, class: CacheAndCount

Package org.apache.lucene.search

# Class LRUQueryCache.CacheAndCount

java.lang.Object
org.apache.lucene.search.LRUQueryCache.CacheAndCount

All Implemented Interfaces:
  `Accountable`

Enclosing class:
  `LRUQueryCache`

protected static class LRUQueryCache.CacheAndCount extends Object implements Accountable
Cache of doc ids with a count.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final LRUQueryCache.CacheAndCount`
  `EMPTY`

  ### Fields inherited from interface org.apache.lucene.util.Accountable

  `NULL_ACCOUNTABLE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CacheAndCount(DocIdSet cache, int count)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `count()`
  `DocIdSetIterator`
  `iterator()`
  `long`
  `ramBytesUsed()`
  Returns an estimate of the JVM heap memory used by this object in bytes.

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

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

  ### Methods inherited from interface org.apache.lucene.util.Accountable

  `getChildResources`

- ## Field Details

  - ### EMPTY

    protected static final LRUQueryCache.CacheAndCount EMPTY

- ## Constructor Details

  - ### CacheAndCount

    public CacheAndCount(DocIdSet cache, int count)

- ## Method Details

  - ### iterator

    public DocIdSetIterator iterator() throws IOException
    Throws:
      `IOException`

  - ### count

    public int count()

  - ### ramBytesUsed

    public long ramBytesUsed()
    Description copied from interface: `Accountable`
    Returns an estimate of the JVM heap memory used by this object in bytes. The method name uses "ram" for historical reasons; only JVM heap memory should be reported. Off-heap resources such as memory-mapped files or native direct buffers should not be included. Negative values are illegal.
    Specified by:
      `ramBytesUsed` in interface `Accountable`