|
Java APG, Version 1.0 Author Lowell D. Thomas Copyright © Coast to Coast Research, Inc. 2011 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.coasttocoastresearch.apg.Utilities.LineCatalog
public static class Utilities.LineCatalog
A class for reading a text file and cataloging its text lines. A catalog record is generated for each text line. The records have information about the line number, the offset to the first character of the line and the line length.
| Nested Class Summary | |
|---|---|
class |
Utilities.LineCatalog.Line
Class defining a catalog record for an individual line of text. |
| Constructor Summary | |
|---|---|
Utilities.LineCatalog(char[] inputArray)
Constructor |
|
Utilities.LineCatalog(java.lang.String inputString)
Constructor |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the catalog of all lines. |
void |
displayErrors(java.io.PrintStream out)
Displays all errors encountered during the cataloging, if any. |
void |
displayWarnings(java.io.PrintStream out)
Displays all warnings issued during the cataloging, if any. |
int |
getErrorCount()
Get the number of errors encountered during the cataloging. |
Utilities.LineCatalog.Line |
getLine(int lineno)
Retrieves a single catalog Line by line number. |
int |
getLineCount()
Get the number of lines in the text file. |
Utilities.LineCatalog.Line |
getLineFromOffset(int offset)
Retrieves a single catalog Line for the line containing the requested offset character. |
java.util.ListIterator<Utilities.LineCatalog.Line> |
getLineIterator()
Get an iterator over the cataloged record Lines. |
int |
getWarningCount()
Get the number of warnings issuedduring the cataloging. |
java.lang.String |
toString()
Displays all lines of text with all Line information for each line. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Utilities.LineCatalog(char[] inputArray)
throws java.lang.IllegalArgumentException
inputArray - the text whose lines are to be cataloged as a character array.
java.lang.IllegalArgumentException - thrown if the input string is null or empty.
public Utilities.LineCatalog(java.lang.String inputString)
throws java.lang.IllegalArgumentException
inputString - the text whose lines are to be cataloged as a String.
java.lang.IllegalArgumentException - thrown if the input string is null or empty.| Method Detail |
|---|
public void clear()
public void displayErrors(java.io.PrintStream out)
out - the output device to display on.public void displayWarnings(java.io.PrintStream out)
out - the output device to display on.public int getErrorCount()
public Utilities.LineCatalog.Line getLine(int lineno)
lineno - the number (1-based) of the line to retrieve.
public int getLineCount()
public Utilities.LineCatalog.Line getLineFromOffset(int offset)
offset - the offset of the first text character to find the line of.
public java.util.ListIterator<Utilities.LineCatalog.Line> getLineIterator()
public int getWarningCount()
public java.lang.String toString()
toString in class java.lang.Object
|
Java APG, Version 1.0 Author Lowell D. Thomas Copyright © Coast to Coast Research, Inc. 2011 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||