|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.io.LineSeparatorFilter
Filters line-separators from text stream.
Details: LineSeparatorFilter
assists in the conversion of text streams between heterogeneous platforms. The main difference between text streams created on different platforms is the code used to separate lines. Windows, Unix, and Macintosh all subscribe to unique formats. This class will take a stream of characters generated on any of these platforms, or even a mixed stream generated from multiple platforms, and produce predictable output that conforms to a single platform.
UnixLineReader
Field Summary | |
static java.lang.String |
DEFAULT_SEPARATOR
|
static java.lang.String |
DOS_LINE_SEPARATOR
The DOS/Windows-style line separator ("\r\n"). |
static java.lang.String |
MAC_LINE_SEPARATOR
The Macintosh-style line separator ("\r"). |
static java.lang.String |
UNIX_LINE_SEPARATOR
The Unix-style line separator ("\n"). |
Constructor Summary | |
LineSeparatorFilter()
Initializes a new LineSeparatorFilter to replace all line separators with the system's platform-specific line separator. |
|
LineSeparatorFilter(java.lang.String separator)
Initializes a new LineSeparatorFilter to replace all line separators with the specified string. |
Method Summary | |
java.lang.Object |
clone()
Creates an independent copy of this instance. |
char[] |
filter(char[] src)
Returns a new array with the line separators replaced by the preferred line separator declared when this instance was created. |
java.lang.String |
filter(java.lang.String src)
Returns a new String with the line separators replaced by the preferred line separator declared when this instance was created. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_SEPARATOR
public static final java.lang.String UNIX_LINE_SEPARATOR
public static final java.lang.String DOS_LINE_SEPARATOR
public static final java.lang.String MAC_LINE_SEPARATOR
Constructor Detail |
public LineSeparatorFilter()
public LineSeparatorFilter(java.lang.String separator)
separator
- the line separator that will replace all othersMethod Detail |
public char[] filter(char[] src)
src
- the source arraypublic java.lang.String filter(java.lang.String src)
src
- the source Stringpublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
Note: Although this method is declared to throw a CloneNotSupportedException, rest assured that it will never happen (unless this class is subclassed and the subclass does not support cloning). The rules of Java inheritance required the useless declaration. Sorry. :-(
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if this instance cannot be cloned
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |