public void deleteSelection(ArrayList<Integer> nodes){
  for (int i=0; i < nodes.size(); i++) {
    for (int j=i + 1; j < nodes.size(); j++) {
      if (nodes.get(i) > nodes.get(j)) {
        int h=nodes.get(i);
        nodes.set(i,nodes.get(j));
        nodes.set(j,h);
      }
    }
  }
  if (m_bNeedsUndoAction) {
    addUndoAction(new DeleteSelectionAction(nodes));
  }
  boolean bNeedsUndoAction=m_bNeedsUndoAction;
  m_bNeedsUndoAction=false;
  try {
    for (int iNode=nodes.size() - 1; iNode >= 0; iNode--) {
      deleteNode(nodes.get(iNode));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  m_bNeedsUndoAction=bNeedsUndoAction;
}

public void deleteSelection ( ArrayList < Integer > nodes ) { for ( int i = 0 ; i < nodes . size ( ) ; i ++ ) { for ( int j = i + 1 ; j < nodes . size ( ) ; j ++ ) { if ( nodes . get ( i ) > nodes . get ( j ) ) { int h = nodes . get ( i ) ; nodes . set ( i , nodes . get ( j ) ) ; nodes . set ( j , h ) ; } } } if ( m_bNeedsUndoAction ) { addUndoAction ( new DeleteSelectionAction ( nodes ) ) ; } boolean bNeedsUndoAction = m_bNeedsUndoAction ; m_bNeedsUndoAction = false ; try { for ( int iNode = nodes . size ( ) - 1 ; iNode >= 0 ; iNode -- ) { deleteNode ( nodes . get ( iNode ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } m_bNeedsUndoAction = bNeedsUndoAction ; }
delete nodes with indexes in selection from the network , updating instances , parentsets , distributions conditional distributions are condensed by taking the values for the target node to be its first value . used for manual manipulation of the bayesian network .
