Here you can find the source of format(String activity, Object item, Long count, Long total)
public static String format(String activity, Object item, Long count, Long total)
//package com.java2s; //License from project: Open Source License import java.text.MessageFormat; public class Main { public static String format(String activity, Object item, Long count, Long total) { String msg;/* w ww .j a va 2 s . c o m*/ if (count != null) { if (total != null) { msg = MessageFormat.format("{0} {1} ({2} of {3})", activity, item, count, total); } else { msg = MessageFormat.format("{0} {1} ({2})", activity, item, count); } } else { msg = MessageFormat.format("{0} {1}", activity, item); } return msg; } }