Exemplo n.º 1
0
 /**
  * Retains the pairs obtained from the Cartesian product of transactions and items
  *
  * @param trans collection of transactions
  * @param item the item
  * @return <code>true</code> if the set set has been changed
  */
 public boolean retainAll(Collection<T> trans, I item) {
   if (isEmpty()) return false;
   if (trans == null || trans.isEmpty() || item == null) {
     clear();
     return true;
   }
   return matrix.retainAll(allTransactions.convert(trans).indices(), itemToIndex(item));
 }
Exemplo n.º 2
0
 /**
  * Retains the pairs obtained from the Cartesian product of transactions and items
  *
  * @param trans the transaction
  * @param items collection of items
  * @return <code>true</code> if the set set has been changed
  */
 public boolean retainAll(T trans, Collection<I> items) {
   if (isEmpty()) return false;
   if (trans == null || items == null || items.isEmpty()) {
     clear();
     return true;
   }
   return matrix.retainAll(transactionToIndex(trans), allItems.convert(items).indices());
 }