@Override public String toString(){
  if (points == null || points.length() == 0) {
    return idx + "";
  }
  StringBuffer bf=new StringBuffer();
  try {
    bf.append(idx + " p: ");
    ListNode temp;
    for (int i=0; i < points.size(); i++) {
      temp=points.get(i);
      if (i == 0) {
        bf.append("" + temp.idx);
      }
 else {
        bf.append(", " + temp.idx);
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  return bf.toString();
}

@ Override public String toString ( ) { if ( points == null || points . length ( ) == 0 ) { return idx + "" ; } StringBuffer bf = new StringBuffer ( ) ; try { bf . append ( idx + " p: " ) ; ListNode temp ; for ( int i = 0 ; i < points . size ( ) ; i ++ ) { temp = points . get ( i ) ; if ( i == 0 ) { bf . append ( "" + temp . idx ) ; } else { bf . append ( ", " + temp . idx ) ; } } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return bf . toString ( ) ; }
returns a string represention of the node .
