Package uk.ac.starlink.table.join
Interface LinkSet
-
public interface LinkSet
Holds a collection of uniqueRowLink
objects. The set is understood to be mutable - that is the methods (includingiterator().remove()
should not throwUnsupportedOperationException
s.Although its methods are very similar to those of a
Set
, this is not aSet
implementation. This is because it will have a pretty specialised use - in particular you should usually treat it as though it may contain a very large number of elements and hence think carefully about efficiency of access methods rather than take advantage of the convenience methods available in the Collections package.- Since:
- 7 Sep 2005
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLink(RowLink link)
Adds a new link to this set.boolean
containsLink(RowLink link)
Indicates whether this set contains a given link.java.util.Iterator
iterator()
Returns an iterator over the elements of this set.boolean
removeLink(RowLink link)
Removes an existing link from this set.int
size()
Returns the number of items in this set.boolean
sort()
Requests that the set become sorted.
-
-
-
Method Detail
-
addLink
void addLink(RowLink link)
Adds a new link to this set. If the set has any existing entries equivalent tolink
(byequals
) they should be removed.- Parameters:
link
- row link to add
-
containsLink
boolean containsLink(RowLink link)
Indicates whether this set contains a given link.- Parameters:
link
- link to test- Returns:
- true iff this set contains an entry equal to
link
-
removeLink
boolean removeLink(RowLink link)
Removes an existing link from this set.- Parameters:
link
- link to remove- Returns:
- true iff
link
was there in the first place
-
iterator
java.util.Iterator iterator()
Returns an iterator over the elements of this set.- Returns:
- iterator, which should have a working
remove()
method
-
size
int size()
Returns the number of items in this set.- Returns:
- set size
-
sort
boolean sort()
Requests that the set become sorted. Subsequent to this operation, and before any other modification operations are performed, theiterator()
method should return an iterator which iterates over the entries in their natural (Comparator
) order. If an implementation is not capable of this action though, it may just return false and do nothing.- Returns:
- true iff a subsequent iterator will be sorted
-
-