This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Collections framework: why not also containsNone
Posted by Steven Tolkin on April 24, 2000 at 5:39 PM
The Java 2 collections framework seems pretty well thought out. But the interface does not have method containsNone. These would permit certain relationships to be detected fast, e.g. that sets are not disjoint. For example s1.containsNone(s2) will return false as soon as one common element is detected, showing they are not disjoint. I do not think there is a way for me to extend the interface in a way that will have this high performance property because I do not have access to the implementation. This must be done by Javasoft (or others writing their own implementation, e.g. the Gnu http://www.classpath.org project).
Replies:
|