public String toStringByValue(){
  IntArrayList theKeys=new IntArrayList();
  keysSortedByValue(theKeys);
  StringBuffer buf=new StringBuffer();
  buf.append("[");
  int maxIndex=theKeys.size() - 1;
  for (int i=0; i <= maxIndex; i++) {
    int key=theKeys.get(i);
    buf.append(String.valueOf(key));
    buf.append("->");
    buf.append(String.valueOf(get(key)));
    if (i < maxIndex)     buf.append(", ");
  }
  buf.append("]");
  return buf.toString();
}

public String toStringByValue ( ) { IntArrayList theKeys = new IntArrayList ( ) ; keysSortedByValue ( theKeys ) ; StringBuffer buf = new StringBuffer ( ) ; buf . append ( "[" ) ; int maxIndex = theKeys . size ( ) - 1 ; for ( int i = 0 ; i <= maxIndex ; i ++ ) { int key = theKeys . get ( i ) ; buf . append ( String . valueOf ( key ) ) ; buf . append ( "->" ) ; buf . append ( String . valueOf ( get ( key ) ) ) ; if ( i < maxIndex ) buf . append ( ", " ) ; } buf . append ( "]" ) ; return buf . toString ( ) ; }
returns a string representation of the receiver , containing the string representation of each key - value pair , sorted ascending by value , according to natural ordering .
