class PrettyPrinterXtend1 {
public static val DecimalFormat INT_FORMAT = new DecimalFormat("00");
def public static dispatch String prettyPrint(Integer intValue) {
return "Integer: " + INT_FORMAT.format(intValue);
}
def public static dispatch String prettyPrint(Rectangle it) {
if (width == height) {
return "Square with side=" + width;
}
"Rect with width=" + width + " and height=" + height;
}
def public static dispatch String prettyPrint(Void object) {
"<null>"
}
def public static dispatch String prettyPrint(Object object) {
"Object: " + object;
}
}