row.java

来自「关于粗糙集的很好的学习程序」· Java 代码 · 共 96 行

JAVA
96
字号
import java.lang.*;import java.util.Enumeration;import ItemSet;public class Row{  private ItemSet set;  private int support;  Row()  {    set = new ItemSet();    support = 0;  }  Row(ItemSet s)  {    set = new ItemSet(s);    support = 0;  }  Row(Row r)  {    set = new ItemSet(r.getSet());    support = r.getSupport();  }  public boolean equals ( Row obj )  {    return( set.equals(obj.getSet()) );  }  public boolean equals( Object obj )  {    if( obj instanceof Row )      return( this.equals( (Row) obj ) );    else      return( false );  }  ItemSet getSet()  {    return set;  }  int getSupport()  {    return support;  }  void add(Object object)  {    set.add(object);  }  void incSupport()  {    ++support;  }  public String toString()  {    return(""+support+" "+set);  }  //  // this contains super sets of s  //  public void updateSupport(ItemSet s)  {    Object o[] = s.toArray();    support = 0;    for(int i=0; i<o.length; i++){      if( ((ItemSet)o[i]).subsetOf(set) )        ++support;    }  }  //  // this contains sub sets of s  //  public void updateSupportA(ItemSet s)  {    Object o[] = s.toArray();    support = 0;    for(int i=0; i<o.length; i++){      if( set.subsetOf( (ItemSet)o[i] ) )        ++support;    }  }}

⌨️ 快捷键说明

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