1 package org.apache.lucene.facet.index.categorypolicy;
3 import java.io.Serializable;
5 import org.apache.lucene.facet.index.streaming.CategoryParentsStream;
6 import org.apache.lucene.facet.taxonomy.CategoryPath;
9 * Licensed to the Apache Software Foundation (ASF) under one or more
10 * contributor license agreements. See the NOTICE file distributed with
11 * this work for additional information regarding copyright ownership.
12 * The ASF licenses this file to You under the Apache License, Version 2.0
13 * (the "License"); you may not use this file except in compliance with
14 * the License. You may obtain a copy of the License at
16 * http://www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
26 * Filtering category paths in {@link CategoryParentsStream}, where a given
27 * category is added to the stream, and than all its parents are being
28 * added one after the other by successively removing the last component. <br>
29 * That loop should have a stop point - the default approach (excluding the
30 * ROOT) is implemented in {@link DefaultOrdinalPolicy}.
32 * @lucene.experimental
34 public interface PathPolicy extends Serializable {
37 * Check whether a given category path should be added to the stream.
40 * A given category path which is to be tested for stream
42 * @return <code>true</code> if the category path should be added.
43 * <code>false</code> otherwise.
45 public abstract boolean shouldAdd(CategoryPath categoryPath);