Class PhonoCategory
- java.lang.Object
-
- net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
-
- net.oijon.oling.datatypes.phonology.table.PhonoCategory
-
- All Implemented Interfaces:
XMLDatatype
public class PhonoCategory extends FeaturalXMLDatatype
Creates the equivalent of a row on the IPA chart.- Author:
- alex
-
-
Field Summary
-
Fields inherited from class net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
features, level, lowerObj
-
-
Constructor Summary
Constructors Constructor Description PhonoCategory(java.lang.String name)Creates phono category for as-of-yet created listPhonoCategory(java.lang.String name, java.util.ArrayList<PhonoCell> cells)Creates phono category for already created listPhonoCategory(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 listPhonoCategory(PhonoCategory pc)Copy constructorPhonoCategory(org.w3c.dom.Element e)Creates a phono category from an XML node
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCell(PhonoCell phonoCell)Adds cell to end of listbooleanequals(java.lang.Object obj)voidfromXML(org.w3c.dom.Element e)PhonoCellgetCell(int i)Gets cell at index ijava.util.ArrayList<PhonoCell>getCells()Gets list of all cells in categoryintgetIndex()Gets the index relative to the table the PhonoCategory is a part ofjava.lang.StringgetName()Gets category nameprotected voidinitFeatures()voidremoveCell(int i)Deletes cellvoidsetIndex(int index)Sets the index of the PhonoCategory inside the PhonoTableintsize()Returns the amount of cells in a phono categoryjava.lang.StringtoString()org.w3c.dom.ElementtoXML()-
Methods inherited from class net.oijon.oling.datatypes.phonology.feature.FeaturalXMLDatatype
addFeature, applyFeatures, find, getAllPhonemes, getFeatures, removeFeature, setFeature
-
-
-
-
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 categorycells- a preƫxisting ArrayList of each cellindex- 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 categorycells- 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 InvalidXMLExceptionCreates 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:
equalsin classjava.lang.Object
-
toXML
public org.w3c.dom.Element toXML() throws javax.xml.parsers.ParserConfigurationException- Throws:
javax.xml.parsers.ParserConfigurationException
-
fromXML
public void fromXML(org.w3c.dom.Element e) throws InvalidXMLException- Throws:
InvalidXMLException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
initFeatures
protected void initFeatures()
- Specified by:
initFeaturesin classFeaturalXMLDatatype
-
-