Class AlignedTypesDatabaseTSTImpl
java.lang.Object
ca.phon.alignedTypesDatabase.AlignedTypesDatabaseTSTImpl
- All Implemented Interfaces:
AlignedTypesDatabaseImpl,Serializable
public final class AlignedTypesDatabaseTSTImpl
extends Object
implements Serializable, AlignedTypesDatabaseImpl
AlignedTypesDatabase implementation using TernaryTree as a backend.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlignedTypes(String[] tierNames, String[] types) voidaddAlignedTypes(Map<String, String> alignedTypes) Add aligned types to the database.voidaddAlignment(String tierName, String type, String alignedTierName, String alignedType) voidca.hedlund.tst.TernaryTreeNode<Collection<ca.phon.alignedTypesDatabase.TypeEntry>> addTypeForTier(String tierName, String type) Add type for specified tiervoidaddUserTier(String tierName) Adds a user tier to the list of tiers in the database Tier data type is assumed to be TierStringalignedTypesForTier(String tierName, String type) Return a set of aligned types given a tier name and type that exists for that tier.alignedTypesForTier(String tierName, String type, List<String> tierList) Return a set of aligned types given a tier name and type that exists for that tier.booleanalignmentExists(String tierName, String tierVal, String linkedTier, String linkedVal) Is there a link between the two tier valuesbooleanhasAlignedTypes(String[] tierNames, String[] rowVals) booleanhasAlignedTypes(Map<String, String> alignedTypes) voidimportDatabase(AlignedTypesDatabase importDb) Import all entries from given database into this database.booleanremoveAlignedTypes(String[] tierNames, String[] types) booleanremoveAlignedTypes(Map<String, String> alignedTypes) booleanremoveAlignment(String tierName, String type, String alignedTierName, String alignedType) Remove the link between two tier values.voidbooleanremoveType(String type) booleantypeExists(String type) booleantypeExistsInTier(String type, String tier) typeIterator(Predicate<String> filter) typesContaining(String infix, boolean caseSensitive, Predicate<String> filter) typesForTier(String keyTier) Return all types for given keyTiertypesWithPrefix(String prefix, boolean caseSensitive, Predicate<String> filter) typesWithSuffix(String suffix, boolean caseSensitive, Predicate<String> filter)
-
Method Details
-
addUserTier
Adds a user tier to the list of tiers in the database Tier data type is assumed to be TierString- Specified by:
addUserTierin interfaceAlignedTypesDatabaseImpl- Parameters:
tierName-
-
addTypeForTier
public ca.hedlund.tst.TernaryTreeNode<Collection<ca.phon.alignedTypesDatabase.TypeEntry>> addTypeForTier(String tierName, String type) Add type for specified tier- Throws:
IllegalStateException- if unable to add tier name or type to database
-
addAlignedTypes
Add aligned types to the database. This method will add each type as a key in the database and setup tier links as necessary.- Specified by:
addAlignedTypesin interfaceAlignedTypesDatabaseImpl- Parameters:
alignedTypes- a map of tierName -> types which will be added to the database
-
addAlignedTypes
- Specified by:
addAlignedTypesin interfaceAlignedTypesDatabaseImpl
-
addAlignment
- Specified by:
addAlignmentin interfaceAlignedTypesDatabaseImpl
-
removeAlignedTypes
- Specified by:
removeAlignedTypesin interfaceAlignedTypesDatabaseImpl
-
removeAlignedTypes
- Specified by:
removeAlignedTypesin interfaceAlignedTypesDatabaseImpl
-
alignedTypesForTier
Return a set of aligned types given a tier name and type that exists for that tier.- Specified by:
alignedTypesForTierin interfaceAlignedTypesDatabaseImpl- Parameters:
tierName-type-- Returns:
- a map of aligned tier values for the given tier and type
-
alignedTypesForTier
public Map<String,String[]> alignedTypesForTier(String tierName, String type, List<String> tierList) Return a set of aligned types given a tier name and type that exists for that tier.- Specified by:
alignedTypesForTierin interfaceAlignedTypesDatabaseImpl- Parameters:
tierName-type-tierList-- Returns:
- a map of aligned tier values for the given tier and type
-
tierNames
- Specified by:
tierNamesin interfaceAlignedTypesDatabaseImpl
-
getTierInfo
- Specified by:
getTierInfoin interfaceAlignedTypesDatabaseImpl
-
typesForTier
Return all types for given keyTier- Specified by:
typesForTierin interfaceAlignedTypesDatabaseImpl- Parameters:
keyTier-- Returns:
- all types which appear for the given keyTier
-
typeExists
- Specified by:
typeExistsin interfaceAlignedTypesDatabaseImpl
-
removeType
- Specified by:
removeTypein interfaceAlignedTypesDatabaseImpl
-
typeExistsInTier
- Specified by:
typeExistsInTierin interfaceAlignedTypesDatabaseImpl
-
alignmentExists
public boolean alignmentExists(String tierName, String tierVal, String linkedTier, String linkedVal) Is there a link between the two tier values- Specified by:
alignmentExistsin interfaceAlignedTypesDatabaseImpl- Parameters:
tierName-tierVal-linkedTier-linkedVal-
-
removeAlignment
public boolean removeAlignment(String tierName, String type, String alignedTierName, String alignedType) Remove the link between two tier values. If all links for the tier are removed, the type is also removed for that tier- Specified by:
removeAlignmentin interfaceAlignedTypesDatabaseImpl- Parameters:
tierName-type-alignedTierName-alignedType-- Returns:
- true if link was removed
-
hasAlignedTypes
- Specified by:
hasAlignedTypesin interfaceAlignedTypesDatabaseImpl
-
hasAlignedTypes
- Specified by:
hasAlignedTypesin interfaceAlignedTypesDatabaseImpl
-
importDatabase
Import all entries from given database into this database.- Parameters:
importDb-
-
addDatabaseListener
- Specified by:
addDatabaseListenerin interfaceAlignedTypesDatabaseImpl
-
removeDatabaseListener
- Specified by:
removeDatabaseListenerin interfaceAlignedTypesDatabaseImpl
-
typesWithPrefix
- Specified by:
typesWithPrefixin interfaceAlignedTypesDatabaseImpl
-
typesContaining
- Specified by:
typesContainingin interfaceAlignedTypesDatabaseImpl
-
typesWithSuffix
- Specified by:
typesWithSuffixin interfaceAlignedTypesDatabaseImpl
-
typeIterator
- Specified by:
typeIteratorin interfaceAlignedTypesDatabaseImpl
-