Cは型のコレクションでありSet<T>
、F(x)はSetのコレクションを返します。私がやりたいのは、和集合、共通部分、差などの集合間の演算を実行することです。
// C union ( F(X) \ F(Y))
C.addAll( F(X).removeAll( F(Y)))); //error boolean because removeAll returns a boolean
代わりに私はできた
C_aux = new HashSet<T> ( F(X));
C_aux.removeAll( F(Y));
C.addAll( C_aux);
とにかく、補助コレクションを宣言せずにこれを行うには?(ブール値の戻りをスキップ/無視します)