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 TypeMethodDescriptionvoidaddTierListener(TierListener<T> listener) voidclear()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> TgetExtension(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 sessionTierDescriptionReturn 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.booleanhasBlindTranscription(String transcriberId) Does this tier have a blind transcription for given transcriberbooleanReturn true if this tier include subtype delimitersbooleanReturn true if a subtype expression has been specified.booleanhasValue()Has the tier value been setbooleanisBlind()Is tier a blind tier?booleanisBlindTranscriptionUnvalidated(String transcriberId) Is the blind transcription for the given transcriber unvalidatedbooleanIs tier excluded from cross tier alignmentbooleanIs the tier unvalidated, meaning unparseable text has been passed to setText.<T> TputExtension(Class<T> cap, T impl) Add a new extension.<T> TremoveExtension(Class<T> cap) Remove a capability.voidremoveTierListener(TierListener<T> listener) voidsetBlind(boolean blind) Set blind status of this tierbooleansetBlindTranscription(String transcriberId, String text) Set blind transcription using textvoidsetBlindTranscription(String transcriberId, T value) Set blind transcriptionvoidsetFormatter(Formatter<T> formatter) Set formatter used by parse and toString for converting between objects and textbooleanSet the tier text.voidSet value for tier, this will trigger a value changed event if necessaryvoidsetValueForTranscriber(Transcriber transcriber, T value) Set value of the tier while also considering the transcriber.voidsetValueForTranscriber(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:IExtendableReturn all extension types supported- Specified by:
getExtensionsin interfaceIExtendable
-
getExtension
Description copied from interface:IExtendableGet the requested extension if available.- Specified by:
getExtensionin interfaceIExtendable- Returns:
- the capability object or
nullif the cability is not available
-
putExtension
Description copied from interface:IExtendableAdd a new extension.- Specified by:
putExtensionin interfaceIExtendable- Parameters:
cap- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendableRemove a capability.- Specified by:
removeExtensionin interfaceIExtendable- Parameters:
cap- the capability to remove
-