org.pz.platypus
Class InputLine

java.lang.Object
  extended by org.pz.platypus.InputLine

public class InputLine
extends java.lang.Object

//curr: do we need the setters? Line probably should be immutable Defines a InputLine, which simply holds the file#, line # of the current input line, and the content of the current input line (as a string).

Author:
alb

Field Summary
private  java.lang.String content
          the content of the line as a string
private  Source source
          the file # and line # for this InputLine
 
Constructor Summary
InputLine()
           
InputLine(int fileNumber, int lineNumber, java.lang.String text)
           
InputLine(int lineNumber, java.lang.String text)
           
InputLine(Source s, java.lang.String text)
           
 
Method Summary
 java.lang.String dump()
          Dump one input line to console.
 java.lang.String getContent()
          return a string with the line content
 Source getSource()
          get the file number that this line appeared in.
 void setContent(java.lang.String newContent)
          Set the content portion
 void setSource(Source newSource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private Source source
the file # and line # for this InputLine


content

private java.lang.String content
the content of the line as a string

Constructor Detail

InputLine

public InputLine()

InputLine

public InputLine(int lineNumber,
                 java.lang.String text)

InputLine

public InputLine(int fileNumber,
                 int lineNumber,
                 java.lang.String text)

InputLine

public InputLine(Source s,
                 java.lang.String text)
Method Detail

dump

public java.lang.String dump()
Dump one input line to console. Note: uses printf from Java 5

Returns:
a string containing the dumped InputLine

getContent

public java.lang.String getContent()
return a string with the line content

Returns:
content

setContent

public void setContent(java.lang.String newContent)
Set the content portion

Parameters:
newContent - the new line content

getSource

public Source getSource()
get the file number that this line appeared in. The file number is primarily used to track which file is being read in the event that a file is included in the main file via the [include:xxx] command.

Returns:
the file number

setSource

public void setSource(Source newSource)


Copyright © 2008-10 Pacific Data Works LLC