Class LimitRowSink
java.lang.Object
uk.ac.starlink.ttools.cone.LimitRowSink
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptMetadata(uk.ac.starlink.table.StarTable table) voidvoidendRows()booleanIndicates whether this sink has received any rows that it has refused to pass on to its base sink.
-
Constructor Details
-
LimitRowSink
public LimitRowSink(uk.ac.starlink.table.TableSink base, long maxrow) Constructor.- Parameters:
base- base sinkmaxrow- maximum number of rows this sink will transmit to its base
-
-
Method Details
-
acceptMetadata
public void acceptMetadata(uk.ac.starlink.table.StarTable table) throws uk.ac.starlink.table.TableFormatException - Specified by:
acceptMetadatain interfaceuk.ac.starlink.table.TableSink- Throws:
uk.ac.starlink.table.TableFormatException
-
acceptRow
- Specified by:
acceptRowin interfaceuk.ac.starlink.table.TableSink- Throws:
IOException
-
endRows
- Specified by:
endRowsin interfaceuk.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
-