Class PrintUtils


  • public class PrintUtils
    extends Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int INDENT_WIDTH
      Each indentation will be 2 spaces wide.
    • Field Detail

      • INDENT_WIDTH

        public static final int INDENT_WIDTH
        Each indentation will be 2 spaces wide.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PrintUtils

        public PrintUtils​(PrintWriter writer)
    • Method Detail

      • printAVPairs

        public void printAVPairs​(Map avPairs)
        Prints AV Pairs with no indentation. this method calls the toString method of the objects which are in the Map.
        Parameters:
        avPairs - which contains a Map of attribute value pairs that should be printed.
      • printAVPairs

        public void printAVPairs​(Map avPairs,
                                 int indentLevel)
        Prints AV Pairs with the specified indent level. Actual indentation will be (indentLevel * INDENT_WIDTH). this method calls the toString method of the objects which are in the Map.
        Parameters:
        avPairs - which contains a Map of attribute value pairs that should be printed
        indentLevel - the int value which specifies the width of the indent.
      • printSet

        public void printSet​(Set set)
        Prints the contents of a Set with no indentation this method calls the toString method of the objects which are in the set.
        Parameters:
        set - which contains a set of objects that should be printed.
      • printSet

        public void printSet​(Set set,
                             int indentLevel)
        Prints the contents of a Set with the specified indent level. Actual indentation will be (indentLevel * INDENT_WIDTH). this method calls the toString method of the objects which are in the set.
        Parameters:
        set - which contains a set of objects that should be printed
        indentLevel - the int value which specifies the width of the indent.
      • printIndent

        public void printIndent​(int indentLevel)
        This method prints the indent based on the value of the indentLevel.
        Parameters:
        indentLevel - the int value which specifies the size of the indent.