Class Session

All Implemented Interfaces:
IExtendable

public final class Session extends ExtendableObject
A session, usually recording session, with participants, optional media and transcript. The transcript is a collection of interleaved comments and records. Each record is composed of a number of tiers, with the 'Orthography' tier transcribing a spoken utterance or event.
  • Method Details

    • setSessionPath

      public void setSessionPath(SessionPath sessionPath)
      Set session path relative to project
      Parameters:
      sessionPath - path
    • getSessionPath

      public SessionPath getSessionPath()
      Get session path. If session path has not been set this will be created from the corpus and session name stored in the file.
      Returns:
      sessionPath
    • getCorpus

      public String getCorpus()
      Returns:
      corpus name
    • setCorpus

      public void setCorpus(String corpus)
    • getName

      public String getName()
      Returns:
      session name
    • setName

      public void setName(String name)
    • getDate

      public LocalDate getDate()
      Returns:
      session recording date, may be null
    • setDate

      public void setDate(LocalDate date)
    • getLanguages

      public List<Language> getLanguages()
      Return list of languages contained in the session
      Returns:
      list of session languages
    • setLanguages

      public void setLanguages(List<Language> languages)
    • getMediaLocation

      public String getMediaLocation()
      Get media location. Media location may be an absolute path or a relative path. Relative paths are searched using folder options as setup in the application.
      Returns:
      media location, may be null
    • setMediaLocation

      public void setMediaLocation(String mediaLocation)
    • getMetadata

      public Map<String,String> getMetadata()
      Additional metadata
      Returns:
      session metadata
    • getTierView

      public List<TierViewItem> getTierView()
      Get tier view for session. Tier view controls tier ordering, visiblity, font, and locked status. Tier view includes both default tiers and user-defined tiers.
      Returns:
      tier view
    • setTierView

      public void setTierView(List<TierViewItem> view)
      Set tier view for session. Tiew view must include all default tiers along with any user-defined tiers.
      Parameters:
      view -
      Throws:
      IllegalArgumentException - if tier view does not include all necessary tiers
    • getTiers

      public List<TierDescription> getTiers()
      Return a list of tier descriptions which include all system tiers and all user defined tiers.
      Returns:
      list of tiers in session
    • getTier

      public TierDescription getTier(String tierName)
      Return a tier description for the given tier name (may include system tiers)
      Parameters:
      tierName -
      Returns:
      tier description for given tier name or null if not found
    • getSystemTierParameters

      public Map<String,String> getSystemTierParameters(SystemTierType systemTier)
      Get tier parameters for system tier
      Parameters:
      systemTier -
      Returns:
      unmodifiable tier params for given system tier
    • putSystemTierParam

      public void putSystemTierParam(SystemTierType systemTier, String key, String value)
      Set tier parameter for system tier
      Parameters:
      systemTier -
      key -
      value -
    • getUserTierCount

      public int getUserTierCount()
      Get number of user-defined tiers setup in session
      Returns:
      user tier count
    • getUserTier

      public TierDescription getUserTier(String tierName)
      Get tier description from tier name
      Parameters:
      tierName -
      Returns:
      user-define tier description or null if tier was not found
    • getUserTier

      public TierDescription getUserTier(int idx)
      Get tier description for user-defined tier at given index
      Parameters:
      idx -
      Returns:
      user-defined tier description
      Throws:
      ArrayIndexOutOfBoundsException
    • removeUserTier

      public TierDescription removeUserTier(int idx)
      Remove user-defined tier at given idx from the session tier list. Note, this does not remove any tier data from individual records.
      Parameters:
      idx -
      Returns:
      tier description that was removed
      Throws:
      IllegalArgumentException
    • removeUserTier

      public TierDescription removeUserTier(TierDescription tierDescription)
      Remove the user-defined tier description from the session tier list. Note, this does not remove any tier data from individual records.
      Parameters:
      tierDescription -
      Returns:
      tier description that was removed
    • addUserTier

      public void addUserTier(TierDescription tierDescription)
      Add user-defined tier description to end of the session tier list. Note, this does not add the tier to individual records.
      Parameters:
      tierDescription -
      Throws:
      IllegalArgumentException - on tier name conflict
    • addUserTier

      public void addUserTier(int idx, TierDescription tierDescription)
      Add user-defined tier description at specified index in tier list. Note, this does not add the tier to individual records.
      Parameters:
      idx -
      tierDescription -
      Throws:
      ArrayIndexOutOfBoundsException
      IllegalArgumentException - on tier name conflict
    • getUserTiers

      public TierDescriptions getUserTiers()
      Return list of user-defined tier descriptions.
      Returns:
      tier descriptions for user-defined tiers in a wrapper class
    • getTierAlignmentRules

      public List<TierAlignmentRules> getTierAlignmentRules()
      Get the unmodifiable list of tier alignment rules
      Returns:
      list of tier alignment rules
    • getTierAlignmentRules

      public TierAlignmentRules getTierAlignmentRules(String tier1, String tier2)
      Return custom tier alignment rules for given tiers.
      Parameters:
      tier1 -
      tier2 -
      Returns:
      custom tier alignment rules for given tiers or null if none
    • putTierAlignmentRules

      public void putTierAlignmentRules(TierAlignmentRules tierAlignmentRules)
      Set alignment rules for a pair of tiers. If alignment rules already exist for the tuple of tier names they are overwritten.
      Parameters:
      tierAlignmentRules -
    • deleteTierAlignmentRules

      public void deleteTierAlignmentRules(String tier1, String tier2)
      Delete tier alignment rules for a pair of tiers.
      Parameters:
      tier1 -
      tier2 -
    • deleteTierAlignmentRules

      public void deleteTierAlignmentRules(TierAlignmentRules tierAlignmentRules)
      Delete given tier alignment rules
      Parameters:
      tierAlignmentRules -
    • getBlindTiers

      public List<String> getBlindTiers()
      Get list of blind tier names
      Returns:
      blind tier names
    • setBlindTiers

      public void setBlindTiers(List<String> blindTiers)
      Set list of tiers included in blind transcription
      Throws:
      IllegalArgumentException - if any tier name is not in list provided by getTiers()
    • getTranscriberCount

      public int getTranscriberCount()
    • addTranscriber

      public void addTranscriber(Transcriber t)
    • removeTranscriber

      public void removeTranscriber(Transcriber t)
    • removeTranscriber

      public void removeTranscriber(String username)
    • getTranscriber

      public Transcriber getTranscriber(String username)
    • getTranscriber

      public Transcriber getTranscriber(int i)
    • removeTranscriber

      public void removeTranscriber(int i)
    • getTranscribers

      public Transcribers getTranscribers()
    • getParticipantCount

      public int getParticipantCount()
    • addParticipant

      public void addParticipant(Participant participant)
    • addParticipant

      public void addParticipant(int idx, Participant participant)
    • getParticipant

      public Participant getParticipant(int idx)
    • getParticipantIndex

      public int getParticipantIndex(Participant participant)
    • getParticipants

      public Participants getParticipants()
    • removeParticipant

      public void removeParticipant(Participant participant)
    • removeParticipant

      public void removeParticipant(int idx)
    • getTranscript

      public Transcript getTranscript()
      Return session transcript which includes comments, gems and records.
      Returns:
      session transcript
    • getTranscriptText

      public String getTranscriptText(TranscriptElementRange transcriptElementRange)
      Get the text of the specified transcript element index and give range.
      Parameters:
      transcriptElementRange -
      Returns:
      text of transcript element at given index and range or null if not found
      Throws:
      ArrayIndexOutOfBoundsException - if transcriptElementIndex is out of bounds or range is invalid
    • getTranscriptText

      public String getTranscriptText(int transcriptElementIndex, String tier, Range range)
      Get the text of the specified transcript element index and give range.
      Parameters:
      transcriptElementIndex -
      tier -
      range -
      Returns:
      text of transcript element at given index and range or null if not found
      Throws:
      ArrayIndexOutOfBoundsException - if transcriptElementIndex is out of bounds or range is invalid
    • getTimeline

      public IntervalTiers getTimeline()
      Get timeline for session. IntervalTiers is a collection of intervals for each tier in the session.
      Returns:
      timeline
    • getRecords

      public Records getRecords()
      Return Records wrapper object allowing for enumeration of records
      Returns:
      records wrapper object
    • addRecord

      public void addRecord(Record record)
    • getRecordElementIndex

      public int getRecordElementIndex(int recordIndex)
    • getRecordElementIndex

      public int getRecordElementIndex(Record record)
    • addRecord

      public void addRecord(int recordIndex, Record record)
    • removeRecord

      public void removeRecord(Record record)
    • removeRecord

      public void removeRecord(int recordIndex)
    • getRecord

      public Record getRecord(int recordIndex)
    • getRecordCount

      public int getRecordCount()
    • getRecordIndex

      public int getRecordIndex(Record record)
    • setRecordIndex

      public void setRecordIndex(Record record, int recordIndex)