public class AssociationEnhancement extends Object implements CategoryEnhancement
CategoryEnhancement for adding associations data to the index
(categories with AssociationPropertys).| Constructor and Description |
|---|
AssociationEnhancement() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Category enhancements must override
Object.equals(Object), as it is
used in
EnhancementsPayloadIterator.getCategoryData(CategoryEnhancement). |
Object |
extractCategoryTokenData(byte[] buffer,
int offset,
int length)
Get the data of this enhancement from a category token payload.
|
boolean |
generatesCategoryList()
Declarative method to indicate whether this enhancement generates separate
category list.
|
static AssociationProperty |
getAssociationProperty(CategoryAttribute categoryAttribute) |
String |
getCategoryListTermText()
Returns the text of this enhancement's category list term.
|
CategoryListTokenizer |
getCategoryListTokenizer(org.apache.lucene.analysis.TokenStream tokenizer,
EnhancementsIndexingParams indexingParams,
TaxonomyWriter taxonomyWriter)
Get the
CategoryListTokenizer which generates the category list for
this enhancement. |
byte[] |
getCategoryTokenBytes(CategoryAttribute categoryAttribute)
Get the bytes to be added to the category token payload for this
enhancement.
|
Class<? extends CategoryProperty> |
getRetainableProperty()
Get a
CategoryProperty class to be retained when creating
CategoryParentsStream. |
int |
hashCode() |
static boolean |
isAssociationProperty(Class<? extends CategoryProperty> clazz)
For a given class which extends a CategoryProperty, answers whether it is
an instance of AssociationProperty (AP) or not.
|
public static boolean isAssociationProperty(Class<? extends CategoryProperty> clazz)
instanceof. It has two HashSets - one for classes which are
an extension to AP and one for the classes which are not. Whenever a
property class is introduced:
public boolean generatesCategoryList()
CategoryEnhancementgeneratesCategoryList in interface CategoryEnhancementtrue if generates category list, else false.public String getCategoryListTermText()
CategoryEnhancementgetCategoryListTermText in interface CategoryEnhancementpublic CategoryListTokenizer getCategoryListTokenizer(org.apache.lucene.analysis.TokenStream tokenizer, EnhancementsIndexingParams indexingParams, TaxonomyWriter taxonomyWriter)
CategoryEnhancementCategoryListTokenizer which generates the category list for
this enhancement. If CategoryEnhancement.generatesCategoryList() returns false
this method will not be called.getCategoryListTokenizer in interface CategoryEnhancementtokenizer - The input stream containing categories.indexingParams - The indexing params to use.taxonomyWriter - The taxonomy to add categories and get their ordinals.CategoryListTokenizer generating the category list for
this enhancement, with tokenizer as it's input.public byte[] getCategoryTokenBytes(CategoryAttribute categoryAttribute)
CategoryEnhancementNOTE: The returned array is copied, it is recommended to allocate a new one each time.
The bytes generated by this method are the input of
CategoryEnhancement.extractCategoryTokenData(byte[], int, int).
getCategoryTokenBytes in interface CategoryEnhancementcategoryAttribute - The attribute of the category.public static AssociationProperty getAssociationProperty(CategoryAttribute categoryAttribute)
public Object extractCategoryTokenData(byte[] buffer, int offset, int length)
CategoryEnhancement
The input bytes for this method are generated in
CategoryEnhancement.getCategoryTokenBytes(CategoryAttribute).
extractCategoryTokenData in interface CategoryEnhancementbuffer - The payload buffer.offset - The offset of this enhancement's data in the buffer.length - The length of this enhancement's data (bytes).public Class<? extends CategoryProperty> getRetainableProperty()
CategoryEnhancementCategoryProperty class to be retained when creating
CategoryParentsStream.getRetainableProperty in interface CategoryEnhancementCategoryProperty class to be retained when creating
CategoryParentsStream, or null if there is no such
property.public boolean equals(Object o)
CategoryEnhancementObject.equals(Object), as it is
used in
EnhancementsPayloadIterator.getCategoryData(CategoryEnhancement).equals in interface CategoryEnhancementequals in class ObjectCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.