asia.redact.bracket.properties.line
Class Line

java.lang.Object
  extended by asia.redact.bracket.properties.line.Line

public class Line
extends Object

 Representation of a line of text in a file. Index is the absolute offset of this line in the file at the time it was read out.
 
 This class is thread-safe.
 
 

Author:
Dave

Field Summary
(package private)  LineEnding ending
           
(package private)  long index
           
(package private)  String text
           
 
Constructor Summary
Line(String text, long index, LineEnding ending)
           
 
Method Summary
 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 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

text

final String text

index

final long index

ending

final LineEnding ending
Constructor Detail

Line

public Line(String text,
            long index,
            LineEnding ending)
Method Detail

nominalEnding

private PropertiesToken nominalEnding()

tokens

public List<PropertiesToken> tokens()
Tokenize a line of text from a properties file.

Returns:

hasContinuation

public boolean hasContinuation()
Return true if this line is a value extension of a line (part of a logical line)

Returns:

isPrivateComment

public boolean isPrivateComment()
Used to identify our private comment system for a comment header

Returns:

logicalLineContents

public String logicalLineContents()

isNaturalLine

public boolean isNaturalLine()
Natural lines contain keys, a delimiter, and a value (or initial value part)

Returns:

isCommentLine

public boolean isCommentLine()

isEmptyLine

public boolean isEmptyLine()

commentContents

public String commentContents()

naturalLineContents

public String[] naturalLineContents()

getText

public String getText()

getIndex

public long getIndex()

getEnding

public LineEnding getEnding()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011-2013 David R. Smith. All Rights Reserved.