Class LimitRowSink

  • All Implemented Interfaces:
    uk.ac.starlink.table.TableSink

    public class LimitRowSink
    extends java.lang.Object
    implements uk.ac.starlink.table.TableSink
    TableSink wrapper implementation that truncates the row stream at a given maximum.
    Since:
    7 Nov 2014
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      LimitRowSink​(uk.ac.starlink.table.TableSink base, long maxrow)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void acceptMetadata​(uk.ac.starlink.table.StarTable table)  
      void acceptRow​(java.lang.Object[] row)  
      void endRows()  
      boolean isTruncated()
      Indicates whether this sink has received any rows that it has refused to pass on to its base sink.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LimitRowSink

        public LimitRowSink​(uk.ac.starlink.table.TableSink base,
                            long maxrow)
        Constructor.
        Parameters:
        base - base sink
        maxrow - maximum number of rows this sink will transmit to its base
    • Method Detail

      • acceptMetadata

        public void acceptMetadata​(uk.ac.starlink.table.StarTable table)
                            throws uk.ac.starlink.table.TableFormatException
        Specified by:
        acceptMetadata in interface uk.ac.starlink.table.TableSink
        Throws:
        uk.ac.starlink.table.TableFormatException
      • acceptRow

        public void acceptRow​(java.lang.Object[] row)
                       throws java.io.IOException
        Specified by:
        acceptRow in interface uk.ac.starlink.table.TableSink
        Throws:
        java.io.IOException
      • endRows

        public void endRows()
                     throws java.io.IOException
        Specified by:
        endRows in interface uk.ac.starlink.table.TableSink
        Throws:
        java.io.IOException
      • isTruncated

        public boolean isTruncated()
        Indicates whether this sink has received any rows that it has refused to pass on to its base sink.
        Returns:
        true iff truncation has actually been applied so far