pylucene 3.5.0-3
[pylucene.git] / lucene-java-3.5.0 / lucene / contrib / facet / src / java / org / apache / lucene / facet / index / attributes / CategoryProperty.java
1 package org.apache.lucene.facet.index.attributes;
2
3 import java.io.Serializable;
4
5 import org.apache.lucene.facet.index.CategoryContainer;
6
7 /**
8  * Licensed to the Apache Software Foundation (ASF) under one or more
9  * contributor license agreements.  See the NOTICE file distributed with
10  * this work for additional information regarding copyright ownership.
11  * The ASF licenses this file to You under the Apache License, Version 2.0
12  * (the "License"); you may not use this file except in compliance with
13  * the License.  You may obtain a copy of the License at
14  *
15  *     http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23
24 /**
25  * Property that can be added to {@link CategoryAttribute}s during indexing.
26  * Note that properties are put in a map and could be shallow copied during
27  * {@link CategoryAttributeImpl#clone()}, therefore reuse of
28  * {@link CategoryProperty} objects is not recommended. Also extends
29  * {@link Serializable}, making the {@link CategoryContainer} serialization more
30  * elegant.
31  * 
32  * @lucene.experimental
33  */
34 public interface CategoryProperty extends Serializable {
35
36   /**
37    * When adding categories with properties to a certain document, it is
38    * possible that the same category will be added more than once with
39    * different instances of the same property. This method defined how to
40    * treat such cases, by merging the newly added property into the one
41    * previously added. Implementing classes can assume that this method will
42    * be called only with a property of the same class.
43    * 
44    * @param other
45    *            The category property to merge.
46    * @throws UnsupportedOperationException
47    *             If merging is prohibited for this property.
48    */
49   public void merge(CategoryProperty other)
50       throws UnsupportedOperationException;
51 }