java - fj.data.Set comparison -
in java.util
, can use containsall
method compare 2 java.util.set
. what's best way compare 2 fj.data.set
?
is there "valuable" benefit of using fj
on java.util
?
i have never used library nor ever, looking through api found method
public final boolean subsetof(set<a> s)
returns true if set subset of given set.
parameters:
s
- set superset of set if method returns true.returns:
true
if set subset of given set.
i believe should used "reversed" containsall
:
a.containsall(b)
true
i.f.f. b.subsetof(a)
true
(not sure how equal sets handled, guess it's fine).
afterthought: noticed how fishy wording in javadoc is. parameter description dependent on output: a superset of set if method returns true. you're not supposed assume on parameter or use conditional it. better wording along lines of: a set checked being superset.
Comments
Post a Comment