Github user afs commented on a diff in the pull request:
https://github.com/apache/jena/pull/202#discussion_r95061427
--- Diff: jena-base/src/main/java/org/apache/jena/atlas/lib/SetUtils.java
---
@@ -44,13 +42,26 @@ private SetUtils() {}
return s1.stream().anyMatch(s2::contains) ;
}
+ /**
+ * @param s1 a {@link Set}
+ * @param s2 a {@link Set}
+ * @return the eager set-theoretic union of {@code s1} and {@code s2}
+ *
+ * @see org.apache.jena.ext.com.google.common.collect.Sets#union(Set,
Set) for a lazy alternative
+ */
public static <T> Set<T> union(Set<? extends T> s1, Set<? extends T>
s2) {
Set<T> s3 = new HashSet<>(s1) ;
s3.addAll(s2) ;
return s3 ;
}
- /** union difference intersection : those elements in s1 or s2 but not
both. */
+ /**
+ * @param s1 a {@link Set}
+ * @param s2 a {@link Set}
+ * @return eager union difference intersection : those elements in
{@code s1} or {@code s2} but not both
--- End diff --
What does "eager union difference intersection" mean?
The difference is that this one isolates (calculates) the operation so is
safe to future changes, and allows it to be further modified
the google.common one isn't "lazy" as I understand that term because it is
a view (and can change), not a delayed calculation.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---