One important note about usage is that two of the name components (prefix and local name) HAVE to have been interned some way, as all comparisons are done using identity comparison; whereas URI is NOT necessarily interned.
Note that the main reason this class is mutable -- unlike most key classes -- is that this allows reusing key objects for access, as long as the code using it knows ramifications of trying to modify a key that's used in a data structure.
Note, too, that the hash code is cached as this class is mostly used as a Map key, and hash code is used a lot.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile int | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(PrefixedName
the object to be compared. other)Implements java. Compares this object with the specified object for order. |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public String | |
| public int | |
| public boolean | Returns: True, if this attribute name would result in a namespace binding (ie. it's "xmlns" or starts with "xmlns:").
|
| public boolean | isXmlReservedAttr(boolean nsAware, String localName)
Method used to check for xml reserved attribute names, like "xml:space" and "xml:id". |
| public PrefixedName | |
| public String | |
| public static PrefixedName |
| mHash | back to summary |
|---|---|
| pack-priv volatile int mHash | |
| mLocalName | back to summary |
|---|---|
| private String mLocalName | |
| mPrefix | back to summary |
|---|---|
| private String mPrefix | |
| PrefixedName | back to summary |
|---|---|
| public PrefixedName(String prefix, String localName) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(PrefixedName other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getLocalName | back to summary |
|---|---|
| public String getLocalName() | |
| getPrefix | back to summary |
|---|---|
| public String getPrefix() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isaNsDeclaration | back to summary |
|---|---|
public boolean isaNsDeclaration()
| |
| isXmlReservedAttr | back to summary |
|---|---|
| public boolean isXmlReservedAttr(boolean nsAware, String localName) Method used to check for xml reserved attribute names, like "xml:space" and "xml:id". Note it is assumed that the passed-in localName is also interned. | |
| reset | back to summary |
|---|---|
| public PrefixedName reset(String prefix, String localName) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| valueOf | back to summary |
|---|---|
| public static PrefixedName valueOf(QName n) | |