1 package com.proalpha.pds.templates.helper;
3 import java.util.Arrays;
7 private static final int RIGHTMARGIN = 80;
13 public static String SingleLineComment(String Line) {
14 return SingleLineComment(Line, 1);
17 public static String SingleLineComment(String Line,
int StartColumn) {
21 length = Line.length();
23 for (i = 0; i < RIGHTMARGIN - 6 - length - (StartColumn - 1); i++) {
27 Line =
"/* " + Line +
" */";
29 for (i = 0; i < (StartColumn - 1); i++) {
36 public static String MultiLineComment(String CommentText) {
37 return MultiLineComment(CommentText, 1);
40 public static String MultiLineComment(String CommentText,
int StartColumn) {
43 String lineSeparator = System.getProperties().getProperty(
46 String[] commentLineSepArray = CommentText.split(lineSeparator);
48 for (String s : commentLineSepArray) {
49 content += SingleLineComment(s, StartColumn);
50 if ((commentLineSepArray.length - 1) > (counter)) {
51 content += lineSeparator;
58 public static String pad(String src,
int padTo,
char padChar) {
59 int numPad = padTo - src.length();
61 StringBuffer sb =
new StringBuffer();
62 char[] pad =
new char[numPad];
63 Arrays.fill(pad, padChar);