Top Description Fields Constructors Methods
org.hsqldb.util.preprocessor

public Class Line

extends Object
Class Inheritance

Preprocessor view of a line in a text document.
Author
Campbell Burnet (campbell-burnet@users dot sourceforge.net)
Since
1.8.1
Version
2.7.0

Field Summary

Modifier and TypeField and Description
private String
public static final String
public static final int
private static final int
public static final String
private String
private String
public static final String
SPACE_CHARS

Is " \t".

private String
private int

Constructor Summary

AccessConstructor and Description
public
Line(String
in a Document being Preprocessed.
line
)

Constructs a new instance from the given line.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the value.
getArguments
()

for this line, if they exist.

public String

Returns:

the leading space or table characters for this instance.
getIndent
()

prefix for this instance, which is any leading space or table characters.

public String

Returns:

the source text val
getSourceText
()

which is the original, verbatim value with which this instance was constructed.

public String
getText()

which is not the directive or directive arguments portion of the line.

public int
public static int

Returns:

the first index of any non-tab or non-space character.
indexOfNonTabOrSpace
(final String
to inspect
line
)

in the given line.

public static int

Returns:

the first index of either a tab ort a space character; -1 if no such characters are found.
indexOfTabOrSpace
(final String
to inspect
string
,
final int
at which to start the inspection; There is no restriction on the value . If it is negative, it has the same effect as if it were zero: the entire string may be searched. If it is greater than the length of the string, it has the same effect as if it were equal to the length of string: -1 is returned.
fromIndex
)

in the given, generic string.

public boolean
isType(int lineType)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

argumentsback to summary
private String arguments
DIRECTIVE_PREFIXback to summary
public static final String DIRECTIVE_PREFIX

Is "//#".

DIRECTIVE_PREFIX_LENGTHback to summary
public static final int DIRECTIVE_PREFIX_LENGTH

Is 3.

DIRECTIVE_PREFIX_LENGTH_PLUS_ONEback to summary
private static final int DIRECTIVE_PREFIX_LENGTH_PLUS_ONE

Is 4.

HIDE_DIRECTIVEback to summary
public static final String HIDE_DIRECTIVE

Id ' '.

indentback to summary
private String indent
sourceTextback to summary
private String sourceText
SPACE_CHARSback to summary
public static final String SPACE_CHARS

Is " \t".

textback to summary
private String text
typeback to summary
private int type

Constructor Detail

Lineback to summary
public Line(String line) throws PreprocessorException, NullPointerException

Constructs a new instance from the given line.

Parameters
line:String

in a Document being Preprocessed.

Method Detail

getArgumentsback to summary
public String getArguments() throws PreprocessorException

for this line, if they exist.

Returns:String

the value.

Exceptions
PreprocessorException:
if the line has no arguments.
getIndentback to summary
public String getIndent()

prefix for this instance, which is any leading space or table characters.

Returns:String

the leading space or table characters for this instance.

getSourceTextback to summary
public String getSourceText()

which is the original, verbatim value with which this instance was constructed.

Returns:String

the source text val

getTextback to summary
public String getText()

which is not the directive or directive arguments portion of the line.

For visible lines, this is the portion following the indent, if any.

For hidden lines, this is the text, if any, following the directive prefix used to hide the line.

getTypeback to summary
public int getType()
indexOfNonTabOrSpaceback to summary
public static int indexOfNonTabOrSpace(final String line)

in the given line.

Parameters
line:String

to inspect

Returns:int

the first index of any non-tab or non-space character.

Exceptions
NullPointerException:
if line is null.
indexOfTabOrSpaceback to summary
public static int indexOfTabOrSpace(final String string, final int fromIndex)

in the given, generic string.

Parameters
string:String

to inspect

fromIndex:int

at which to start the inspection; There is no restriction on the value . If it is negative, it has the same effect as if it were zero: the entire string may be searched. If it is greater than the length of the string, it has the same effect as if it were equal to the length of string: -1 is returned.

Returns:int

the first index of either a tab ort a space character; -1 if no such characters are found.

Exceptions
NullPointerException:
if string is null.
isTypeback to summary
public boolean isType(int lineType)
setSourceTextback to summary
public void setSourceText(String line) throws PreprocessorException, NullPointerException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override