Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.3 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javolution.xml
Class QName

    java.lang.Object
      javolution.xml.QName

All Implemented Interfaces:
  java.io.Serializable, java.lang.CharSequence, Immutable, XMLSerializable

    public final class QName

extends java.lang.Object
implements XMLSerializable, Immutable, java.lang.CharSequence

This class represents unique identifiers for XML elements (tags) or attributes (names).

It should be noted that `QName.valueOf(null, "name")` and `QName.valueOf("", "name")` are distinct; the first one has no namespace associated with; whereas the second is associated to the root namespace.

`QName` have a textual representation (`CharSequence`) which is either the local name (if no namespace URI) or `{namespaceURI}localName` (otherwise).

Version:
  5.3, January 14, 2007
Author:
  Jean-Marie Dautelle
See Also:
  Wikipedia: QName, Serialized Form

Method Summary
`char` | `charAt(int index)` Returns the character at the specified index.
`boolean` | `equals(java.lang.Object obj)` Instances of this class are unique; object's equality can be replaced object identity (`==`).
`java.lang.CharSequence` | `getLocalName()` Returns the local part of this qualified name or the full qualified name if there is no namespace.
`java.lang.CharSequence` | `getNamespaceURI()` Returns the namespace URI of this qualified name or `null` if none (the local name is then the full qualified name).
`int` | `hashCode()` Returns the hash code for this qualified name.
`int` | `length()` Returns the length of this character sequence.
`java.lang.CharSequence` | `subSequence(int start, int end)` Returns a new character sequence that is a subsequence of this sequence.
`java.lang.String` | `toString()` Returns the `String` representation of this qualified name.
`static QName` | `valueOf(java.lang.CharSequence name)` Returns the qualified name corresponding to the specified character sequence representation (may include the "{namespaceURI}" prefix).
`static QName` | `valueOf(java.lang.CharSequence namespaceURI, java.lang.CharSequence localName)` Returns the qualified name corresponding to the specified namespace URI and local name.
`static QName` | `valueOf(java.lang.String name)` Equivalent to `valueOf(CharSequence)` (for J2ME compatibility).

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Method Detail

### valueOf

    public static QName valueOf(java.lang.CharSequence name)

  Returns the qualified name corresponding to the specified character sequence representation (may include the "{namespaceURI}" prefix).

  Parameters:
    `name` - the qualified name lexical representation.
  See Also:
    `toString()`

### valueOf

    public static QName valueOf(java.lang.String name)

  Equivalent to `valueOf(CharSequence)` (for J2ME compatibility).

  Parameters:
    `name` - the qualified name lexical representation.
  See Also:
    `toString()`

### valueOf

    public static QName valueOf(java.lang.CharSequence namespaceURI,
                                java.lang.CharSequence localName)

  Returns the qualified name corresponding to the specified namespace URI and local name.

  Parameters:
    `namespaceURI` - the URI reference or `null` if none.
    `localName` - the local name.
  See Also:
    `toString()`

### getLocalName

    public java.lang.CharSequence getLocalName()

  Returns the local part of this qualified name or the full qualified name if there is no namespace.

  Returns:
    the local name.

### getNamespaceURI

    public java.lang.CharSequence getNamespaceURI()

  Returns the namespace URI of this qualified name or `null` if none (the local name is then the full qualified name).

  Returns:
    the URI reference or `null`

### equals

    public boolean equals(java.lang.Object obj)

  Instances of this class are unique; object's equality can be replaced object identity (`==`).

  Overrides:
    `equals` in class `java.lang.Object`
  Returns:
    `this == obj`

### toString

    public java.lang.String toString()

  Returns the `String` representation of this qualified name.

  Specified by:
    `toString` in interface `java.lang.CharSequence`
  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    the textual representation.

### hashCode

    public int hashCode()

  Returns the hash code for this qualified name.

  Note: Returns the same hashCode as `java.lang.String` (consistent with `equals(java.lang.Object)`)

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    the hash code value.

### charAt

    public char charAt(int index)

  Returns the character at the specified index.

  Specified by:
    `charAt` in interface `java.lang.CharSequence`
  Parameters:
    `index` - the index of the character starting at `0`.
  Returns:
    the character at the specified index of this character sequence.
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `((index < 0) || (index >= length))`

### length

    public int length()

  Returns the length of this character sequence.

  Specified by:
    `length` in interface `java.lang.CharSequence`
  Returns:
    the number of characters (16-bits Unicode) composing this character sequence.

### subSequence

    public java.lang.CharSequence subSequence(int start,
                                              int end)

  Returns a new character sequence that is a subsequence of this sequence.

  Specified by:
    `subSequence` in interface `java.lang.CharSequence`
  Parameters:
    `start` - the index of the first character inclusive.
    `end` - the index of the last character exclusive.
  Returns:
    the character sequence starting at the specified `start` position and ending just before the specified `end` position.
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `(start < 0) || (end < 0) || (start > end) || (end > this.length())`

Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.3 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 - 2009 Javolution.