public class Line extends Object implements Serializable
Representation of a line of text in a properties file. Index is the absolute offset of this line in the file at the time it was read. The line end is not included in "text", it is found in the "ending" variable.
This class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
(package private) LineEnding |
ending |
(package private) long |
index |
private static long |
serialVersionUID |
(package private) String |
text |
| Constructor and Description |
|---|
Line(String text,
long index,
LineEnding ending) |
| Modifier and Type | Method and Description |
|---|---|
String |
commentContents() |
boolean |
equals(Object obj) |
LineEnding |
getEnding() |
long |
getIndex() |
String |
getText() |
boolean |
hasContinuation()
Return true if this line is a value extension of a line (part of a logical line)
|
int |
hashCode() |
boolean |
isCommentLine() |
boolean |
isEmptyLine() |
boolean |
isNaturalLine()
Natural lines contain keys, a delimiter, and a value (or initial value part)
|
boolean |
isPrivateComment()
Used to identify our private (transient) comment system for a comment header
|
String |
logicalLineContents() |
String[] |
naturalLineContents() |
private PropertiesToken |
nominalEnding() |
List<PropertiesToken> |
tokens()
Tokenize a line of text from a properties file.
|
String |
toString() |
private static final long serialVersionUID
final String text
final long index
final LineEnding ending
public Line(String text, long index, LineEnding ending)
public List<PropertiesToken> tokens()
public boolean hasContinuation()
public boolean isPrivateComment()
public String logicalLineContents()
public boolean isNaturalLine()
public boolean isCommentLine()
public boolean isEmptyLine()
public String commentContents()
public String[] naturalLineContents()
public String getText()
public long getIndex()
public LineEnding getEnding()
private PropertiesToken nominalEnding()
Copyright © 2011–2016 David R. Smith. All rights reserved.