daniel law wrote:Hmm. Now i have a problem with join tabel L2 oo L2 to find C3 in apriori
OK, lets back up a bit.
You have a bunch of
Items in a
List, and you want to perform all sorts of operations on that
List.
Now in
Java, a
List is an ordered set of objects which
can include "duplicates" (as defined by the
equals() method of the object being stored).
But there are also other forms of collection:
1. A
Set - which is a set of
distinct objects - ie, no "duplicates".
2. A
Map - which is a set of "mappings" of
distinct keys to a "value" (which is usually a single object, but doesn't have to be).
Now
Sets have all sorts of methods to aid Boolean operations - like "inner" and "outer" joins, subsets, and even unions - but, as I said, they are constrained by the "distinct" requirement - ie, they
cannot hold "duplicate" objects.
So it seems to me that you need to define exactly what you want in terms of a
Java collection.
So, just for example (and has already been suggested): if you want to generate counts of Items with a particular category, you might do something like this:
HIH
Winston