/* -------------------------------------------------------------------------- */ /* */ /* SCRIPT STRUCTURE CLASS */ /* */ /* Frans Coenen */ /* */ /* Monday 1 October 2007 */ /* */ /* Department of Computer Science */ /* The University of Liverpool */ /* */ /* -------------------------------------------------------------------------- */ /** Structure in which to store ASP fragments. */ class ASPstruct { /** The line on which the '<%' tag appears (i.e. the asp fragment starts). */ private int startLineNum=0; /** The line on which the '%>' tag appears (i.e. the asp fragment ends). */ private int endLineNum=0; /** The location in the start line where the .asp fragment starts '<%'. */ private int startPos=0; /** The location in the end line where the .asp fragment ends '%>'. */ private int endPos=0; /** Short text explaning what the ASP fragmnet does. */ private String note = "No information"; /* --------------------------- */ /* */ /* SET METHODS */ /* */ /* --------------------------- */ /** Sets the start line number and the start position fields of the '<%' start .asp fragment tag to the given values. @param n the given line number value. @param pos the position in the start line. */ public void setStartLineNum(int n, int pos) { startLineNum = n; startPos = pos; } /** Sets the end line number and the end position fields of the '%>' end .asp fragment tag to the given values. @param n the given line number value. @param pos the position in the end line. */ public void setEndLineNum(int n, int pos) { endLineNum = n; endPos = pos; } /** Sets the note label with nthe given string. @param s the given string. */ public void setNote(String s) { note = s; } /* --------------------------- */ /* */ /* GET METHODS */ /* */ /* --------------------------- */ /** Gets value of startLineNum field. @rerurn the startLineNum filed value. */ public int getStartLineNum() { return(startLineNum); } /** Gets value of endLineNum field. @rerurn the endLineNum filed value. */ public int getEndLineNum() { return(endLineNum); } /** Gets value of startPos field. @rerurn the startPos filed value. */ public int getStartPos() { return(startPos); } /** Gets value of endPos field. @rerurn the endPos filed value. */ public int getEndPos() { return(endPos); } /* ------------------------------ */ /* */ /* OUTPUT METHODS */ /* */ /* ------------------------------ */ /** Outputs contents as a line of a HTML table. */ public String toString() { String s = "" + (startLineNum+1) + "" + (endLineNum+1) + "" + note + ""; // End return(s); } }