Class PhonoCell

    • Constructor Summary

      Constructors 
      Constructor Description
      PhonoCell()
      Creates a blank cell
      PhonoCell​(int index)
      Creates a blank cell at a given index relative to its PhonoCategory
      PhonoCell​(java.util.ArrayList<Phoneme> phonemes, int index)
      Creates a cell from a given list of phonemes
      PhonoCell​(org.w3c.dom.Element e)
      Creates a PhonoCell from an XML element
    • Constructor Detail

      • PhonoCell

        public PhonoCell()
        Creates a blank cell
      • PhonoCell

        public PhonoCell​(int index)
        Creates a blank cell at a given index relative to its PhonoCategory
        Parameters:
        index - The index of this cell inside its PhonoCategory
      • PhonoCell

        public PhonoCell​(java.util.ArrayList<Phoneme> phonemes,
                         int index)
        Creates a cell from a given list of phonemes
        Parameters:
        phonemes - The phonemes to be put into the cell
        index - The index of this cell inside its PhonoCategory
      • PhonoCell

        public PhonoCell​(org.w3c.dom.Element e)
                  throws InvalidXMLException
        Creates a PhonoCell from an XML element
        Parameters:
        e - The XML element to use
        Throws:
        InvalidXMLException - Thrown when the XML element given is malformed
    • Method Detail

      • addSound

        public void addSound​(java.lang.String s)
        Adds a sound from a string, automatically setting the index to be at the end of the cell
        Parameters:
        s - The sound to be added
      • addSound

        public void addSound​(Phoneme p)
        Adds a sound from a phoneme, automatically checking for and fixing index conflicts
        Parameters:
        p - The sound to be added
      • size

        public int size()
        Gets the amount of phonemes in the cell
        Returns:
        The amount of phonemes in the cell
      • getPhonemes

        public java.util.ArrayList<Phoneme> getPhonemes()
        Gets all the phonemes in this cell as an ArrayList
        Returns:
        All of the phonemes in the cell
      • getIndex

        public int getIndex()
        Gets the index of the cell relative to the PhonoCategory
        Returns:
        The index of the cell in the PhonoCategory
      • setIndex

        public void setIndex​(int index)
        Sets the index of the cell relative to the PhonoCategory
        Parameters:
        index - The index of the cell in the PhonoCategory
      • sizeWithoutSpacers

        public int sizeWithoutSpacers()
        For the legacy parser, spacers are required. However, spacers really, really should not be in the XML. This gets the size without spacer chars, to see if this really should be added to the XML at all.
        Returns:
        The size of the cell without spacer characters
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toXML

        public org.w3c.dom.Element toXML()
                                  throws javax.xml.parsers.ParserConfigurationException
        Throws:
        javax.xml.parsers.ParserConfigurationException