wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Opposite of a Union Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Opposite of a Union" Watch "Opposite of a Union" New topic
Author

Opposite of a Union

Noah Le
Greenhorn

Joined: Aug 12, 2003
Posts: 4
I can't remember the term. Can anyone tell me? It's when you take 2 sets of data and only keep data that's in both sets. also, does Java have a function that performs this action?
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
That's called an "intersection". The Java function, in the Set interface, is retainAll().
Union is addAll(). Set subtraction is removeAll().


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Opposite of a Union
 
Similar Threads
Helps need on HTML Table for Ajax
google type next butons
display data page vise
Scrabble... it only takes a minute...
how to add navigation in JSP