Class ResultSeries

  • All Implemented Interfaces:
    Spliterator<nzilbb.ag.Graph>, nzilbb.util.MonitorableSeries<nzilbb.ag.Graph>, nzilbb.util.MonitorableTask

    public class ResultSeries
    extends Object
    implements nzilbb.util.MonitorableSeries<nzilbb.ag.Graph>
    An implementation of Spliterator<Graph> that enumerates fragments corresponding to a search result set.
    Author:
    Robert Fromont robert@fromont.net.nz
    • Method Detail

      • getRunning

        public boolean getRunning()
        Getter for running: Whether the task is currently running.
        Specified by:
        getRunning in interface nzilbb.util.MonitorableTask
        Returns:
        Whether the task is currently running.
      • setRunning

        public void setRunning​(boolean newRunning)
        Setter for running: Whether the task is currently running.
        Parameters:
        newRunning - Whether the task is currently running.
      • getStore

        public SqlGraphStore getStore()
        Getter for store: The graph store object.
        Returns:
        The graph store object.
      • setStore

        public ResultSeries setStore​(SqlGraphStore newStore)
        Setter for store: The graph store object.
        Parameters:
        newStore - The graph store object.
      • getSearchId

        public long getSearchId()
        Getter for searchId: result.search_id key value.
        Returns:
        result.search_id key value.
      • setSearchId

        public ResultSeries setSearchId​(long newSearchId)
        Setter for searchId: result.search_id key value.
        Parameters:
        newSearchId - result.search_id key value.
      • getLayers

        public String[] getLayers()
        Getter for layers: Layers to load into the fragments.
        Returns:
        Layers to load into the fragments.
      • setLayers

        public ResultSeries setLayers​(String[] newLayers)
        Setter for layers: Layers to load into the fragments.
        Parameters:
        newLayers - Layers to load into the fragments.
      • 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 ResultSeries 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 ResultSeries 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.
      • finalize

        public void finalize()
        Finalize method called by the garbage collector.

        This implementation ensures SQL resources are disposed of.

      • hasMoreElements

        public boolean hasMoreElements()
        Tests if this enumeration contains more elements.
      • tryAdvance

        public boolean tryAdvance​(Consumer<? super nzilbb.ag.Graph> action)
        Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
        Specified by:
        tryAdvance in interface Spliterator<nzilbb.ag.Graph>
      • estimateSize

        public long estimateSize()
        Counts the elements in the series, if possible.
        Specified by:
        estimateSize in interface Spliterator<nzilbb.ag.Graph>
        Returns:
        The number of elements in the series, or null if the number is unknown.
      • getPercentComplete

        public Integer getPercentComplete()
        Determines how far through the serialization is.
        Specified by:
        getPercentComplete in interface nzilbb.util.MonitorableTask
        Returns:
        An integer between 0 and 100 (inclusive), or null if progress can not be calculated.
      • cancel

        public void cancel()
        Cancels spliteration; the next call to tryAdvance will return false.
        Specified by:
        cancel in interface nzilbb.util.MonitorableTask