hicosim.components.backend.io
Class Sourcefile

java.lang.Object
  extended by hicosim.components.backend.io.Sourcefile

public class Sourcefile
extends java.lang.Object

Class for reading in and writing to a sourcefile.

Author:
Wager, 16th May 2009

Constructor Summary
Sourcefile(Engine e)
           
 
Method Summary
 int getAddressAtLine(int linenum)
          This method returns the address at a line.
 int getLineNumberAtAddress(int address)
          This method returns the linenumber at a address.
 java.lang.String getLines()
           
 int getNumberOfLines()
           
 java.lang.String getPathOfSourcefile()
           
 void putLine(int linenumber, java.lang.String line)
          This method is used to put a line in a Map to get the line by the linenumber.
 void read(java.lang.String PATH)
          This method reads in a sourcefile(only .asm) and stores the lines in a stringbuffer;
 void reset()
           
 void write(java.lang.String PATH, java.lang.String text)
          This method writes to a sourcefile(only .asm).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sourcefile

public Sourcefile(Engine e)
Method Detail

reset

public void reset()

read

public void read(java.lang.String PATH)
          throws java.lang.Exception
This method reads in a sourcefile(only .asm) and stores the lines in a stringbuffer;

Throws:
java.lang.Exception

write

public void write(java.lang.String PATH,
                  java.lang.String text)
           throws java.lang.Exception
This method writes to a sourcefile(only .asm).

Throws:
java.lang.Exception

getLines

public java.lang.String getLines()
Returns:
String lines - all lines in the sourcefile.

getNumberOfLines

public int getNumberOfLines()
Returns:
int numberOfLines - number of lines in the sourcefile.

getPathOfSourcefile

public java.lang.String getPathOfSourcefile()
Returns:
String srcCodePATH - path to the sourcefile.

putLine

public void putLine(int linenumber,
                    java.lang.String line)
This method is used to put a line in a Map to get the line by the linenumber.

Parameters:
linenumber - - int
line - - String

getAddressAtLine

public int getAddressAtLine(int linenum)
This method returns the address at a line.

Parameters:
linenum -
Returns:

getLineNumberAtAddress

public int getLineNumberAtAddress(int address)
This method returns the linenumber at a address.

Returns: