Package ca.phon.alignedTypesDatabase
Class AlignedTypesDatabase
java.lang.Object
ca.phon.alignedTypesDatabase.AlignedTypesDatabase
- All Implemented Interfaces:
Serializable
A database of types (unique strings) along with the tiers in which they appear
and a list of other types to which they are linked. This database also includes
a list of tiers along with ordering and visibility of those tiers. The visibility
parameter is used by the editor view and will not affect the return values for
the tierNames() or tierInfo() methods.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAlignedTypes
(String[] tierNames, String[] types) void
addAlignedTypes
(Map<String, String> alignedTypes) Add aligned types to the database.void
addAlignment
(String tierName, String type, String alignedTierName, String alignedType) void
void
addUserTier
(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.boolean
alignmentExists
(String tierName, String tierVal, String linkedTier, String linkedVal) Is there a link between the two tier valuesboolean
hasAlignedTypes
(String[] tierNames, String[] rowVals) boolean
hasAlignedTypes
(Map<String, String> alignedTypes) impl()
boolean
removeAlignedTypes
(String[] tierNames, String[] types) Remove alignment from the databaseboolean
removeAlignedTypes
(Map<String, String> alignedTypes) Remove alignment from databaseboolean
removeAlignment
(String tierName, String type, String alignedTierName, String alignedType) Remove the link between two tier values.void
boolean
removeType
(String type) Remove type from databaseboolean
typeExists
(String type) Does the given type exist in the databaseboolean
typeExistsInTier
(String type, String tier) Return an iterator for types in the databasetypeIterator
(Predicate<String> filter) Return an iterator for types in the database using given filtertypesContaining
(String infix) Return an iterator for types which contain infixtypesContaining
(String infix, boolean caseSensitive) typesContaining
(String infix, boolean caseSensitive, Predicate<String> filter) Return an iterator for types which contain infixtypesContaining
(String infix, Predicate<String> filter) typesForTier
(String keyTier) Return all types for given keyTiertypesWithPrefix
(String prefix) Return an iterator for types with given prefixtypesWithPrefix
(String prefix, boolean caseSensitive) typesWithPrefix
(String prefix, boolean caseSensitive, Predicate<String> filter) Return an iterator for types with given prefixtypesWithPrefix
(String prefix, Predicate<String> filter) typesWithSuffix
(String suffix) Return an iterator for types ending with suffixtypesWithSuffix
(String suffix, boolean caseSensitive) typesWithSuffix
(String suffix, boolean caseSensitive, Predicate<String> filter) Return an iterator for types ending with suffixtypesWithSuffix
(String suffix, Predicate<String> filter)
-
Method Details
-
impl
-
addUserTier
Adds a user tier to the list of tiers in the database Tier data type is assumed to be TierString- Parameters:
tierName
-
-
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.- Parameters:
alignedTypes
- a map of tierName -> types which will be added to the database
-
addAlignedTypes
-
addAlignment
-
removeAlignedTypes
Remove alignment from database- Parameters:
alignedTypes
-- Returns:
-
removeAlignedTypes
Remove alignment from the database- Parameters:
tierNames
-types
-- Returns:
-
alignedTypesForTier
Return a set of aligned types given a tier name and type that exists for that tier.- 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.- Parameters:
tierName
-type
-tierList
-- Returns:
- a map of aligned tier values for the given tier and type
-
tierNames
-
getTierInfo
-
typesForTier
Return all types for given keyTier- Parameters:
keyTier
-- Returns:
- all types which appear for the given keyTier
-
typeExists
Does the given type exist in the database- Parameters:
type
-- Returns:
- true if type exists in database (any tier)
-
removeType
Remove type from database- Parameters:
type
-- Returns:
- true if type was removed, false if type does not exist in db
-
typeExistsInTier
-
alignmentExists
public boolean alignmentExists(String tierName, String tierVal, String linkedTier, String linkedVal) Is there a link between the two tier values- 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- Parameters:
tierName
-type
-alignedTierName
-alignedType
-- Returns:
- true if link was removed
-
hasAlignedTypes
-
hasAlignedTypes
-
addDatabaseListener
-
removeDatabaseListener
-
typeIterator
Return an iterator for types in the database- Returns:
- type iterator
-
typeIterator
Return an iterator for types in the database using given filter- Parameters:
filter
-- Returns:
- type iterator for types which pass filter
-
typesWithPrefix
Return an iterator for types with given prefix- Parameters:
prefix
-- Returns:
- type iterator for types with given prefix
-
typesWithPrefix
-
typesWithPrefix
-
typesWithPrefix
Return an iterator for types with given prefix- Parameters:
prefix
-caseSensitive
-filter
-- Returns:
- type iterator for types with given prefix
-
typesContaining
Return an iterator for types which contain infix- Parameters:
infix
-- Returns:
- type iterator for types containing infix
-
typesContaining
-
typesContaining
-
typesContaining
Return an iterator for types which contain infix- Parameters:
infix
-caseSensitive
-filter
-- Returns:
- type iterator for types containing infix
-
typesWithSuffix
Return an iterator for types ending with suffix- Parameters:
suffix
-- Returns:
- iterator for types ending with suffix
-
typesWithSuffix
-
typesWithSuffix
-
typesWithSuffix
Return an iterator for types ending with suffix- Parameters:
suffix
-caseSensitive
-filter
-- Returns:
- iterator for types ending with suffix
-