public abstract class AttributeImpl extends Object implements Cloneable, 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.
|
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:
|
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 String toString()
public String toString() {
return "start=" + startOffset + ",end=" + endOffset;
}
This method may be overridden by subclasses.public abstract int hashCode()
public int hashCode() {
int code = startOffset;
code = code * 31 + endOffset;
return code;
}
see also equals(Object)public abstract boolean equals(Object other)
hashCode()
should be checked here for equality.
see also Object.equals(Object)public abstract void copyTo(AttributeImpl target)
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.