Class GCodeSection
- java.lang.Object
-
- org.cakelab.blender.typemap.NameMapping
-
- org.cakelab.blender.generator.utils.CodeGenerator
-
- org.cakelab.blender.generator.utils.GCodeSection
-
public class GCodeSection extends CodeGenerator
Contains generated code or comment lines.- Author:
- homac
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringBuffer
currentLine
-
Fields inherited from class org.cakelab.blender.generator.utils.CodeGenerator
indent, NL, TAB
-
-
Constructor Summary
Constructors Constructor Description GCodeSection(int initialIndent)
GCodeSection(GCodeSection other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GCodeSection
append(int i)
GCodeSection
append(java.lang.String text)
GCodeSection
appendln()
GCodeSection
appendln(java.lang.String line)
java.util.ArrayList<java.lang.String>
getLines()
int
numLines()
void
reset()
void
sortLines()
Sorts existing lines by alphabetic order.void
sortLines(java.util.Comparator<java.lang.String> c)
Sorts existing lines by the order defined by the given comparator.java.lang.String
toString(int indent)
-
Methods inherited from class org.cakelab.blender.generator.utils.CodeGenerator
getIndentString, indent
-
Methods inherited from class org.cakelab.blender.typemap.NameMapping
getFieldDescriptorName, mangle, mapClass2Struct, mapStruct2Class, toCamelCase, toFirstLowerCase, toGetterMethodName, toSetterMethodName
-
-
-
-
Constructor Detail
-
GCodeSection
public GCodeSection(int initialIndent)
-
GCodeSection
public GCodeSection(GCodeSection other)
-
-
Method Detail
-
reset
public void reset()
- Specified by:
reset
in classCodeGenerator
-
toString
public java.lang.String toString(int indent)
-
appendln
public GCodeSection appendln(java.lang.String line)
-
append
public GCodeSection append(java.lang.String text)
-
appendln
public GCodeSection appendln()
-
numLines
public int numLines()
-
getLines
public java.util.ArrayList<java.lang.String> getLines()
-
append
public GCodeSection append(int i)
-
sortLines
public void sortLines()
Sorts existing lines by alphabetic order. Useful to sort for example import statements.
-
sortLines
public void sortLines(java.util.Comparator<java.lang.String> c)
Sorts existing lines by the order defined by the given comparator. Useful to sort for example import statements.
-
-