FileDocCategorySizeDatePackage
PrefixPrinter.javaAPI DocAndroid 5.1 API1462Thu Mar 12 22:22:10 GMT 2015android.util

PrefixPrinter

public class PrefixPrinter extends Object implements Printer
PrefixPrinter is a Printer which prefixes all lines with a given prefix.
hide

Fields Summary
private final Printer
mPrinter
private final String
mPrefix
Constructors Summary
private PrefixPrinter(Printer printer, String prefix)

        mPrinter = printer;
        mPrefix = prefix;
    
Methods Summary
public static Printercreate(Printer printer, java.lang.String prefix)
Creates a new PrefixPrinter.

If prefix is null or empty, the provided printer is returned, rather than making a prefixing printer.

        if (prefix == null || prefix.equals("")) {
            return printer;
        }
        return new PrefixPrinter(printer, prefix);
    
public voidprintln(java.lang.String str)

        mPrinter.println(mPrefix + str);