Class RangeCollector<S extends uk.ac.starlink.util.Splittable<S>>

  • All Implemented Interfaces:
    uk.ac.starlink.util.SplitCollector<S,​Range[]>

    public abstract class RangeCollector<S extends uk.ac.starlink.util.Splittable<S>>
    extends java.lang.Object
    implements uk.ac.starlink.util.SplitCollector<S,​Range[]>
    Partial SplitCollector implementation for accumulating range data. The accumulate method should be implemented to submit values to an N-element array of ranges.

    On completion, the mergeRanges(uk.ac.starlink.ttools.plot.Range[], uk.ac.starlink.ttools.plot.Range[]) method may be used to update a supplied Range array with the collected result.

    Since:
    22 Jan 2021
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RangeCollector​(int ndim)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Range[] combine​(Range[] ranges1, Range[] ranges2)  
      Range[] createAccumulator()  
      void mergeRanges​(Range[] ranges0, Range[] ranges1)
      Merges the content of the second range into the first one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface uk.ac.starlink.util.SplitCollector

        accumulate
    • Constructor Detail

      • RangeCollector

        protected RangeCollector​(int ndim)
        Constructor.
        Parameters:
        ndim - number of range objects (data dimensions)
    • Method Detail

      • createAccumulator

        public Range[] createAccumulator()
        Specified by:
        createAccumulator in interface uk.ac.starlink.util.SplitCollector<S extends uk.ac.starlink.util.Splittable<S>,​Range[]>
      • combine

        public Range[] combine​(Range[] ranges1,
                               Range[] ranges2)
        Specified by:
        combine in interface uk.ac.starlink.util.SplitCollector<S extends uk.ac.starlink.util.Splittable<S>,​Range[]>
      • mergeRanges

        public void mergeRanges​(Range[] ranges0,
                                Range[] ranges1)
        Merges the content of the second range into the first one.
        Parameters:
        ranges0 - first input range, modified on exit
        ranges1 - second input range, unmodified on exit