コード例 #1
0
ファイル: SetUniqueList.java プロジェクト: kaiyuanw/DS-TEST
 /**
  * {@inheritDoc}
  *
  * <p>This implementation iterates over the elements of this list, checking each element in turn
  * to see if it's contained in <code>coll</code>. If it's not contained, it's removed from this
  * list. As a consequence, it is advised to use a collection type for <code>coll</code> that
  * provides a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}.
  */
 @Override
 public boolean retainAll(final Collection<?> coll) {
   boolean result = set.retainAll(coll);
   if (result == false) {
     return false;
   }
   if (set.size() == 0) {
     super.clear();
   } else {
     // use the set as parameter for the call to retainAll to improve performance
     super.retainAll(set);
   }
   return result;
 }
コード例 #2
0
ファイル: SetUniqueList.java プロジェクト: PAMSE/APGBench
 public void clear() {
   super.clear();
   set.clear();
 }
コード例 #3
0
ファイル: SetUniqueList.java プロジェクト: kaiyuanw/DS-TEST
 @Override
 public void clear() {
   super.clear();
   set.clear();
 }