Class Tier<T>
java.lang.Object
ca.phon.session.Tier<T>
- All Implemented Interfaces:
IExtendable
A tier in a record with name, parameters, alignment rules and value.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTierListener
(TierListener<T> listener) void
clear()
Clear tier value (set to null)getBlindTranscription
(String transcriberId) Get blind transcription for given transcribergetBlindUnvalidatedValue
(String transcriberId) Get the unvalidated value for the given blind transcriber (if any)<T> T
getExtension
(Class<T> cap) Get the requested extension if available.Return all extension types supportedReturn formatter used by setText and toString for converting between objects and textgetName()
Get subtype delimiters (if any)Get subtype regex.Tier parameters as setup in the sessionTierDescription
Return list of blind transcribers for this tierReturn the unvalidated value for this tier (if set)getValue()
Get tier valuegetValueForTranscriber
(Transcriber transcriber) Get value of the tier while also considering the transcriber.getValueForTranscriber
(String transcriberId) Get value of the tier while also considering the transcriber.boolean
hasBlindTranscription
(String transcriberId) Does this tier have a blind transcription for given transcriberboolean
Return true if this tier include subtype delimitersboolean
Return true if a subtype expression has been specified.boolean
hasValue()
Has the tier value been setboolean
isBlind()
Is tier a blind tier?boolean
isBlindTranscriptionUnvalidated
(String transcriberId) Is the blind transcription for the given transcriber unvalidatedboolean
Is tier excluded from cross tier alignmentboolean
Is the tier unvalidated, meaning unparseable text has been passed to setText.<T> T
putExtension
(Class<T> cap, T impl) Add a new extension.<T> T
removeExtension
(Class<T> cap) Remove a capability.void
removeTierListener
(TierListener<T> listener) void
setBlind
(boolean blind) Set blind status of this tierboolean
setBlindTranscription
(String transcriberId, String text) Set blind transcription using textvoid
setBlindTranscription
(String transcriberId, T value) Set blind transcriptionvoid
setFormatter
(Formatter<T> formatter) Set formatter used by parse and toString for converting between objects and textboolean
Set the tier text.void
Set value for tier, this will trigger a value changed event if necessaryvoid
setValueForTranscriber
(Transcriber transcriber, T value) Set value of the tier while also considering the transcriber.void
setValueForTranscriber
(String transcriberId, T value) Set value of the tier while also considering the transcriber.toString()
Return string representation of tier value
-
Method Details
-
getName
- Returns:
- tier name
-
getDeclaredType
-
getTierParameters
Tier parameters as setup in the sessionTierDescription
- Returns:
- tier parameters
-
isExcludeFromAlignment
public boolean isExcludeFromAlignment()Is tier excluded from cross tier alignment- Returns:
- true if tier is not part of cross tier alignment
-
isBlind
public boolean isBlind()Is tier a blind tier?- Returns:
- true if tier is included in blind transcription
-
setBlind
public void setBlind(boolean blind) Set blind status of this tier- Parameters:
blind
-
-
hasSubtypeDelim
public boolean hasSubtypeDelim()Return true if this tier include subtype delimiters- Returns:
- true if the number of subtype delimiters > 0
-
hasSubtypeExpr
public boolean hasSubtypeExpr()Return true if a subtype expression has been specified.- Returns:
- true if this tier specified a subtype expression
-
getSubtypeDelim
-
getSubtypeExpr
Get subtype regex. Groups in the expression will be used to identify part of the expression to use- Returns:
- subtype expr or null if not set
-
hasBlindTranscription
Does this tier have a blind transcription for given transcriber- Parameters:
transcriberId
-- Returns:
- true if getBlindTranscription(transcriberId) != null
-
isBlindTranscriptionUnvalidated
Is the blind transcription for the given transcriber unvalidated- Parameters:
transcriberId
-- Returns:
- true if the blind transcription has a parse error
-
getBlindUnvalidatedValue
Get the unvalidated value for the given blind transcriber (if any)- Returns:
- unvalidated value for transcriber or null if isBlindTranscription(transcriberId) returns false
-
setBlindTranscription
-
setBlindTranscription
-
getBlindTranscription
-
getTranscribers
-
getFormatter
-
setFormatter
-
setText
Set the tier text. If the text can be parsed into the appropriate object type the tier value will be updated with the new value. If the text cannot be parsed the tier value will be cleared and the tier become unvalidated.- Parameters:
text
-- Returns:
- true if successful, false if text has a parse error
-
isUnvalidated
public boolean isUnvalidated()Is the tier unvalidated, meaning unparseable text has been passed to setText.- Returns:
- boolean
-
getUnvalidatedValue
Return the unvalidated value for this tier (if set)- Returns:
- unvalidated value or null
-
getValue
-
hasValue
public boolean hasValue()Has the tier value been set- Returns:
- true if tier value is not null
-
clear
public void clear()Clear tier value (set to null) -
setValue
Set value for tier, this will trigger a value changed event if necessary- Parameters:
value
-
-
toString
-
setValueForTranscriber
Set value of the tier while also considering the transcriber.- Parameters:
transcriber
-value
-
-
setValueForTranscriber
-
getValueForTranscriber
Get value of the tier while also considering the transcriber.- Parameters:
transcriber
-- Returns:
- value for the tier for the given transcriber if it is a blind tier, otherwise the value of the tier itself.
-
getValueForTranscriber
-
addTierListener
-
removeTierListener
-
getExtensions
Description copied from interface:IExtendable
Return all extension types supported- Specified by:
getExtensions
in interfaceIExtendable
-
getExtension
Description copied from interface:IExtendable
Get the requested extension if available.- Specified by:
getExtension
in interfaceIExtendable
- Returns:
- the capability object or
null
if the cability is not available
-
putExtension
Description copied from interface:IExtendable
Add a new extension.- Specified by:
putExtension
in interfaceIExtendable
- Parameters:
cap
- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendable
Remove a capability.- Specified by:
removeExtension
in interfaceIExtendable
- Parameters:
cap
- the capability to remove
-