Documentation of 'javolution37.javolution.xml.CharacterData' Java class
CharacterData
javolution37.javolution.xml

Class CharacterData

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.CharSequence, Realtime


    public final class CharacterData
    extends RealtimeObject
    implements java.io.Serializable, java.lang.CharSequence

    This class represents a text that is not markup and constitutes the "Character Data" of a XML document.

    During deserialization, instances of this class are generated for character data containing at least one non-whitespace character.

    During serialization, instances of this class are written in a "CDATA" section (

    <![CDATA[...]]>
    ).

    Note: During deserialization, instances of this class are wrappers around the parser characters buffer; therefore immutability is not guarantee.

    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      char charAt(int index)
      Returns the character at the specified index.
      boolean equals(java.lang.Object obj)
      Compares this character data against the specified object for equality.
      char[] getChars()
      Returns the characters source of this character data.
      int hashCode()
      Returns the hash code for this character data.
      int length()
      Returns the length of this character data.
      int offset()
      Returns the index of the first character in this character data.
      java.lang.CharSequence subSequence(int start, int end)
      Returns a subsequence of this character data.
      Text toText()
      Returns the default textual representation of this realtime object.
      static CharacterData valueOf(char[] chars, int offset, int length)
      Returns the character that contains the characters from the specified subarray of characters.
      static CharacterData valueOf(java.lang.CharSequence csq)
      Returns the character data for the specified character sequence (convenience method).
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.CharSequence

        chars, codePoints, toString
    • Method Detail

      • valueOf

        public static CharacterData valueOf(char[] chars,
                                            int offset,
                                            int length)
        Returns the character that contains the characters from the specified subarray of characters.
        Parameters:
        chars - the source of the characters.
        offset - the index of the first character in the data soure.
        length - the length of the text returned.
        Returns:
        the corresponding instance.
        Throws:
        java.lang.IndexOutOfBoundsException - if (offset < 0) || (length < 0) || ((offset + length) > chars.length)
      • valueOf

        public static CharacterData valueOf(java.lang.CharSequence csq)
        Returns the character data for the specified character sequence (convenience method).
        Parameters:
        csq - the character sequence being wrapped.
        Returns:
        the corresponding character data instance.
      • getChars

        public char[] getChars()
        Returns the characters source of this character data.
        Returns:
        the character array.
      • offset

        public int offset()
        Returns the index of the first character in this character data.
        Returns:
        the first character index.
      • length

        public int length()
        Returns the length of this character data.
        Specified by:
        length in interface java.lang.CharSequence
        Returns:
        the number of characters.
      • 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.
        Returns:
        the character at the specified index.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is negative, or index is equal or greater than this.length().
      • subSequence

        public java.lang.CharSequence subSequence(int start,
                                                  int end)
        Returns a subsequence of this character data.
        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:
        a character data subsequence of this one.
        Throws:
        java.lang.IndexOutOfBoundsException - if (start < 0) || (end < 0) || (start > end) || (end > this.length())
      • equals

        public final boolean equals(java.lang.Object obj)
        Compares this character data against the specified object for equality. Returns true if the specified object are both character data having the same character content.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with or null.
        Returns:
        true if that is a character data with the same character content as this one; false otherwise.
      • hashCode

        public final int hashCode()
        Returns the hash code for this character data.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value.
      • toText

        public Text toText()
        Description copied from class: RealtimeObject
        Returns the default textual representation of this realtime object.
        Specified by:
        toText in interface Realtime
        Overrides:
        toText in class RealtimeObject
        Returns:
        the textual representation of this object.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.