All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.lucene.analysis.util.CharArraySet Maven / Gradle / Ivy

There is a newer version: 8.11.4
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.lucene.analysis.util;

import java.util.Collection;

/**
 * A simple class that stores Strings as char[]'s in a
 * hash table.  Note that this is not a general purpose
 * class.  For example, it cannot remove items from the
 * set, nor does it resize its hash table to be smaller,
 * etc.  It is designed to be quick to test if a char[]
 * is in the set without the necessity of converting it
 * to a String first.
 *
 * 

* Please note: This class implements {@link java.util.Set Set} but * does not behave like it should in all cases. The generic type is * {@code Set}, because you can add any object to it, * that has a string representation. The add methods will use * {@link Object#toString} and store the result using a {@code char[]} * buffer. The same behavior have the {@code contains()} methods. * The {@link #iterator()} returns an {@code Iterator}. * @deprecated This class moved to Lucene-Core module: * {@link org.apache.lucene.analysis.CharArraySet} */ @Deprecated public class CharArraySet extends org.apache.lucene.analysis.CharArraySet { /** * Create set with enough capacity to hold startSize terms * * @param startSize * the initial capacity * @param ignoreCase * false if and only if the set should be case sensitive * otherwise true. */ public CharArraySet(int startSize, boolean ignoreCase) { super(startSize, ignoreCase); } /** * Creates a set from a Collection of objects. * * @param c * a collection whose elements to be placed into the set * @param ignoreCase * false if and only if the set should be case sensitive * otherwise true. */ public CharArraySet(Collection c, boolean ignoreCase) { super(c, ignoreCase); } }