org.apache.lucene.analysis

## Class MockUTF16TermAttributeImpl

- java.lang.Object
- - org.apache.lucene.util.AttributeImpl
  - - org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl
    - - org.apache.lucene.analysis.MockUTF16TermAttributeImpl

- All Implemented Interfaces:
    Appendable, CharSequence, Cloneable, CharTermAttribute, TermToBytesRefAttribute, Attribute

      public class MockUTF16TermAttributeImpl
      extends CharTermAttributeImpl

  Extension of `CharTermAttributeImpl` that encodes the term text as UTF-16 bytes instead of as UTF-8 bytes.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static AttributeFactory` | `UTF16_TERM_ATTRIBUTE_FACTORY` Factory that returns an instance of this class for CharTermAttribute

    - ### Fields inherited from class org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl

      `builder`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockUTF16TermAttributeImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BytesRef` | `getBytesRef()`

    - ### Methods inherited from class org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl

      `append, append, append, append, append, append, buffer, charAt, clear, clone, copyBuffer, copyTo, equals, hashCode, length, reflectWith, resizeBuffer, setEmpty, setLength, subSequence, toString`

    - ### Methods inherited from class org.apache.lucene.util.AttributeImpl

      `end, reflectAsString`

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

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

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

      `chars, codePoints`

- - ### Field Detail

    - #### UTF16_TERM_ATTRIBUTE_FACTORY

          public static final AttributeFactory UTF16_TERM_ATTRIBUTE_FACTORY

      Factory that returns an instance of this class for CharTermAttribute

  - ### Constructor Detail

    - #### MockUTF16TermAttributeImpl

          public MockUTF16TermAttributeImpl()

  - ### Method Detail

    - #### getBytesRef

          public BytesRef getBytesRef()

      Specified by:
        `getBytesRef` in interface `TermToBytesRefAttribute`
      Overrides:
        `getBytesRef` in class `CharTermAttributeImpl`

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