Class SerializeFragmentsTask

  • All Implemented Interfaces:
    Runnable, nzilbb.util.MonitorableTask

    public class SerializeFragmentsTask
    extends Task
    Task for converting graph fragments.
    Author:
    Robert Fromont robert@fromont.net.nz
    • Method Detail

      • getUtterances

        public List<String> getUtterances()
        Getter for utterances: Collection of utterances to convert.
        Returns:
        Collection of utterances to convert.
      • setUtterances

        public SerializeFragmentsTask setUtterances​(List<String> vNewUtterances)
        Setter for utterances: Collection of utterances to convert.
        Parameters:
        vNewUtterances - Collection of utterances to convert.
      • getLayers

        public Collection<String> getLayers()
        Getter for layers: Layers selected for serialization.
        Returns:
        Layers selected for serialization.
      • setLayers

        public SerializeFragmentsTask setLayers​(Collection<String> newLayers)
        Setter for layers: Layers selected for serialization.
        Parameters:
        newLayers - Layers selected for serialization.
      • getResultDirectory

        public File getResultDirectory()
        ResultDirectory accessor
        Returns:
        Directory into which the resulting zip file should be copied.
      • setResultDirectory

        public SerializeFragmentsTask setResultDirectory​(File fNewResultDirectory)
        ResultDirectory mutator
        Parameters:
        fNewResultDirectory - Directory into which the resulting zip file should be copied.
      • getResultBaseUrl

        public String getResultBaseUrl()
        ResultBaseUrl accessor
        Returns:
        Full base URL for the result - i.e. http://server.name/path/to/result/directory/ - this must not contain the file name and must have a trailing slash.
      • setResultBaseUrl

        public SerializeFragmentsTask setResultBaseUrl​(String sNewResultBaseUrl)
        ResultBaseUrl mutator
        Parameters:
        sNewResultBaseUrl - Full base URL for the result - i.e. http://server.name/path/to/result/directory/ - this must not contain the file name and must have a trailing slash.
      • getMimeType

        public String getMimeType()
        Getter for sMimeType: MIME type for export
        Returns:
        MIME type for export
      • setMimeType

        public SerializeFragmentsTask setMimeType​(String sNewMimeType)
        Setter for sMimeType: MIME type for export
        Parameters:
        sNewMimeType - MIME type for export
      • getBaseUrl

        public String getBaseUrl()
        Getter for baseUrl: Base URL.
        Returns:
        Base URL.
      • setBaseUrl

        public SerializeFragmentsTask setBaseUrl​(String newBaseUrl)
        Setter for baseUrl: Base URL.
        Parameters:
        newBaseUrl - Base URL.
      • getIncludeRequiredLayers

        public boolean getIncludeRequiredLayers()
        Getter for includeRequiredLayers: Whether to include the layers required by the serializer, or only the selected layers.
        Returns:
        Whether to include the layers required by the serializer, or only the selected layers.
      • setIncludeRequiredLayers

        public SerializeFragmentsTask setIncludeRequiredLayers​(boolean newIncludeRequiredLayers)
        Setter for includeRequiredLayers: Whether to include the layers required by the serializer, or only the selected layers.
        Parameters:
        newIncludeRequiredLayers - Whether to include the layers required by the serializer, or only the selected layers.
      • getSearchId

        public long getSearchId()
        Getter for searchId: The search results ID, if all matches are for export - i.e. result.search_id.
        Returns:
        The search results ID, if all matches are for export - i.e. result.search_id.
      • setSearchId

        public SerializeFragmentsTask setSearchId​(long newSearchId)
        Setter for searchId: The search results ID, if all matches are for export - i.e. result.search_id.
        Parameters:
        newSearchId - The search results ID, if all matches are for export - i.e. result.search_id.
      • getCollectionName

        public String getCollectionName()
        Getter for collectionName: Collection Name
        Returns:
        Collection Name
      • setCollectionName

        public SerializeFragmentsTask setCollectionName​(String newCollectionName)
        Setter for collectionName: Collection Name
        Parameters:
        newCollectionName - Collection Name
      • getPrefixNames

        public boolean getPrefixNames()
        Getter for prefixNames: Whether to prefix fragment names with a numeric serial number or not.
        Returns:
        Whether to prefix fragment names with a numeric serial number or not.
      • setPrefixNames

        public SerializeFragmentsTask setPrefixNames​(boolean newPrefixNames)
        Setter for prefixNames: Whether to prefix fragment names with a numeric serial number or not.
        Parameters:
        newPrefixNames - Whether to prefix fragment names with a numeric serial number or not.
      • getTagTarget

        public boolean getTagTarget()
        Getter for tagTarget: Whether to add an tag identifying the target annotation or not.
        Returns:
        Whether to add an tag identifying the target annotation or not.
      • setTagTarget

        public SerializeFragmentsTask setTagTarget​(boolean newTagTarget)
        Setter for tagTarget: Whether to add an tag identifying the target annotation or not.
        Parameters:
        newTagTarget - Whether to add an tag identifying the target annotation or not.
      • run

        public void run()
        Run the export
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • cancel

        public void cancel()
        Description copied from class: Task
        Cancels the task.
        Specified by:
        cancel in interface nzilbb.util.MonitorableTask
        Overrides:
        cancel in class Task
      • getPercentComplete

        public Integer getPercentComplete()
        Description copied from class: Task
        Determines how far through the task is is.
        Specified by:
        getPercentComplete in interface nzilbb.util.MonitorableTask
        Overrides:
        getPercentComplete in class Task
        Returns:
        An integer between 0 and 100 (inclusive), or null if progress can not be calculated.