File: Complex.java

package info (click to toggle)
eclipse-emf 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 50,912 kB
  • ctags: 60,697
  • sloc: java: 407,889; xml: 7,165; sh: 200; makefile: 13
file content (37 lines) | stat: -rwxr-xr-x 1,183 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package org.jetTest;

import java.util.List;

public class ComplexGen
{
  protected static String nl;
  public static synchronized ComplexGen create(String lineSeparator)
  {
    nl = lineSeparator;
    ComplexGen result = new ComplexGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "public class Complex" + NL + "{" + NL + "\tpublic void main(String[] args)" + NL + "\t{";
  protected final String TEXT_2 = NL + "\t\tSystem.out.println(\"";
  protected final String TEXT_3 = "\");";
  protected final String TEXT_4 = NL + "\t}" + NL + "}" + NL;
  protected final String TEXT_5 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    List<?> objectsToPrint = (List<?>)argument;
    stringBuffer.append(TEXT_1);
    for (Object objectToPrint : objectsToPrint) {
    stringBuffer.append(TEXT_2);
    stringBuffer.append(objectToPrint.toString());
    stringBuffer.append(TEXT_3);
    }
    stringBuffer.append(TEXT_4);
    stringBuffer.append(TEXT_5);
    return stringBuffer.toString();
  }
}