## org.apache.lucene.facet.search
Class FacetArrays

    java.lang.Object
      org.apache.lucene.facet.search.FacetArrays

Direct Known Subclasses:
  ReusingFacetArrays

    public class FacetArrays

extends Object

Provider of arrays used for facets aggregation. Returns either an `int[]` or `float[]` of the specified array length. When the arrays are no longer needed, you should call `free()`, so that e.g. they will be reclaimed.

NOTE: if you need to reuse the allocated arrays between search requests, use `ReusingFacetArrays`.

NOTE: this class is not thread safe. You typically allocate it per search.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Field Summary
`int` `arrayLength`

Constructor Summary
`FacetArrays(int arrayLength)` Arrays will be allocated at the specified length.

Method Summary
`protected void` `doFree(float[] floats, int[] ints)`
`void` `free()` Notifies that the arrays obtained from `getIntArray()` or `getFloatArray()` are no longer needed and can be freed.
`float[]` `getFloatArray()`
`int[]` `getIntArray()`
`protected float[]` `newFloatArray()`
`protected int[]` `newIntArray()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### arrayLength

    public final int arrayLength

Constructor Detail

### FacetArrays

    public FacetArrays(int arrayLength)

  Arrays will be allocated at the specified length.

Method Detail

### newFloatArray

    protected float[] newFloatArray()

### newIntArray

    protected int[] newIntArray()

### doFree

    protected void doFree(float[] floats,
                          int[] ints)

### free

    public final void free()

  Notifies that the arrays obtained from `getIntArray()` or `getFloatArray()` are no longer needed and can be freed.

### getIntArray

    public final int[] getIntArray()

### getFloatArray

    public final float[] getFloatArray()

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.