tribble.io
Class TextLine

java.lang.Object
  extended by tribble.io.TextLine
All Implemented Interfaces:
TextLineI
Direct Known Subclasses:
DiffLine

public class TextLine
extends java.lang.Object
implements TextLineI

Generic numbered text line.

This is a default implementation of the TextLineI interface.

Since:
2001-04-23
Version:
$Revision: 1.2 $ $Date: 2003/09/06 19:14:45 $
Author:
David R. Tribble (david@tribble.com).
Copyright 2001-2003 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.

Field Summary
protected  java.lang.String m_fname
          Source filename.
protected  int m_lineNo
          Source line number.
protected  java.lang.String m_text
          Textual content of this line.
(package private) static java.lang.String REV
          Revision information.
 
Constructor Summary
protected TextLine()
          Default constructor.
  TextLine(java.lang.String text)
          Constructor.
  TextLine(java.lang.String text, int lineNo)
          Constructor.
  TextLine(java.lang.String text, int lineNo, java.lang.String fname)
          Constructor.
 
Method Summary
 java.lang.String getFileName()
          Retrieve the source filename of this token.
 int getLineNo()
          Retrieve the source line number of this text line.
 java.lang.String getText()
          Retrieve the textual contents of this text line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values

m_text

protected java.lang.String m_text
Textual content of this line.


m_lineNo

protected int m_lineNo
Source line number.


m_fname

protected java.lang.String m_fname
Source filename.

Constructor Detail

TextLine

public TextLine(java.lang.String text)
Constructor.

Parameters:
text - Textual content for this text line.
Since:
1.2, 2003-09-06

TextLine

public TextLine(java.lang.String text,
                int lineNo)
Constructor.

Parameters:
text - Textual content for this text line.
lineNo - Source line number of this text line.
Since:
1.2, 2003-09-06

TextLine

public TextLine(java.lang.String text,
                int lineNo,
                java.lang.String fname)
Constructor.

Parameters:
text - Textual content for this text line.
lineNo - Source line number of this text line.
fname - Source file name from whence this text line was read.
Since:
1.2, 2003-09-06

TextLine

protected TextLine()
Default constructor.

Since:
1.2, 2003-09-06
Method Detail

getText

public java.lang.String getText()
Retrieve the textual contents of this text line.

Specified by:
getText in interface TextLineI
Returns:
The contents of this text line.
Since:
1.1, 2001-04-23

getLineNo

public int getLineNo()
Retrieve the source line number of this text line.

Specified by:
getLineNo in interface TextLineI
Returns:
The source line number of this text line.
Since:
1.1, 2001-04-23

getFileName

public java.lang.String getFileName()
Retrieve the source filename of this token.

Specified by:
getFileName in interface TextLineI
Returns:
The source filename for this token.
Since:
1.1, 2001-04-23