public class CategoryContainer extends java.lang.Object implements java.lang.Iterable<CategoryAttribute>, java.io.Serializable
CategoryDocumentBuilder.setCategories(Iterable)
. Categories can be
added with Properties.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<CategoryPath,CategoryAttribute> |
map |
Constructor and Description |
---|
CategoryContainer()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
CategoryAttribute |
addCategory(CategoryAttribute categoryAttribute)
Add an entire
CategoryAttribute . |
CategoryAttribute |
addCategory(CategoryPath categoryPath)
Add a category.
|
CategoryAttribute |
addCategory(CategoryPath categoryPath,
CategoryProperty... properties)
Add a category with multiple properties.
|
CategoryAttribute |
addCategory(CategoryPath categoryPath,
CategoryProperty property)
Add a category with a property.
|
void |
clear()
Remove all categories.
|
protected void |
deserializeCategoryAttribute(java.io.ObjectInputStream in)
De-Serialize each of the
CategoryAttribute s from the given
ObjectInputStream . |
boolean |
equals(java.lang.Object o) |
CategoryAttribute |
getCategoryAttribute(CategoryPath categoryPath)
Get the
CategoryAttribute this container has for a certain
category, or null if the category is not in the container. |
int |
hashCode() |
java.util.Iterator<CategoryAttribute> |
iterator() |
void |
merge(CategoryContainer other)
Add the categories from another
CategoryContainer to this one. |
protected void |
serializeCategoryAttribute(java.io.ObjectOutputStream out,
CategoryAttribute ca)
Serialize each of the
CategoryAttribute s to the given
ObjectOutputStream .NOTE: CategoryProperty s are Serializable , but do not
assume that Lucene's Attribute s are as well |
int |
size()
Get the number of categories in the container.
|
java.lang.String |
toString() |
protected transient java.util.Map<CategoryPath,CategoryAttribute> map
public CategoryAttribute addCategory(CategoryPath categoryPath)
categoryPath
- The path of the category.CategoryAttribute
of the category.public CategoryAttribute addCategory(CategoryPath categoryPath, CategoryProperty property)
categoryPath
- The path of the category.property
- The property to associate to the category.CategoryAttribute
of the category.public CategoryAttribute addCategory(CategoryPath categoryPath, CategoryProperty... properties)
categoryPath
- The path of the category.properties
- The properties to associate to the category.CategoryAttribute
of the category.public CategoryAttribute addCategory(CategoryAttribute categoryAttribute)
CategoryAttribute
.categoryAttribute
- The CategoryAttribute
to add.CategoryAttribute
of the category (could be different
from the one provided).public CategoryAttribute getCategoryAttribute(CategoryPath categoryPath)
CategoryAttribute
this container has for a certain
category, or null
if the category is not in the container.categoryPath
- The category path of the requested category.public java.util.Iterator<CategoryAttribute> iterator()
iterator
in interface java.lang.Iterable<CategoryAttribute>
public void clear()
public void merge(CategoryContainer other)
CategoryContainer
to this one.public int size()
public java.lang.String toString()
toString
in class java.lang.Object
protected void serializeCategoryAttribute(java.io.ObjectOutputStream out, CategoryAttribute ca) throws java.io.IOException
CategoryAttribute
s to the given
ObjectOutputStream
.CategoryProperty
s are Serializable
, but do not
assume that Lucene's Attribute
s are as welljava.io.IOException
protected void deserializeCategoryAttribute(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
CategoryAttribute
s from the given
ObjectInputStream
.java.io.IOException
java.lang.ClassNotFoundException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.