# Class LimitRowSink

java.lang.Object
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

Constructors
Constructor
Description
`LimitRowSink(uk.ac.starlink.table.TableSink base, long maxrow)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`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 Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### 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 Details

### 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