|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectWriter
FilterWriter
ExpandedTabWriter
@ThreadSafe @Decorator(value=java.io.Writer.class) public class ExpandedTabWriter
Writes characters to a stream while expanding tabs ('\t') into spaces.
| utility/geotk-utility (download) | View source code for this class |
| Field Summary |
|---|
| Fields inherited from class FilterWriter |
|---|
out |
| Fields inherited from class Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
ExpandedTabWriter(Writer out)
Constructs a filter which replaces tab characters ( '\t')
by spaces. |
|
ExpandedTabWriter(Writer out,
int tabWidth)
Constructs a filter which replaces tab characters ( '\t')
by spaces, using the specified tab width. |
|
| Method Summary | |
|---|---|
int |
getTabWidth()
Returns the tab width. |
void |
setTabWidth(int tabWidth)
Sets the tab width. |
String |
toString()
Returns a string representation if this writer. |
void |
write(char[] buffer,
int offset,
int length)
Writes a portion of an array of characters. |
void |
write(int c)
Writes a single character. |
void |
write(String string,
int offset,
int length)
Writes a portion of a string. |
| Methods inherited from class FilterWriter |
|---|
close, flush |
| Methods inherited from class Writer |
|---|
append, append, append, write, write |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ExpandedTabWriter(Writer out)
'\t')
by spaces. Tab widths default to 8 characters.
out - A writer object to provide the underlying stream.
public ExpandedTabWriter(Writer out,
int tabWidth)
throws IllegalArgumentException
'\t')
by spaces, using the specified tab width.
out - A writer object to provide the underlying stream.tabWidth - The tab width. Must be greater than 0.
IllegalArgumentException - if tabWidth is not greater than 0.| Method Detail |
|---|
public void setTabWidth(int tabWidth)
throws IllegalArgumentException
tabWidth - The tab width. Must be greater than 0.
IllegalArgumentException - if tabWidth is not greater than 0.public int getTabWidth()
public void write(int c)
throws IOException
write in class FilterWriterIOException - If an I/O error occurs.
public void write(char[] buffer,
int offset,
int length)
throws IOException
write in class FilterWriterbuffer - Buffer of characters to be writtenoffset - Offset from which to start reading characterslength - Number of characters to be written
IOException - If an I/O error occurs.
public void write(String string,
int offset,
int length)
throws IOException
write in class FilterWriterstring - String to be writtenoffset - Offset from which to start reading characterslength - Number of characters to be written
IOException - If an I/O error occurs.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||