Package uk.ac.starlink.table.join
Class RowLinkN
- java.lang.Object
-
- uk.ac.starlink.table.join.RowLink
-
- uk.ac.starlink.table.join.RowLinkN
-
- All Implemented Interfaces:
java.lang.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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 ith row ref in this ordered sequence of refs.int
size()
Returns the number of rows linked by this object.
-
-
-
Constructor Detail
-
RowLinkN
public RowLinkN(java.util.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 Detail
-
size
public int size()
Description copied from class:RowLink
Returns the number of rows linked by this object.
-
getRef
public RowRef getRef(int i)
Description copied from class:RowLink
Returns the ith row ref in this ordered sequence of refs. The sequence must be as defined byRowRef.compareTo
.
-
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
-
-