public abstract class Named extends Element
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name
The name attribute of a Named element.
|
Modifier | Constructor and Description |
---|---|
protected |
Named()
Creates a default Named element with no name.
|
protected |
Named(java.lang.String name)
Creates a Named element with the given name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Reports whether this Named element is equal to another object.
|
java.lang.String |
getName()
Returns the name of a Named element.
|
int |
hashCode()
Returns a quasi-unique hash code for this named element.
|
Named |
setName(java.lang.String name)
Sets the name of a Named element.
|
Named |
setName(java.lang.String name,
boolean obligatory)
Sets the name of a Named element to an obligatory name.
|
java.lang.String |
toString()
Converts this Named element to a printable representation.
|
safeEquals, safeHashCode, semanticError
protected Named()
protected Named(java.lang.String name)
name
- the name.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other object.public int hashCode()
hashCode
in class java.lang.Object
public Named setName(java.lang.String name)
name
- the name to set.SemanticError
- if this Named element is renamed.public Named setName(java.lang.String name, boolean obligatory)
name
- the name to set.obligatory
- the value true.SemanticError
- if this Named element has another name.public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object