Class PhonoTable
- java.lang.Object
-
- net.oijon.oling.datatypes.phonology.PhonoTable
-
public class PhonoTable extends java.lang.Object
Like an IPA table, but readable in Java- Author:
- alex
-
-
Constructor Summary
Constructors Constructor Description PhonoTable(java.lang.String name, java.util.ArrayList<java.lang.String> columnNames, java.util.ArrayList<PhonoCategory> rows, int soundsPerCell)
Creates a PhonoTablePhonoTable(PhonoTable pt)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dataPerCell()
Gets the amount of data per cellboolean
equals(java.lang.Object obj)
java.util.ArrayList<java.lang.String>
getColumnNames()
Gets a list of all the column namesjava.lang.String
getName()
Gets the name of the PhonoTablePhonoCategory
getRow(int i)
Gets the row in a PhonoTable at index ijava.util.ArrayList<java.lang.String>
getSoundList()
static PhonoTable
parse(Multitag tag)
Parses a PhonoTable from a Multitag.int
size()
Gets the amount of rows in a PhonoTablejava.lang.String
toString()
Converts a PhonoTable to a string
-
-
-
Constructor Detail
-
PhonoTable
public PhonoTable(java.lang.String name, java.util.ArrayList<java.lang.String> columnNames, java.util.ArrayList<PhonoCategory> rows, int soundsPerCell)
Creates a PhonoTable- Parameters:
name
- The name of the PhonoTable (Consonants, Vowels, etc.)columnNames
- The names of the columnsrows
- An ArrayList of all the rows to be addedsoundsPerCell
- How many sounds should be in a cell
-
PhonoTable
public PhonoTable(PhonoTable pt)
Copy constructor- Parameters:
pt
- The PhonoTable to be copied
-
-
Method Detail
-
parse
public static PhonoTable parse(Multitag tag) throws java.lang.Exception
Parses a PhonoTable from a Multitag. Previously this function was a part of PhonoSystem.parse(), however this allows the program to be maintained more easily.- Parameters:
tag
- The tag to parse the PhonoTable from- Returns:
- The PhonoTable stored in the multitag
- Throws:
java.lang.Exception
- Thrown when any data inside the PhonoTable is invalid, for example if soundsPerCell is a non-integer.
-
toString
public java.lang.String toString()
Converts a PhonoTable to a string- Overrides:
toString
in classjava.lang.Object
-
getName
public java.lang.String getName()
Gets the name of the PhonoTable- Returns:
- the name of the PhonoTable
-
size
public int size()
Gets the amount of rows in a PhonoTable- Returns:
- The amount of rows in a PhonoTable
-
getRow
public PhonoCategory getRow(int i)
Gets the row in a PhonoTable at index i- Parameters:
i
- The index number- Returns:
- The row at index i
-
getColumnNames
public java.util.ArrayList<java.lang.String> getColumnNames()
Gets a list of all the column names- Returns:
- The column names
-
dataPerCell
public int dataPerCell()
Gets the amount of data per cell- Returns:
- The amount of sounds per cell
-
getSoundList
public java.util.ArrayList<java.lang.String> getSoundList()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-