org.apache.lucene.facet.index.attributes
Interface CategoryAttribute

All Superinterfaces:
Attribute
All Known Implementing Classes:
CategoryAttributeImpl

public interface CategoryAttribute
extends Attribute

An attribute which contains for a certain category the CategoryPath and additional properties.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Method Summary
 void addProperty(CategoryProperty property)
          Add a property.
 void clear()
          Resets this attribute to its initial value: a null category path and no properties.
 void clearProperties()
          Clear all properties.
 CategoryAttribute clone()
          Clone this CategoryAttribute.
 CategoryPath getCategoryPath()
          Returns the value of this attribute: a category path.
 CategoryProperty getProperty(Class<? extends CategoryProperty> propertyClass)
          Get a property of a certain property class.
 CategoryProperty getProperty(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.
 void remove(Class<? extends CategoryProperty> propertyClass)
          Remove an property of a certain property class.
 void set(CategoryAttribute other)
          Set the content of this CategoryAttribute from another CategoryAttribute object.
 void setCategoryPath(CategoryPath cp)
          Sets the category path value of this attribute.
 

Method Detail

set

void set(CategoryAttribute other)
Set the content of this CategoryAttribute from another CategoryAttribute object.

Parameters:
other - The CategoryAttribute to 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 using getProperty(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 null if there are no properties.

clone

CategoryAttribute clone()
Clone this CategoryAttribute.

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.