⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itemset.java

📁 粗糙集遗传算法例程
💻 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) );  }*/}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -