Package org.apache.lucene.facet.facetset
Class FacetSet
java.lang.Object
org.apache.lucene.facet.facetset.FacetSet
- Direct Known Subclasses:
DoubleFacetSet
,FloatFacetSet
,IntFacetSet
,LongFacetSet
Holds a set of facet dimension values.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
FacetSet
(int dims) Constructs a new instance of a facet set with the given number of dimensions. -
Method Summary
Modifier and TypeMethodDescriptionabstract long[]
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
-
dims
public final int dimsThe number of dimension values in this set.
-
-
Constructor Details
-
FacetSet
protected FacetSet(int dims) Constructs a new instance of a facet set with the given number of dimensions.
-
-
Method Details
-
getComparableValues
public abstract long[] getComparableValues()Returns the dimension values in this facet set as comparable longs. -
packValues
public int packValues(byte[] buf, int start) 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. -
sizePackedBytes
public int sizePackedBytes()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 ofpackValues(byte[], int)
. You should override if you implementpackValues(byte[], int)
differently.
-