?? itemset.java
字號:
import java.io.*;import java.lang.*;import java.util.*;public class ItemSet extends HashSet{ ItemSet() { super(); } ItemSet( Collection c ) { super(c); }/* Removed for extends TreeSet public boolean equals( Object o ) { if( o instanceof ItemSet ) return( (this.difference((ItemSet)o)).size() == 0 ); else return( super.equals(o) ); }*//* public Iterator begin() { return this.iterator(); }*/ public ItemSet union(Collection c) { ItemSet set = new ItemSet(this);// set.addAll( ((ItemSet)c).difference(this) ); set.addAll( c ); return set; } public void unionWith(Collection c) { this.addAll(c); } public ItemSet difference(Collection s) { ItemSet set = new ItemSet(this); set.removeAll(s); return set; } public ItemSet intersection(Collection s) { ItemSet set = new ItemSet(this); set.retainAll(s); return set; } public boolean subsetOf(Collection c) { return( c.containsAll(this) ); } public void copy(Collection c) { this.union(c); }/* Removed fore treeset public boolean add(Object c) { if( this.contains(c) ) return false; else return( super.add(c) ); }*/}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -