Interface Project

All Superinterfaces:
IExtendable
All Known Implementing Classes:
AbstractProject, DesktopProject, LocalProject, ShadowProject

public interface Project extends IExtendable
Minimal interface for a phon Project. Projects are responsible for providing access to corpora and sessions. Implementations are responsible for providing the actual organization of the project data. Additional project functionality is provided by the IExtendable interface. An example is the ProjectResources interface which provides a way to listen access project resources. To use this functionality, do the following:
 Project project = ...;
 ProjectResources projectResources = project.getExtension(ProjectResources.class);
 if(projectResources != null) {
     // do something with project resources
 }
 
All extensions are optional and may not be available for all project types.
  • Method Details

    • getVersion

      String getVersion()
      Project version
      Returns:
      the project version or 'unk' if not known
    • getName

      String getName()
      The name of the project.
      Returns:
      project name
    • getUUID

      UUID getUUID()
      Project UUID UUID for the project
      Returns:
      uuid
    • getCorpusIterator

      Iterator<String> getCorpusIterator()
      Get an iterator over the corpora in this project.
      Returns:
      iterator over corpora
    • hasCorpus

      boolean hasCorpus(String corpus)
      Tests to see if a given corpus exists in the project. This may be faster than calling getCorpusIterator() and checking iteratively.
      Parameters:
      corpus -
      Returns:
      true if the corpus exists, false
    • getCorpusDescription

      String getCorpusDescription(String corpus)
      Get the description of the specified corpus.
      Parameters:
      corpus - the corpus name
    • getSessionIterator

      Iterator<String> getSessionIterator(String corpus)
      Get an iterator over the sessions in the specified corpus.
      Parameters:
      corpus -
      Returns:
      iterator over sessions in the corpus
    • hasSession

      boolean hasSession(String corpus, String session)
      Test if a given session exists in the specified corpus. This method is usually faster than calling getSessionIterator(String) and checking iteratively.
      Parameters:
      corpus - the corpus name
      session - the session name
      Returns:
      true if the session exists, false otherwise
    • getParticipants

      Set<Participant> getParticipants(Collection<SessionPath> sessions)
      Return a set of participants which are found in the given collection of Sessions. The participant objects returned by this method will include the ParticipantHistory extension. Participants from two sessions are considered to be the same if their ids, names and roles match. If the speaker for some records is unidenified, a clone of Participant.UNKOWN will be added in the returned set.
      Parameters:
      sessions -
      Returns:
      a set of participants
    • openSession

      Session openSession(String corpus, String session) throws IOException
      Open the specified session. This will create a new session object with the data currently on the storage device.
      Parameters:
      corpus -
      session -
      Returns:
      the session
      Throws:
      IOException
    • openSession

      Session openSession(String corpus, String session, SessionReader reader) throws IOException
      Open specified session using the provided reader.
      Parameters:
      corpus -
      session -
      reader -
      Returns:
      the session
      Throws:
      IOException