public abstract class RowLink extends Object implements Comparable<RowLink>
RowRefs
which are considered in some way linked to each other.
Although it doesn't implement the SortedSet interface
(being immutable this wouldn't gain you much) its spirit is that of
a sorted set - its equals and hashCode methods
are implemented such that two RowLinks which contain
equivalent groups of RowRef objects are considered the same.
This makes RowLink instances suitable for use
as keys in hashes that should not contain duplicate entries for
duplicate links.
Note: The getRef method
must return RowRefs
in their natural (Comparable) order.
| Constructor and Description |
|---|
RowLink() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(RowLink other)
Comparison order compares first table (if present in both objects)
first, etc.
|
static RowLink |
createLink(Collection<RowRef> refs)
Returns a RowLink instance for a given collection of RowRefs.
|
boolean |
equals(Object o)
Assesses equality.
|
abstract RowRef |
getRef(int i)
Returns the
ith row ref in this ordered
sequence of refs. |
int |
hashCode()
Returns a hash code which is consistent with the
equals method. |
abstract int |
size()
Returns the number of rows linked by this object.
|
String |
toString() |
public abstract int size()
public abstract RowRef getRef(int i)
ith row ref in this ordered
sequence of refs. The sequence must be as defined by
RowRef.compareTo.i - indexipublic boolean equals(Object o)
RowLink objects are equal if they
contain equivalent sets of RowRefs.public int hashCode()
equals method. Since RowLinks are immutable,
this is only calculated once, for efficiency.public int compareTo(RowLink other)
compareTo in interface Comparable<RowLink>public static RowLink createLink(Collection<RowRef> refs)
RowLinkN constructor.refs - row refsCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.