Package org.apache.lucene.facet.facetset
Class FacetSet
- java.lang.Object
-
- org.apache.lucene.facet.facetset.FacetSet
-
- Direct Known Subclasses:
DoubleFacetSet
,FloatFacetSet
,IntFacetSet
,LongFacetSet
public abstract class FacetSet extends Object
Holds a set of facet dimension values.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description int
dims
The number of dimension values in this set.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FacetSet(int dims)
Constructs a new instance of a facet set with the given number of dimensions.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract long[]
getComparableValues()
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
sizePackedBytes()
Returns the size of the packed values in this facet set.
-
-
-
Method Detail
-
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.
-
-