public class FileUtil
extends java.lang.Object
Constructor | Description |
---|---|
FileUtil() |
Modifier and Type | Method | Description |
---|---|---|
static java.lang.String |
getNonCommentLine(java.util.Scanner in) |
Return the next non-comment line.
|
static java.lang.String |
lineWrap(java.util.Scanner in) |
Read a long line and return it wrapped into lines.
|
static java.lang.String |
readParagraph(java.util.Scanner in) |
Read a paragraph consisting of one or more nonempty lines terminated
by an empty line, and return a single String, preserving the newlines,
and breaking up lines that are too long.
|
static java.lang.String |
wordWrap(java.lang.String s,
int columns) |
Add line breaks to s so it wraps within a specified width.
|
public static java.lang.String getNonCommentLine(java.util.Scanner in)
in
- The source of the next line of text.public static java.lang.String lineWrap(java.util.Scanner in)
in
- The source of the next line of text.public static java.lang.String wordWrap(java.lang.String s, int columns)
s
- The string to break into lines - assumes no newlines.columns
- The maximum number of columns to occupy after wrapping.public static java.lang.String readParagraph(java.util.Scanner in)
in
- The source of the paragraph text.