org.eclipse.xtext.formatting.impl
Class FormattingConfigBasedStream.Line

java.lang.Object
  extended by org.eclipse.xtext.formatting.impl.FormattingConfigBasedStream.Line
Enclosing class:
FormattingConfigBasedStream

protected class FormattingConfigBasedStream.Line
extends java.lang.Object


Field Summary
protected  java.util.List<FormattingConfigBasedStream.LineEntry> entries
           
protected  java.lang.String indent
           
protected  int lastBreakableEntryIndex
           
protected  int leftover
           
protected  boolean startWithNL
           
protected  int totalLength
           
 
Constructor Summary
  FormattingConfigBasedStream.Line()
           
protected FormattingConfigBasedStream.Line(int leftover)
           
protected FormattingConfigBasedStream.Line(java.util.List<FormattingConfigBasedStream.LineEntry> entries)
           
protected FormattingConfigBasedStream.Line(java.util.List<FormattingConfigBasedStream.LineEntry> initialEntries, int leftover)
           
 
Method Summary
 FormattingConfigBasedStream.Line add(FormattingConfigBasedStream.LineEntry lineEntry)
           
protected  void addSpacesToTotalLength(FormattingConfigBasedStream.LineEntry lineEntry, boolean first)
           
 void flush()
           
protected  void flush(ITokenStream intoStream, int endIndex)
           
protected  FormattingConfigBasedStream.Line flushLine()
           
protected  java.lang.String getIndentation(int indentation)
           
 Pair<AbstractRule,java.lang.String> getSpaces(FormattingConfigBasedStream.LineEntry entry, boolean isLineStart)
           
 java.lang.String getSpacesStr(FormattingConfigBasedStream.LineEntry entry, boolean isLineStart)
           
 java.lang.String toString()
           
protected  java.lang.String wrap(int lines, java.lang.String indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

entries

protected java.util.List<FormattingConfigBasedStream.LineEntry> entries

indent

protected java.lang.String indent

lastBreakableEntryIndex

protected int lastBreakableEntryIndex

leftover

protected int leftover

startWithNL

protected boolean startWithNL

totalLength

protected int totalLength
Constructor Detail

FormattingConfigBasedStream.Line

public FormattingConfigBasedStream.Line()

FormattingConfigBasedStream.Line

protected FormattingConfigBasedStream.Line(int leftover)

FormattingConfigBasedStream.Line

protected FormattingConfigBasedStream.Line(java.util.List<FormattingConfigBasedStream.LineEntry> entries)

FormattingConfigBasedStream.Line

protected FormattingConfigBasedStream.Line(java.util.List<FormattingConfigBasedStream.LineEntry> initialEntries,
                                           int leftover)
Method Detail

add

public FormattingConfigBasedStream.Line add(FormattingConfigBasedStream.LineEntry lineEntry)
                                     throws java.io.IOException
Throws:
java.io.IOException

addSpacesToTotalLength

protected void addSpacesToTotalLength(FormattingConfigBasedStream.LineEntry lineEntry,
                                      boolean first)

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

flush

protected void flush(ITokenStream intoStream,
                     int endIndex)
              throws java.io.IOException
Parameters:
endIndex - the index of the last entry to flush, exclusive.
Throws:
java.io.IOException

flushLine

protected FormattingConfigBasedStream.Line flushLine()
                                              throws java.io.IOException
Throws:
java.io.IOException

getIndentation

protected java.lang.String getIndentation(int indentation)

getSpaces

public Pair<AbstractRule,java.lang.String> getSpaces(FormattingConfigBasedStream.LineEntry entry,
                                                     boolean isLineStart)

getSpacesStr

public java.lang.String getSpacesStr(FormattingConfigBasedStream.LineEntry entry,
                                     boolean isLineStart)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

wrap

protected java.lang.String wrap(int lines,
                                java.lang.String indent)