# Class RowLinkN

java.lang.Object
uk.ac.starlink.table.join.RowLink
uk.ac.starlink.table.join.RowLinkN

All Implemented Interfaces:
  `Comparable<RowLink>`

Direct Known Subclasses:
  `PairsRowLink`

public class RowLinkN extends RowLink
RowLink implementation for an arbitrary number of RowRefs.

Since:
  1 Sep 2021
Author:
  Mark Taylor

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`RowLinkN(Collection<RowRef> rows)`
Constructs a RowLinkN from a collection of rows.
`protected`
`RowLinkN(RowRef[] rows)`
Constructs a RowLinkN from an array of row refs which is retained and may be modified (sorted) in place.

## Method Summary

Modifier and Type
Method
Description
`static RowLinkN`
`fromModifiableArray(RowRef[] rows)`
Constructs a RowLinkN from an array of row refs which is retained and may be modified (sorted) in place.
`RowRef`
`getRef(int i)`
Returns the `i`th row ref in this ordered sequence of refs.
`int`
`size()`
Returns the number of rows linked by this object.

### Methods inherited from class RowLink

`compareTo, createLink, equals, hashCode, toString`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### RowLinkN

public RowLinkN(Collection<RowRef> rows)
Constructs a RowLinkN from a collection of rows.

Parameters:
  `rows` - collection of row refs, copied and not retained

### RowLinkN

protected RowLinkN(RowRef[] rows)
Constructs a RowLinkN from an array of row refs which is retained and may be modified (sorted) in place. Use with care.

Parameters:
  `rows` - array of rows which is retained and may be modified

## Method Details

### size

public int size()
Description copied from class: `RowLink`
Returns the number of rows linked by this object.

Specified by:
  `size` in class `RowLink`
Returns:
  number of RowRefs

### getRef

public RowRef getRef(int i)
Description copied from class: `RowLink`
Returns the `i`th row ref in this ordered sequence of refs. The sequence must be as defined by `RowRef.compareTo`.

Specified by:
  `getRef` in class `RowLink`
Parameters:
  `i` - index
Returns:
  RowRef at `i`

### fromModifiableArray

public static RowLinkN fromModifiableArray(RowRef[] rows)
Constructs a RowLinkN from an array of row refs which is retained and may be modified (sorted) in place. Calling code should not make subsequent modifications to this array.

Parameters:
  `rows` - array of rows which is retained and may be modified
Returns:
  new RowLink