Class PhonoCategory

  • All Implemented Interfaces:
    XMLDatatype

    public class PhonoCategory
    extends FeaturalXMLDatatype
    Creates the equivalent of a row on the IPA chart.
    Author:
    alex
    • Constructor Detail

      • PhonoCategory

        public PhonoCategory​(java.lang.String name,
                             java.util.ArrayList<PhonoCell> cells,
                             int index)
        Creates a phono category at a given index inside the table for already created list
        Parameters:
        name - The name of the category
        cells - a preƫxisting ArrayList of each cell
        index - the index of the row in reference to the table it is a part of
      • PhonoCategory

        public PhonoCategory​(java.lang.String name,
                             java.util.ArrayList<PhonoCell> cells)
        Creates phono category for already created list
        Parameters:
        name - the name of the category
        cells - a pre-existing ArrayList of each cell
      • PhonoCategory

        public PhonoCategory​(java.lang.String name)
        Creates phono category for as-of-yet created list
        Parameters:
        name - the name of the category
      • PhonoCategory

        public PhonoCategory​(org.w3c.dom.Element e)
                      throws InvalidXMLException
        Creates a phono category from an XML node
        Parameters:
        e - The XML element of the row
        Throws:
        InvalidXMLException - when the given XML is invalid
      • PhonoCategory

        public PhonoCategory​(PhonoCategory pc)
        Copy constructor
        Parameters:
        pc - The PhonoCategory to be copied
    • Method Detail

      • getCells

        public java.util.ArrayList<PhonoCell> getCells()
        Gets list of all cells in category
        Returns:
        all cells in category
      • getName

        public java.lang.String getName()
        Gets category name
        Returns:
        category name
      • getCell

        public PhonoCell getCell​(int i)
        Gets cell at index i
        Parameters:
        i - index
        Returns:
        cell
      • removeCell

        public void removeCell​(int i)
        Deletes cell
        Parameters:
        i - index of cell to be deleted
      • addCell

        public void addCell​(PhonoCell phonoCell)
        Adds cell to end of list
        Parameters:
        phonoCell - the cell to be added
      • getIndex

        public int getIndex()
        Gets the index relative to the table the PhonoCategory is a part of
        Returns:
        The index in question
      • setIndex

        public void setIndex​(int index)
        Sets the index of the PhonoCategory inside the PhonoTable
        Parameters:
        index - The index to be used
      • size

        public int size()
        Returns the amount of cells in a phono category
        Returns:
        The amount of cells
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toXML

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

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