public abstract class AttributeImpl extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, Attribute
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
.
Constructor and Description |
---|
AttributeImpl() |
Modifier and Type | Method and Description |
---|---|
abstract void |
clear()
Clears the values in this AttributeImpl and resets it to its
default value.
|
java.lang.Object |
clone()
Shallow clone.
|
abstract void |
copyTo(AttributeImpl target)
Copies the values from this Attribute into the passed-in
target attribute.
|
abstract boolean |
equals(java.lang.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:
|
java.lang.String |
toString()
The default implementation of this method accesses all declared
fields of this object and prints the values in the following syntax:
|
public abstract void clear()
public java.lang.String toString()
public String toString() { return "start=" + startOffset + ",end=" + endOffset; }This method may be overridden by subclasses.
toString
in class java.lang.Object
public abstract int hashCode()
public int hashCode() { int code = startOffset; code = code * 31 + endOffset; return code; }see also
equals(Object)
hashCode
in class java.lang.Object
public abstract boolean equals(java.lang.Object other)
hashCode()
should be checked here for equality.
see also Object.equals(Object)
equals
in class java.lang.Object
public abstract void copyTo(AttributeImpl target)
public java.lang.Object clone()
clone
in class java.lang.Object
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.