1 package org.apache.lucene.facet.enhancements;
3 import org.apache.lucene.analysis.TokenStream;
5 import org.apache.lucene.facet.enhancements.CategoryEnhancement;
6 import org.apache.lucene.facet.enhancements.params.EnhancementsIndexingParams;
7 import org.apache.lucene.facet.index.attributes.CategoryAttribute;
8 import org.apache.lucene.facet.index.attributes.CategoryProperty;
9 import org.apache.lucene.facet.index.streaming.CategoryListTokenizer;
10 import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
13 * Licensed to the Apache Software Foundation (ASF) under one or more
14 * contributor license agreements. See the NOTICE file distributed with
15 * this work for additional information regarding copyright ownership.
16 * The ASF licenses this file to You under the Apache License, Version 2.0
17 * (the "License"); you may not use this file except in compliance with
18 * the License. You may obtain a copy of the License at
20 * http://www.apache.org/licenses/LICENSE-2.0
22 * Unless required by applicable law or agreed to in writing, software
23 * distributed under the License is distributed on an "AS IS" BASIS,
24 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
26 * limitations under the License.
29 public class CategoryEnhancementDummy3 implements CategoryEnhancement {
31 public static byte[] CATEGORY_TOKEN_BYTES = new byte[] { 5, -1, 33, 8 };
33 public boolean generatesCategoryList() {
37 public String getCategoryListTermText() {
41 public CategoryListTokenizer getCategoryListTokenizer(
42 TokenStream tokenizer, EnhancementsIndexingParams indexingParams,
43 TaxonomyWriter taxonomyWriter) {
47 public byte[] getCategoryTokenBytes(CategoryAttribute categoryAttribute) {
48 return CATEGORY_TOKEN_BYTES;
51 public Object extractCategoryTokenData(byte[] buffer, int offset, int length) {
52 if (length != CATEGORY_TOKEN_BYTES.length) {
53 throw new IllegalArgumentException("unexpected data length "
56 byte[] ret = new byte[length];
57 System.arraycopy(buffer, offset, ret, 0, length);
61 public Class<? extends CategoryProperty> getRetainableProperty() {
66 public boolean equals(Object o) {
67 if (o instanceof CategoryEnhancementDummy3) {
74 public int hashCode() {
75 return super.hashCode();