Class PMRCharacterDataImpl

java.lang.Object
org.episteme.natural.chemistry.loaders.cml.dom.pmr.PMRNodeImpl
org.episteme.natural.chemistry.loaders.cml.dom.pmr.PMRCharacterDataImpl
All Implemented Interfaces:
CharacterData, Node
Direct Known Subclasses:
PMRCommentImpl, PMRTextImpl

public class PMRCharacterDataImpl extends PMRNodeImpl implements CharacterData
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • PMRCharacterDataImpl

      public PMRCharacterDataImpl()
      Creates a new PMRCharacterDataImpl object.
    • PMRCharacterDataImpl

      public PMRCharacterDataImpl(CharacterData cd, PMRDocument doc)
      Creates a new PMRCharacterDataImpl object.
      Parameters:
      cd - the generic W3C character data to delegate to
      doc - the owner CML document
  • Method Details

    • deleteData

      public void deleteData(int i, int j)
      Deletes a range of characters from the node.
      Specified by:
      deleteData in interface CharacterData
      Parameters:
      i - the character offset at which to start deleting
      j - the number of characters to delete
    • getData

      public String getData()
      Returns the character data of the node.
      Specified by:
      getData in interface CharacterData
      Returns:
      the character data
    • substringData

      public String substringData(int i, int j)
      Returns a specified substring of the character data.
      Specified by:
      substringData in interface CharacterData
      Parameters:
      i - the offset of the first character to extract
      j - the number of characters to extract
      Returns:
      the specified substring
    • appendData

      public void appendData(String s)
      Appends a string to the end of the character data.
      Specified by:
      appendData in interface CharacterData
      Parameters:
      s - the string to append
    • setData

      public void setData(String s)
      Sets the new character data for the node.
      Specified by:
      setData in interface CharacterData
      Parameters:
      s - the new character data
    • getLength

      public int getLength()
      Returns the number of characters in the node.
      Specified by:
      getLength in interface CharacterData
      Returns:
      the character count
    • replaceData

      public void replaceData(int i, int j, String s)
      Replaces a range of characters with a new string.
      Specified by:
      replaceData in interface CharacterData
      Parameters:
      i - the offset at which to start replacing
      j - the number of characters to replace
      s - the replacement string
    • insertData

      public void insertData(int i, String s)
      Inserts a string at the specified offset.
      Specified by:
      insertData in interface CharacterData
      Parameters:
      i - the character offset at which to insert
      s - the string to insert