public void attributeAsClassAt(int columnIndex){
  Reorder reorder;
  String order;
  int i;
  if ((columnIndex > 0) && (columnIndex < getColumnCount())) {
    addUndoPoint();
    try {
      order="";
      for (i=1; i < m_Data.numAttributes() + 1; i++) {
        if (i == columnIndex) {
          continue;
        }
        if (!order.equals("")) {
          order+=",";
        }
        order+=Integer.toString(i);
      }
      if (!order.equals("")) {
        order+=",";
      }
      order+=Integer.toString(columnIndex);
      reorder=new Reorder();
      reorder.setAttributeIndices(order);
      reorder.setInputFormat(m_Data);
      m_Data=Filter.useFilter(m_Data,reorder);
      m_Data.setClassIndex(m_Data.numAttributes() - 1);
    }
 catch (    Exception e) {
      e.printStackTrace();
      undo();
    }
    notifyListener(new TableModelEvent(this,TableModelEvent.HEADER_ROW));
  }
}

public void attributeAsClassAt ( int columnIndex ) { Reorder reorder ; String order ; int i ; if ( ( columnIndex > 0 ) && ( columnIndex < getColumnCount ( ) ) ) { addUndoPoint ( ) ; try { order = "" ; for ( i = 1 ; i < m_Data . numAttributes ( ) + 1 ; i ++ ) { if ( i == columnIndex ) { continue ; } if ( ! order . equals ( "" ) ) { order += "," ; } order += Integer . toString ( i ) ; } if ( ! order . equals ( "" ) ) { order += "," ; } order += Integer . toString ( columnIndex ) ; reorder = new Reorder ( ) ; reorder . setAttributeIndices ( order ) ; reorder . setInputFormat ( m_Data ) ; m_Data = Filter . useFilter ( m_Data , reorder ) ; m_Data . setClassIndex ( m_Data . numAttributes ( ) - 1 ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; undo ( ) ; } notifyListener ( new TableModelEvent ( this , TableModelEvent . HEADER_ROW ) ) ; } }
sets the attribute at the given col index as the new class attribute , i . e . it moves it to the end of the attributes
