public abstract class

AttributeImpl

extends Object
implements Serializable Cloneable Attribute
java.lang.Object
   ↳ org.apache.lucene.util.AttributeImpl
Known Direct Subclasses

Class Overview

Base class for Attributes that can be added to a AttributeSource.

Attributes are used to add data in a dynamic, yet type-safe way to a source of usually streamed objects, e. g. a TokenStream.

Summary

Public Constructors
AttributeImpl()
Public Methods
abstract void clear()
Clears the values in this AttributeImpl and resets it to its default value.
Object clone()
Shallow clone.
abstract void copyTo(AttributeImpl target)
Copies the values from this Attribute into the passed-in target attribute.
abstract boolean equals(Object other)
All values used for computation of hashCode() should be checked here for equality.
abstract 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)
String toString()
The default implementation of this method accesses all declared fields of this object and prints the values in the following syntax:
   public String toString() {
     return "start=" + startOffset + ",end=" + endOffset;
   }
 
This method may be overridden by subclasses.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AttributeImpl ()

Public Methods

public abstract 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 Object clone ()

Shallow clone. Subclasses must override this if they need to clone any members deeply,

public abstract 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 abstract boolean equals (Object other)

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

public abstract 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 String toString ()

The default implementation of this method accesses all declared fields of this object and prints the values in the following syntax:

   public String toString() {
     return "start=" + startOffset + ",end=" + endOffset;
   }
 
This method may be overridden by subclasses.