1 7 package org.enhydra.xml; 8 9 10 17 public class Indent { 18 19 22 public static String DEFAULT_TAB = " "; 23 24 27 private int indent; 28 29 32 private String tab; 33 34 35 36 42 public Indent(int ind, String tab) { 43 this.indent = ind; 44 this.tab = tab; 45 } 46 47 48 51 public String toString() { 52 StringBuffer buff = new StringBuffer (); 53 for (int i = 0; i < indent; i++) 54 buff.append(tab); 55 return buff.toString(); 56 } 57 58 59 62 public void increment() { 63 indent++; 64 } 65 66 67 70 public void decrement() { 71 indent--; 72 } 73 74 75 78 public String getTab() { 79 return tab; 80 } 81 82 85 public void setTab(String tab) { 86 this.tab = tab; 87 } 88 89 } 90 | Popular Tags |