|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.domain.line.AbstractLine
org.problets.domain.line.CodeLine
public class CodeLine
CodeLine class maintains one line of code.
Field Summary |
---|
Fields inherited from class org.problets.domain.line.AbstractLine |
---|
UNASSIGNED_LINE |
Constructor Summary | |
---|---|
CodeLine()
|
|
CodeLine(java.lang.String inLineCode,
java.lang.String inLineTemplate,
int inLineNumber,
DomainModel source)
|
Method Summary | |
---|---|
void |
addPrefix(java.lang.String prefix)
Method to add a prefix to the code |
void |
addtoLineObjects(java.lang.Object parameter)
Method to add a new object to the lineObjects vector - avoids duplicates |
void |
addtoLineObjects(java.util.Vector inLineObjects)
Method to add several objects to the lineObjects vector - avoids duplicates |
java.lang.Object |
clone()
Method makes a copy of the CodeLine's various data members |
static void |
decrementIndentation()
Decrement the amount of indentation for subsequent lines of code |
void |
draw(java.awt.Graphics g,
int xStart,
int xIndent,
int yCoord)
|
int |
getIndentation()
Returns the amount of indentation of this line |
java.lang.String |
getLineCode()
|
java.util.Vector |
getLineObjects()
Method to return a reference to the list of domain objects involved in this line. |
java.lang.String |
getLineTemplate()
|
DomainModel |
getSource()
Returns a reference to the source of this line of code |
static void |
incrementIndentation()
Increment the amount of indentation for subsequent lines of code |
static void |
initializeIndentation()
Initializes the current indentation to 1 |
boolean |
isOutputStatement()
Returns whether this is an output statement |
void |
print()
Implemnts a base class method Prints all the fields of the class |
void |
setCode(java.lang.String inLineCode)
Method to revise the code - used to revise the code for closing brace in most control constructs |
void |
setIndentation(int inIndentation)
Change the level of indentation of this line - used by reordering/refactoring problems |
java.lang.String |
toString()
Implementing method of the abstract base class so that LogModel.addToLog() works correctly Returns only that which is entered into the log |
Methods inherited from class org.problets.domain.line.AbstractLine |
---|
getLineNumber, setLineNumber |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CodeLine()
public CodeLine(java.lang.String inLineCode, java.lang.String inLineTemplate, int inLineNumber, DomainModel source)
Method Detail |
---|
public java.lang.Object clone()
clone
in class AbstractLine
public void draw(java.awt.Graphics g, int xStart, int xIndent, int yCoord)
xStart
- Starting x coordinate for the linexIndent
- Amount by which code should be indented for each level of indentation
Method draws the contents of this codeLine object
Although this should ideally be in the view class,
we are leaving it here since there is little need for a separate view class.public void addtoLineObjects(java.lang.Object parameter)
public void addtoLineObjects(java.util.Vector inLineObjects)
public void setCode(java.lang.String inLineCode)
public void addPrefix(java.lang.String prefix)
public static void incrementIndentation()
public static void decrementIndentation()
public void setIndentation(int inIndentation)
public static void initializeIndentation()
public java.lang.String getLineCode()
public java.lang.String getLineTemplate()
public java.util.Vector getLineObjects()
public int getIndentation()
public boolean isOutputStatement()
public DomainModel getSource()
public java.lang.String toString()
toString
in class AbstractLine
public void print()
print
in class AbstractLine
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |