org.apache.lucene.analysis.util

## Class CharArraySet

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractSet<Object>
    - - org.apache.lucene.analysis.CharArraySet
      - - org.apache.lucene.analysis.util.CharArraySet

- All Implemented Interfaces:
    Iterable<Object>, Collection<Object>, Set<Object>

  Deprecated.
  This class moved to Lucene-Core module: `CharArraySet`

      @Deprecated
      public class CharArraySet
      extends CharArraySet

  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 `Set` but does not behave like it should in all cases. The generic type is `Set<Object>`, because you can add any object to it, that has a string representation. The add methods will use `Object.toString()` and store the result using a `char[]` buffer. The same behavior have the `contains()` methods. The `CharArraySet.iterator()` returns an `Iterator<char[]>`.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.analysis.CharArraySet

      `EMPTY_SET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CharArraySet(Collection<?> c, boolean ignoreCase)` Deprecated. Creates a set from a Collection of objects.
    `CharArraySet(int startSize, boolean ignoreCase)` Deprecated. Create set with enough capacity to hold startSize terms

  - ### Method Summary

    - ### Methods inherited from class org.apache.lucene.analysis.CharArraySet

      `add, add, add, add, clear, contains, contains, contains, copy, iterator, size, toString, unmodifiableSet`

    - ### Methods inherited from class java.util.AbstractSet

      `equals, hashCode, removeAll`

    - ### Methods inherited from class java.util.AbstractCollection

      `addAll, containsAll, isEmpty, remove, retainAll, toArray, toArray`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Set

      `addAll, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### CharArraySet

          public CharArraySet(int startSize,
                              boolean ignoreCase)

      Deprecated.
      Create set with enough capacity to hold startSize terms
      Parameters:
        `startSize` - the initial capacity
        `ignoreCase` - `false` if and only if the set should be case sensitive otherwise `true`.

    - #### CharArraySet

          public CharArraySet(Collection<?> c,
                              boolean ignoreCase)

      Deprecated.
      Creates a set from a Collection of objects.
      Parameters:
        `c` - a collection whose elements to be placed into the set
        `ignoreCase` - `false` if and only if the set should be case sensitive otherwise `true`.

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.