public class

FlagsAttributeImpl

extends AttributeImpl
implements Serializable Cloneable FlagsAttribute
java.lang.Object
   ↳ org.apache.lucene.util.AttributeImpl
     ↳ org.apache.lucene.analysis.tokenattributes.FlagsAttributeImpl

Class Overview

This attribute can be used to pass different flags down the tokenizer chain, eg from one TokenFilter to another one.

Summary

Public Constructors
FlagsAttributeImpl()
Public Methods
void clear()
Clears the values in this AttributeImpl and resets it to its default value.
void copyTo(AttributeImpl target)
Copies the values from this Attribute into the passed-in target attribute.
boolean equals(Object other)
All values used for computation of hashCode() should be checked here for equality.
int getFlags()
EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long.
int hashCode()
Subclasses must implement this method and should compute a hashCode similar to this:
   public int hashCode() {
     int code = startOffset;
     code = code * 31 + endOffset;
     return code;
   }
 
see also equals(Object)
void setFlags(int flags)
[Expand]
Inherited Methods
From class org.apache.lucene.util.AttributeImpl
From class java.lang.Object
From interface org.apache.lucene.analysis.tokenattributes.FlagsAttribute

Public Constructors

public FlagsAttributeImpl ()

Public Methods

public void clear ()

Clears the values in this AttributeImpl and resets it to its default value. If this implementation implements more than one Attribute interface it clears all.

public void copyTo (AttributeImpl target)

Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.

public boolean equals (Object other)

All values used for computation of hashCode() should be checked here for equality. see also equals(Object)

public int getFlags ()

EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long.

Get the bitset for any bits that have been set. This is completely distinct from type(), although they do share similar purposes. The flags can be used to encode information about the token for use by other TokenFilters.

Returns
  • The bits

public int hashCode ()

Subclasses must implement this method and should compute a hashCode similar to this:

   public int hashCode() {
     int code = startOffset;
     code = code * 31 + endOffset;
     return code;
   }
 
see also equals(Object)

public void setFlags (int flags)

See Also