Class SessionFactory

All Implemented Interfaces:
IExtendable

public final class SessionFactory extends ExtendableObject
A factory for creating session objects.
  • Method Details

    • newFactory

      public static SessionFactory newFactory()
      Create a new session factory.
      Returns:
      factory using first available implementation. null if no implementation found.
    • createSessionPath

      public SessionPath createSessionPath(String path)
      Create a session path object
      Parameters:
      path - of sesion as corpus/session
      Returns:
      session path object
    • createSessionPath

      public SessionPath createSessionPath(String corpus, String session)
      Create new session path
      Parameters:
      corpus - name starting from project location
      session - name including extension
      Returns:
      new session path
    • createSession

      public Session createSession()
      Create a new empty session. Tier view
      Returns:
      a new session object
    • createSession

      public Session createSession(SessionSPI sessionImpl)
    • createSession

      public Session createSession(String corpus, String name)
      Create a new session with the specified corpus and name. Also sets up initial tier view.
      Parameters:
      corpus -
      name -
      Returns:
      the session object
    • createTranscript

      public Transcript createTranscript()
    • setupDefaultTierView

      public void setupDefaultTierView(Session session)
      Setup default tier view for session. As of Phon 4.0 Notes and Segment are not added to the default tier view.
      Parameters:
      session -
    • cloneSession

      public Session cloneSession(Session session)
      Clone given session.
      Parameters:
      session -
      Returns:
      the cloned session
    • copySessionInformation

      public void copySessionInformation(Session session, Session dest)
      Copy session information from one session to the destination. Session information includes:
      • media location
      • session name
      • corpus name
      Parameters:
      session -
      dest -
    • createComment

      public Comment createComment()
      Create empty generic comment
      Returns:
      empty generic comment
    • createComment

      public Comment createComment(TierData value)
      Create generic comment with value
      Parameters:
      value -
      Returns:
      comment
    • createComment

      public Comment createComment(CommentType commentType)
      Create new empty comment of given type
      Parameters:
      commentType -
      Returns:
      comment
    • createComment

      public Comment createComment(CommentType commentType, TierData value)
      Create comment with type and value
      Parameters:
      commentType -
      value -
      Returns:
      new comment
    • createComment

      public Comment createComment(CommentSPI commentImpl)
    • cloneComment

      public Comment cloneComment(Comment comment)
    • createGem

      public Gem createGem()
      Create empty lazy gem
      Returns:
      empty lazy gem
    • createGem

      public Gem createGem(String label)
      Create lazy gem with label
      Parameters:
      label -
      Returns:
      label gem with label
    • createGem

      public Gem createGem(GemType gemType, String label)
      Create gem of given type with label
      Parameters:
      gemType -
      label -
      Returns:
      gem
    • createGem

      public Gem createGem(GemSPI spi)
    • createSessionTranscript

      public Transcript createSessionTranscript()
    • copySessionTierInformation

      public void copySessionTierInformation(Session session, Session dest)
      Copy tier information from one session to another.
      Parameters:
      session -
      dest -
    • createRecord

      public Record createRecord()
      Create a new record.
      Returns:
      a new empty record
    • createRecord

      public Record createRecord(Session session)
      Create a new record for the given session with current blind tier status and tier params setup correctly for system tiers.
      Parameters:
      session -
      Returns:
      new record based on session config
    • createRecord

      public Record createRecord(List<SystemTierType> blindTiers, Map<SystemTierType,Map<String,String>> systemTierParamMap)
      Create a new record with provided system tiers as blind tiers
      Parameters:
      blindTiers -
      Returns:
    • createRecord

      public Record createRecord(RecordSPI recordImpl)
    • createRecord

      public Record createRecord(Participant speaker)
      Create a new record with the specified speaker.
      Parameters:
      speaker -
      Returns:
      the new record
    • createRecord

      public Record createRecord(Session session, Participant speaker)
      Create a new record for given session and speaker
      Parameters:
      session -
      speaker -
      Returns:
      new record
    • cloneRecord

      public Record cloneRecord(Record record)
      Clone the given record.
      Parameters:
      record -
      Returns:
      a new record with the same contents and the given record
    • createParticipant

      public Participant createParticipant()
      Create a new participant object.
      Returns:
      new participant object
    • createParticipant

      public Participant createParticipant(ParticipantSPI participantImpl)
    • createUnknownParticipant

      public Participant createUnknownParticipant()
      Create the unknown participant object.
      Returns:
      a new participant object with values setup for an unknown speaker
    • createAllParticipant

      public Participant createAllParticipant()
    • cloneParticipant

      public Participant cloneParticipant(Participant part)
      Clone participant
      Parameters:
      part -
      Returns:
      cloned participant
    • createTranscriber

      public Transcriber createTranscriber()
      Create a new transcriber object.
      Returns:
      new transcriber
    • createTranscriber

      public Transcriber createTranscriber(TranscriberSPI transcriberImpl)
    • createMediaSegment

      public MediaSegment createMediaSegment()
      Create a new media segment
    • createMediaSegment

      public MediaSegment createMediaSegment(MediaSegmentSPI mediaSegmentImpl)
    • createTier

      public Tier<?> createTier(TierDescription tierDescription)
      Create a new tier object from given description
      Parameters:
      tierDescription -
      Returns:
      tier
    • createTier

      public <T> Tier<T> createTier(String name, Class<T> type)
      Create a new tier object with the specified type and alignment rules
      Type Parameters:
      T -
      Parameters:
      name -
      type -
      Returns:
      the new tier
    • createTier

      public <T> Tier<T> createTier(String name, Class<T> type, Map<String,String> tierParameters, boolean excludeFromAlignment)
      Create a new tier object with the specified type and alignment rules
      Type Parameters:
      T -
      Parameters:
      name -
      type -
      Returns:
      the new tier
    • createTier

      public <T> Tier<T> createTier(String name, Class<T> type, Map<String,String> tierParameters, boolean excludeFromAlignment, boolean blind)
    • createTier

      public <T> Tier<T> createTier(Class<T> type, TierSPI<T> tierImpl)
    • createTier

      public Tier<TierData> createTier(String name)
      Create a new text tier.
      Parameters:
      name -
      Returns:
      the new tier
    • createTierDescription

      public TierDescription createTierDescription(String name)
      Create a new string tier description.
      Parameters:
      name -
      Returns:
      new tier description
    • createTierDescription

      public TierDescription createTierDescription(String name, boolean excludeFromAlignment)
      Create a new string tier description.
      Parameters:
      name -
      excludeFromAlignment -
      Returns:
      new tier description
    • createTierDescription

      public TierDescription createTierDescription(String name, boolean excludeFromAlignment, boolean blind)
    • createTierDescription

      public TierDescription createTierDescription(String name, Class<?> type, Map<String,String> tierParameters)
      Create tier description.
      Parameters:
      name -
      type -
      tierParameters -
      Returns:
      new tier description
    • createTierDescription

      public TierDescription createTierDescription(String name, Class<?> type, Map<String,String> tierParameters, boolean excludeFromAlignment)
      Create tier description.
      Parameters:
      name -
      type -
      tierParameters -
      excludeFromAlignment -
      Returns:
      new tier description
    • createTierDescription

      public TierDescription createTierDescription(String name, Class<?> type, Map<String,String> tierParameters, boolean excludeFromAlignment, boolean blind)
    • createTierDescription

      public TierDescription createTierDescription(String name, Class<?> type, Map<String,String> tierParameters, boolean excludeFromAlignment, boolean blind, List<String> subtypeDelim, String subtypeExpr)
      Create tier description.
      Parameters:
      name -
      type -
      tierParameters -
      excludeFromAlignment -
      blind -
      subtypeDelim -
      subtypeExpr -
      Returns:
      new tier description
    • createTierDescription

      public TierDescription createTierDescription(SystemTierType systemTier)
      Create tier description for system tier
      Parameters:
      systemTier -
      Returns:
      tierDesc
    • createTierDescription

      public TierDescription createTierDescription(UserTierType userTier)
      Create tier description from UserTierType
      Parameters:
      userTier -
      Returns:
      tierDesc
    • createTierDescription

      public TierDescription createTierDescription(SystemTierType systemTier, boolean blind)
    • createTierDescription

      public TierDescription createTierDescription(TierDescriptionSPI tierDescriptionImpl)
    • createTierViewItem

      public TierViewItem createTierViewItem(String name)
      Create a tier display and ordering object
      Parameters:
      name -
      Returns:
    • createTierViewItem

      public TierViewItem createTierViewItem(String name, boolean visible)
      Create a tier display and ordering object
      Parameters:
      name -
      visible -
      Returns:
    • createTierViewItem

      public TierViewItem createTierViewItem(String name, boolean visible, String font)
      Create a tier display and ordering object
      Parameters:
      name -
      visible -
      font -
      Returns:
    • createTierViewItem

      public TierViewItem createTierViewItem(String name, boolean visible, boolean locked)
      Create a tier display and ordering object
      Parameters:
      name -
      visible -
      locked -
      Returns:
    • createTierViewItem

      public TierViewItem createTierViewItem(String name, boolean visible, String font, boolean locked)
      Create a tier display and ordering object
      Parameters:
      name -
      visible -
      font -
      locked -
      Returns:
    • createTierViewItem

      public TierViewItem createTierViewItem(TierViewItemSPI tierViewItemImpl)
    • createDefaultTierView

      public List<TierViewItem> createDefaultTierView(Session session)
      Get the default tier view for a given session.
      Parameters:
      session -
    • createTimeline

      public IntervalTiers createTimeline()
      Create a IntervalTiers object with default values
      Returns:
      new timeline object
    • createTimelineTier

      public IntervalTier createTimelineTier(String name)
      Create a new timeline tier object.
      Parameters:
      name -
      Returns:
      new timeline tier object