logahawk
Interface Indentor

All Known Implementing Classes:
SimpleIndentor

public interface Indentor

Create the indent String for ArgumentFormatters for use in multi-line results. This should only be used by ArgumentFormatters when they need to output multiple lines of text. The indent should be used on all but the first line in a multi-line response. The first line should have no indent as it will be output after the LogMeta or appended to the results of some other ArgumentFormatter. If any etymologists can tell me whether "Indentor" or "Indenter" is the correct word, I'd appreciate it. (I choose the "or" version because that matched Comparator.)


Method Summary
 String createIndent(int indentLevel)
          Returns the string that should be used for indenting.
 void indent(List<String> values, int indentLevel, boolean indentFirstLine)
          Indents a collection of Strings, replacing the un-indented strings with indented Strings.
 void indent(List<String> values, List<Integer> indentLevels)
          Indents a collection of strings, replacing the un-indented strings with indented Strings of varying indent levels.
 

Method Detail

createIndent

String createIndent(int indentLevel)
Returns the string that should be used for indenting.


indent

void indent(List<String> values,
            int indentLevel,
            boolean indentFirstLine)
Indents a collection of Strings, replacing the un-indented strings with indented Strings. This method is designed to simplify creating a correctly indented multi-line value. You can build the list of Strings without worrying about indenting, pass them to this method to have those Strings correctly indented.

Parameters:
values - It is HIGHLY RECOMMENDED that this collection have O(1) get and set operations.
indentFirstLine - Whether to indent the first line or not. For most uses this will be false, in accordance with the behavior expected by ArgumentFormatter.format(Object, Collection, int)

indent

void indent(List<String> values,
            List<Integer> indentLevels)
Indents a collection of strings, replacing the un-indented strings with indented Strings of varying indent levels. This is similar to indent(List, int, boolean) except that each String is indented a variable number of times AND the first line will be indented (if desired). The index used by the "values" parameter is used to find the indent level in parameter "indentLevels".

Parameters:
values - It is HIGHLY RECOMMENDED that this collection have O(1) get and set operations.