uk.ac.starlink.ttools.cone
Class LimitRowSink

java.lang.Object
  extended by uk.ac.starlink.ttools.cone.LimitRowSink
All Implemented Interfaces:
uk.ac.starlink.table.TableSink

public class LimitRowSink
extends 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
LimitRowSink(uk.ac.starlink.table.TableSink base, long maxrow)
          Constructor.
 
Method Summary
 void acceptMetadata(uk.ac.starlink.table.StarTable table)
           
 void acceptRow(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(Object[] row)
               throws IOException
Specified by:
acceptRow in interface uk.ac.starlink.table.TableSink
Throws:
IOException

endRows

public void endRows()
             throws IOException
Specified by:
endRows in interface uk.ac.starlink.table.TableSink
Throws:
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


Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.