org.sourcejammer.server.source
Class TextLineWriter

java.lang.Object
  |
  +--org.sourcejammer.server.source.TextLineWriter
All Implemented Interfaces:
java.io.Serializable, TextLineAdder

Deprecated. This clas is deprecated. Only kept in here in case conversion from old text file format is required. This class is used to append lines into a char array, using a specified end of line char array (typically linefeed or carriage return / linefeed. The lines passed into this class should not include the end of line characters. If the end of line characters are included, these characters will be doubled in the final output.

public class TextLineWriter
extends java.lang.Object
implements TextLineAdder, java.io.Serializable

See Also:
Serialized Form

Field Summary
private static int DEFAULT_BUFFER_START_SIZE
          Deprecated.  
private  char[] mcaEndOfLine
          Deprecated.  
private  char[] mcaText
          Deprecated.  
private  int miIndex
          Deprecated.  
 
Constructor Summary
TextLineWriter()
          Deprecated. Default constructor.
TextLineWriter(char[] endOfLine)
          Deprecated. Constructs a TextLineWriter with the passed-in end of line characters using the default buffer size.
TextLineWriter(int size)
          Deprecated. Constructs a TextLineWriter with the passed-in starting buffer size and the default end of line characters.

It is important to use an accurate starting buffer size.
TextLineWriter(int size, char[] endOfLine)
          Deprecated. Constructs a TextLineWriter with the passed-in starting buffer size and end of line characters.
 
Method Summary
private  void redimCharArray()
          Deprecated. Resizes the buffer for this TextLineWriter.

Avoid calling this method if possible.
 char[] toCharArray()
          Deprecated. Writes the contents of this TextLineWriter to a char array.
 void write(TextLineIterator oIterator)
          Deprecated. Writes the entire contents of the TextLineIterator to this TextLineWriter, beginning with the current line in the iterator.
 void writeLine(char[] line)
          Deprecated. Adds a line to this TextLineWriter.
 void writeLine(java.lang.String sLine)
          Deprecated. Adds a line to this TextLineWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mcaText

private char[] mcaText
Deprecated. 

miIndex

private int miIndex
Deprecated. 

mcaEndOfLine

private char[] mcaEndOfLine
Deprecated. 

DEFAULT_BUFFER_START_SIZE

private static final int DEFAULT_BUFFER_START_SIZE
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

TextLineWriter

public TextLineWriter()
Deprecated. 
Default constructor. Creates a TextLineWriter with default buffer size and default end of line characters.


TextLineWriter

public TextLineWriter(int size)
Deprecated. 
Constructs a TextLineWriter with the passed-in starting buffer size and the default end of line characters.

It is important to use an accurate starting buffer size. The buffer will resize automatically if the output grows larger than the starting size, but the process of resizing the buffer is fairly inefficient.

Parameters:
size - - starting size of the buffer (number of characters expected in the final output.

TextLineWriter

public TextLineWriter(char[] endOfLine)
Deprecated. 
Constructs a TextLineWriter with the passed-in end of line characters using the default buffer size.

Parameters:
endOfLine - -- a character array containing the end of line characters to use for the output of this TextLineWriter.

TextLineWriter

public TextLineWriter(int size,
                      char[] endOfLine)
Deprecated. 
Constructs a TextLineWriter with the passed-in starting buffer size and end of line characters.

Parameters:
size - - starting size of the buffer (number of characters expected in the final output.
endOfLine - -- a character array containing the end of line characters to use for the output of this TextLineWriter.
Method Detail

writeLine

public void writeLine(char[] line)
Deprecated. 
Adds a line to this TextLineWriter. This class will append the end of line characters to the end of the line.

Specified by:
writeLine in interface TextLineAdder
Parameters:
line - -- a line of text as a char array.

writeLine

public void writeLine(java.lang.String sLine)
Deprecated. 
Adds a line to this TextLineWriter. This class will append the end of line characters to the end of the line.

Specified by:
writeLine in interface TextLineAdder

write

public void write(TextLineIterator oIterator)
Deprecated. 
Writes the entire contents of the TextLineIterator to this TextLineWriter, beginning with the current line in the iterator.

Parameters:
oIterator - -- a TextLineIterator.

toCharArray

public char[] toCharArray()
Deprecated. 
Writes the contents of this TextLineWriter to a char array. The char array includes the end of line characters.


redimCharArray

private void redimCharArray()
Deprecated. 
Resizes the buffer for this TextLineWriter.

Avoid calling this method if possible. It will be pretty slow.



Copyright © 2003 Soucejammer project.