java.lang.Object | |
↳ | org.apache.lucene.util.AttributeImpl |
Known Direct Subclasses |
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
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the values in this AttributeImpl and resets it to its
default value.
| |||||||||||
Shallow clone.
| |||||||||||
Copies the values from this Attribute into the passed-in
target attribute.
| |||||||||||
All values used for computation of
hashCode()
should be checked here for equality. | |||||||||||
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)
| |||||||||||
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
|
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.
Shallow clone. Subclasses must override this if they need to clone any members deeply,
Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.
All values used for computation of hashCode()
should be checked here for equality.
see also equals(Object)
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)
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.