Package org.apache.lucene.facet.taxonomy
Class FacetLabel
java.lang.Object
org.apache.lucene.facet.taxonomy.FacetLabel
- All Implemented Interfaces:
Comparable<FacetLabel>
Holds a sequence of string components, specifying the hierarchical name of a category.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Field Summary
Modifier and TypeFieldDescriptionfinal String[]
The components of thisFacetLabel
.final int
The number of components of thisFacetLabel
.static final int
The maximum number of characters aFacetLabel
can have. -
Constructor Summary
ConstructorDescriptionFacetLabel
(String... components) Construct from the given path components.FacetLabel
(String dim, String[] path) Construct from the dimension plus the given path components. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(FacetLabel other) Compares this path with anotherFacetLabel
for lexicographic order.boolean
int
hashCode()
long
Calculate a 64-bit hash function for this path.subpath
(int length) Returns a sub-path of this path up tolength
components.toString()
Returns a string representation of the path.
-
Field Details
-
MAX_CATEGORY_PATH_LENGTH
public static final int MAX_CATEGORY_PATH_LENGTHThe maximum number of characters aFacetLabel
can have.- See Also:
-
components
The components of thisFacetLabel
. Note that this array may be shared with otherFacetLabel
instances, e.g. as a result ofsubpath(int)
, therefore you should traverse the array up tolength
for this path's components. -
length
public final int lengthThe number of components of thisFacetLabel
.
-
-
Constructor Details
-
FacetLabel
Construct from the given path components. -
FacetLabel
Construct from the dimension plus the given path components.
-
-
Method Details
-
compareTo
Compares this path with anotherFacetLabel
for lexicographic order.- Specified by:
compareTo
in interfaceComparable<FacetLabel>
-
equals
-
hashCode
public int hashCode() -
longHashCode
public long longHashCode()Calculate a 64-bit hash function for this path. This is necessary forNameHashIntCacheLRU
(the default cache impl forLruTaxonomyWriterCache
) to reduce the chance of "silent but deadly" collisions. -
subpath
Returns a sub-path of this path up tolength
components. -
toString
Returns a string representation of the path.
-