# Uses of Interface
org.apache.lucene.util.Attribute

Packages that use Attribute
Package
Description
org.apache.lucene.analysis.tokenattributes
General-purpose attributes for text analysis.
org.apache.lucene.search
Code to search indices.
org.apache.lucene.util
Some utility classes.

- ## Uses of Attribute in org.apache.lucene.analysis.tokenattributes

  Subinterfaces of Attribute in org.apache.lucene.analysis.tokenattributes
  Modifier and Type
  Interface
  Description
  `interface`
  `BytesTermAttribute`
  This attribute can be used if you have the raw term bytes to be indexed.
  `interface`
  `CharTermAttribute`
  The term text of a Token.
  `interface`
  `FlagsAttribute`
  This attribute can be used to pass different flags down the `Tokenizer` chain, e.g.
  `interface`
  `KeywordAttribute`
  This attribute can be used to mark a token as a keyword.
  `interface`
  `OffsetAttribute`
  The start and end character offset of a Token.
  `interface`
  `PayloadAttribute`
  The payload of a Token.
  `interface`
  `PositionIncrementAttribute`
  Determines the position of this token relative to the previous Token in a TokenStream, used in phrase searching.
  `interface`
  `PositionLengthAttribute`
  Determines how many positions this token spans.
  `interface`
  `SentenceAttribute`
  This attribute tracks what sentence a given token belongs to as well as potentially other sentence specific attributes.
  `interface`
  `TermFrequencyAttribute`
  Sets the custom term frequency of a term within one document.
  `interface`
  `TermToBytesRefAttribute`
  This attribute is requested by TermsHashPerField to index the contents.
  `interface`
  `TypeAttribute`
  A Token's lexical type.
  Classes in org.apache.lucene.analysis.tokenattributes that implement Attribute
  Modifier and Type
  Class
  Description
  `class`
  `BytesTermAttributeImpl`
  Implementation class for `BytesTermAttribute`.
  `class`
  `CharTermAttributeImpl`
  Default implementation of `CharTermAttribute`.
  `class`
  `FlagsAttributeImpl`
  Default implementation of `FlagsAttribute`.
  `final class`
  `KeywordAttributeImpl`
  Default implementation of `KeywordAttribute`.
  `class`
  `OffsetAttributeImpl`
  Default implementation of `OffsetAttribute`.
  `class`
  `PackedTokenAttributeImpl`
  Default implementation of the common attributes used by Lucene: `CharTermAttribute` `TypeAttribute` `PositionIncrementAttribute` `PositionLengthAttribute` `OffsetAttribute` `TermFrequencyAttribute`
  `class`
  `PayloadAttributeImpl`
  Default implementation of `PayloadAttribute`.
  `class`
  `PositionIncrementAttributeImpl`
  Default implementation of `PositionIncrementAttribute`.
  `class`
  `PositionLengthAttributeImpl`
  Default implementation of `PositionLengthAttribute`.
  `class`
  `SentenceAttributeImpl`
  Default implementation of `SentenceAttribute`.
  `class`
  `TermFrequencyAttributeImpl`
  Default implementation of `TermFrequencyAttribute`.
  `class`
  `TypeAttributeImpl`
  Default implementation of `TypeAttribute`.

- ## Uses of Attribute in org.apache.lucene.search

  Subinterfaces of Attribute in org.apache.lucene.search
  Modifier and Type
  Interface
  Description
  `interface`
  `BoostAttribute`
  Add this `Attribute` to a `TermsEnum` returned by `MultiTermQuery.getTermsEnum(Terms,AttributeSource)` and update the boost on each returned term.
  `interface`
  `MaxNonCompetitiveBoostAttribute`
  Add this `Attribute` to a fresh `AttributeSource` before calling `MultiTermQuery.getTermsEnum(Terms,AttributeSource)`.
  Classes in org.apache.lucene.search that implement Attribute
  Modifier and Type
  Class
  Description
  `final class`
  `BoostAttributeImpl`
  Implementation class for `BoostAttribute`.
  `final class`
  `MaxNonCompetitiveBoostAttributeImpl`
  Implementation class for `MaxNonCompetitiveBoostAttribute`.

- ## Uses of Attribute in org.apache.lucene.util

  Classes in org.apache.lucene.util that implement Attribute
  Modifier and Type
  Class
  Description
  `class`
  `AttributeImpl`
  Base class for Attributes that can be added to a `AttributeSource`.
  Methods in org.apache.lucene.util with type parameters of type Attribute
  Modifier and Type
  Method
  Description
  `final <T extends Attribute>
  T`
  AttributeSource.`addAttribute(Class<T> attClass)`
  The caller must pass in a Class<? extends Attribute> value.
  `final <T extends Attribute>
  T`
  AttributeSource.`getAttribute(Class<T> attClass)`
  Returns the instance of the passed in Attribute contained in this AttributeSource
  Methods in org.apache.lucene.util that return types with arguments of type Attribute
  Modifier and Type
  Method
  Description
  `final Iterator<Class<? extends Attribute>>`
  AttributeSource.`getAttributeClassesIterator()`
  Returns a new iterator that iterates the attribute classes in the same order they were added in.
  Method parameters in org.apache.lucene.util with type arguments of type Attribute
  Modifier and Type
  Method
  Description
  `abstract AttributeImpl`
  AttributeFactory.`createAttributeInstance(Class<? extends Attribute> attClass)`
  Returns an `AttributeImpl` for the supplied `Attribute` interface class.
  `final AttributeImpl`
  AttributeFactory.StaticImplementationAttributeFactory.`createAttributeInstance(Class<? extends Attribute> attClass)`
  `final boolean`
  AttributeSource.`hasAttribute(Class<? extends Attribute> attClass)`
  The caller must pass in a Class<? extends Attribute> value.
  `void`
  AttributeReflector.`reflect(Class<? extends Attribute> attClass, String key, Object value)`
  This method gets called for every property in an `AttributeImpl`/`AttributeSource` passing the class name of the `Attribute`, a key and the actual value.