@Override public String toString(){
  Map<Value,Double> sortedTable=InferenceUtils.getNBest(table,Math.max(table.size(),1));
  String str="";
  for (  Entry<Value,Double> entry : sortedTable.entrySet()) {
    String prob=StringUtils.getShortForm(entry.getValue());
    str+="P(" + variable + "="+ entry.getKey()+ "):="+ prob+ "\n";
  }
  return (str.length() > 0) ? str.substring(0,str.length() - 1) : str;
}

@ Override public String toString ( ) { Map < Value , Double > sortedTable = InferenceUtils . getNBest ( table , Math . max ( table . size ( ) , 1 ) ) ; String str = "" ; for ( Entry < Value , Double > entry : sortedTable . entrySet ( ) ) { String prob = StringUtils . getShortForm ( entry . getValue ( ) ) ; str += "P(" + variable + "=" + entry . getKey ( ) + "):=" + prob + "\n" ; } return ( str . length ( ) > 0 ) ? str . substring ( 0 , str . length ( ) - 1 ) : str ; }
returns a string representation of the probability table
