Interface CategoryAttribute
-
- All Superinterfaces:
org.apache.lucene.util.Attribute
- All Known Implementing Classes:
CategoryAttributeImpl
public interface CategoryAttribute extends org.apache.lucene.util.AttributeAn attribute which contains for a certain category theCategoryPathand additional properties.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddProperty(CategoryProperty property)Add a property.voidclear()Resets this attribute to its initial value: a null category path and no properties.voidclearProperties()Clear all properties.CategoryAttributeclone()Clone thisCategoryAttribute.CategoryPathgetCategoryPath()Returns the value of this attribute: a category path.CategoryPropertygetProperty(Class<? extends CategoryProperty> propertyClass)Get a property of a certain property class.CategoryPropertygetProperty(Collection<Class<? extends CategoryProperty>> propertyClasses)Get a property of one of given property classes.Set<Class<? extends CategoryProperty>>getPropertyClasses()Get all the active property classes.voidremove(Class<? extends CategoryProperty> propertyClass)Remove an property of a certain property class.voidset(CategoryAttribute other)Set the content of thisCategoryAttributefrom anotherCategoryAttributeobject.voidsetCategoryPath(CategoryPath cp)Sets the category path value of this attribute.
-
-
-
Method Detail
-
set
void set(CategoryAttribute other)
Set the content of thisCategoryAttributefrom anotherCategoryAttributeobject.- Parameters:
other- TheCategoryAttributeto take the content from.
-
setCategoryPath
void setCategoryPath(CategoryPath cp)
Sets the category path value of this attribute.- Parameters:
cp- A category path. May not be null.
-
getCategoryPath
CategoryPath getCategoryPath()
Returns the value of this attribute: a category path.- Returns:
- The category path last assigned to this attribute, or null if none has been assigned.
-
addProperty
void addProperty(CategoryProperty property) throws UnsupportedOperationException
Add a property. The property can be later retrieved usinggetProperty(Class)with this property class .
Adding multiple properties of the same class is forbidden.- Parameters:
property- The property to add.- Throws:
UnsupportedOperationException- When attempting to add a property of a class that was added before and merge is prohibited.
-
getProperty
CategoryProperty getProperty(Class<? extends CategoryProperty> propertyClass)
Get a property of a certain property class.- Parameters:
propertyClass- The required property class.- Returns:
- The property of the given class, or null if no such property exists.
-
getProperty
CategoryProperty getProperty(Collection<Class<? extends CategoryProperty>> propertyClasses)
Get a property of one of given property classes.- Parameters:
propertyClasses- The property classes.- Returns:
- A property matching one of the given classes, or null if no such property exists.
-
getPropertyClasses
Set<Class<? extends CategoryProperty>> getPropertyClasses()
Get all the active property classes.- Returns:
- A set containing the active property classes, or
nullif there are no properties.
-
clone
CategoryAttribute clone()
Clone thisCategoryAttribute.- Returns:
- A clone of this
CategoryAttribute.
-
clear
void clear()
Resets this attribute to its initial value: a null category path and no properties.
-
clearProperties
void clearProperties()
Clear all properties.
-
remove
void remove(Class<? extends CategoryProperty> propertyClass)
Remove an property of a certain property class.- Parameters:
propertyClass- The required property class.
-
-