Package org.apache.lucene.facet.facetset
Class IntFacetSet
java.lang.Object
org.apache.lucene.facet.facetset.FacetSet
org.apache.lucene.facet.facetset.IntFacetSet
A
FacetSet
which encodes integer dimension values.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIntFacetSet
(int... values) Constructs a new instance of a facet set which storesint
dimension values. -
Method Summary
Modifier and TypeMethodDescriptionlong[]
Returns the dimension values in this facet set as comparable longs.int
packValues
(byte[] buf, int start) Packs the dimension values into the givenbyte[]
and returns the number of packed-values bytes.int
Returns the size of the packed values in this facet set.
-
Field Details
-
values
public final int[] valuesThe raw dimension values of this facet set.
-
-
Constructor Details
-
IntFacetSet
public IntFacetSet(int... values) Constructs a new instance of a facet set which storesint
dimension values.
-
-
Method Details
-
getComparableValues
public long[] getComparableValues()Description copied from class:FacetSet
Returns the dimension values in this facet set as comparable longs.- Specified by:
getComparableValues
in classFacetSet
-
packValues
public int packValues(byte[] buf, int start) Description copied from class:FacetSet
Packs the dimension values into the givenbyte[]
and returns the number of packed-values bytes. The default implementation packs thecomparable values
, and you can override to implement your own scheme.- Overrides:
packValues
in classFacetSet
-
sizePackedBytes
public int sizePackedBytes()Description copied from class:FacetSet
Returns the size of the packed values in this facet set. If the value is unknown in advance (e.g. if the values are compressed), this method can return an upper limit. The default implementations returnsdims * Long.BYTES
per the default implementation ofFacetSet.packValues(byte[], int)
. You should override if you implementFacetSet.packValues(byte[], int)
differently.- Overrides:
sizePackedBytes
in classFacetSet
-