Class PhonoSystem


  • public class PhonoSystem
    extends java.lang.Object
    A way to transcribe all sounds allowed in a vocal tract. IPA is specified here as that is a standard for human sounds, however PhonoSystems can be created for non-human sounds as well.
    Author:
    alex
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static PhonoSystem IPA
      Creates an IPA preset.
    • Constructor Summary

      Constructors 
      Constructor Description
      PhonoSystem​(java.io.File file)
      Loads a PhonoSystem object from a file
      PhonoSystem​(java.lang.String name)
      Creates a PhonoSystem object with a blank category list.
      PhonoSystem​(java.lang.String name, java.util.ArrayList<PhonoTable> tables)
      Creates a PhonoSystem object with a pre-defined ArrayList
      PhonoSystem​(java.lang.String name, java.util.ArrayList<PhonoTable> tables, java.util.ArrayList<java.lang.String> diacriticList)  
      PhonoSystem​(PhonoSystem ps)
      Copy constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String value)
      Checks if a given value exists in a phono system.
      boolean equals​(java.lang.Object obj)  
      java.util.ArrayList<java.lang.String> getDiacritics()  
      java.lang.String getName()
      Gets the name of the phono system
      java.lang.String getSound​(int i, int x, int y)
      Allows use of an XY coordinate system to get sounds
      java.util.ArrayList<PhonoTable> getTables()
      Gets an ArrayList of all of the categories added
      static PhonoSystem parse​(Multitag docTag)  
      void removeTable​(java.lang.String name)
      Removes table based off name.
      void setDiacritics​(java.util.ArrayList<java.lang.String> newList)  
      void toFile()
      Creates a file of the PhonoSystem.
      java.lang.String toString()
      Converts a PhonoSystem object to a string
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • IPA

        public static final PhonoSystem IPA
        Creates an IPA preset. Useful when we just want the default PhonoSystem.
    • Constructor Detail

      • PhonoSystem

        public PhonoSystem​(java.lang.String name,
                           java.util.ArrayList<PhonoTable> tables)
        Creates a PhonoSystem object with a pre-defined ArrayList
        Parameters:
        name - The name of the phono system
        tables - The list of all tables used in the phono system
      • PhonoSystem

        public PhonoSystem​(java.lang.String name,
                           java.util.ArrayList<PhonoTable> tables,
                           java.util.ArrayList<java.lang.String> diacriticList)
      • PhonoSystem

        public PhonoSystem​(java.lang.String name)
        Creates a PhonoSystem object with a blank category list. This list will need something added to it to work!
        Parameters:
        name - The name of the phono system
      • PhonoSystem

        public PhonoSystem​(PhonoSystem ps)
        Copy constructor
        Parameters:
        ps - The PhonoSystem to be copied
      • PhonoSystem

        public PhonoSystem​(java.io.File file)
        Loads a PhonoSystem object from a file
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets the name of the phono system
        Returns:
        The name of the phono system
      • getTables

        public java.util.ArrayList<PhonoTable> getTables()
        Gets an ArrayList of all of the categories added
        Returns:
        ArrayList of several PhonoCategory instances
      • removeTable

        public void removeTable​(java.lang.String name)
        Removes table based off name. As this is slower than removing via index, removing via index is preferred.
        Parameters:
        name - Name of category to be removed
      • getSound

        public java.lang.String getSound​(int i,
                                         int x,
                                         int y)
        Allows use of an XY coordinate system to get sounds
        Parameters:
        i - Index of table
        x - Index of category
        y - Index of sound
        Returns:
        The sound at both indexes
      • setDiacritics

        public void setDiacritics​(java.util.ArrayList<java.lang.String> newList)
      • getDiacritics

        public java.util.ArrayList<java.lang.String> getDiacritics()
      • parse

        public static PhonoSystem parse​(Multitag docTag)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Converts a PhonoSystem object to a string
        Overrides:
        toString in class java.lang.Object
      • contains

        public boolean contains​(java.lang.String value)
        Checks if a given value exists in a phono system.
        Parameters:
        value - The value to be checked
        Returns:
        Returns true if value is found in phono system, false if not
      • toFile

        public void toFile()
        Creates a file of the PhonoSystem.
      • equals

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