/* -------------------------------------------------------------------------- */ /* */ /* 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 ScriptStruct { /** The line on which the '' tag appears (i.e. the script block ends). */ private int endLineNum=0; /** The location in the start line where the script block starts ''. */ private int endPos=0; /** The type of sccript e.g. 'text/JavaScript'. */ private String scriptType = "NA"; /** Note script code lanaguage, eg. 'VBscript'. */ private String scriptLanguage = "NA"; /* --------------------------- */ /* */ /* 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 script type field with nthe given string. @param s the given string. */ public void setScriptType(String s) { scriptType = s; } /** Sets the note label with nthe given string. @param s the given string. */ public void setScriptLanguage(String s) { scriptLanguage = s; } /* --------------------------- */ /* */ /* GET METHODS */ /* */ /* --------------------------- */ /** Gets value of startLineNum field. @return the startLineNum field value. */ public int getStartLineNum() { return(startLineNum); } /** Gets value of endLineNum field. @return the endLineNum field value. */ public int getEndLineNum() { return(endLineNum); } /** Gets value of startPos field. @return the startPos field value. */ public int getStartPos() { return(startPos); } /** Gets value of endPos field. @return the endPos field value. */ public int getEndPos() { return(endPos); } /** Gets value of script type field. @return the script type field valye. */ public String getScriptType() { return(scriptType); } /** Gets value of script language field. @return the script type field value. */ public String getScriptLanguage() { return(scriptLanguage); } /* ------------------------------ */ /* */ /* OUTPUT METHODS */ /* */ /* ------------------------------ */ /** Outputs contents as a line of a HTML table. */ public String toString() { String s = "" + (startLineNum+1) + "" + (endLineNum+1) + "" + scriptType + "" + scriptLanguage + ""; // End return(s); } }