sbr.resources.io
Class SBRParse

java.lang.Object
  extended by sbr.resources.io.SBRParse

public class SBRParse
extends java.lang.Object

Object to part the .sbr files to hold the code from the building of the program.

Version:
0.1
Author:
John H. Krantz, Ph.D.

Field Summary
static int ALLOW_COUNT
          Position in the first index of the string array that is returned for the code that indicates if the user is allowing me to count the usage of the survey..
static int DO_VAS
          Position in the first index of the string array that is returned for the code to indicate if a visual analog scale item is in the survey.
static java.lang.String EL_IN
          tag for the beginning of an element of a question
static java.lang.String EL_OUT
          tag to close an element of a question.
static int HTML_BODY_START
          Position in the first index of the string array that is returned for the code that is at the beginning of the body of the web page.
static int ITEMS
          Position in the first index of the string array that is returned for the code that holds the survey items.
static int PG_TITLE
          Position in the first index of the string array that is returned for the page title.
 
Constructor Summary
SBRParse()
           
 
Method Summary
 java.lang.String[][][][] fromSBR(java.lang.String file)
          Takes the text from the survey code file (.sbr) and parses it into a string array with all of the information needed to recreate the survey.
 java.lang.String toSBR(java.lang.String pgTitle, boolean doVAS, java.lang.String htmlBodyStart, java.lang.String[][][] items, boolean allowCount)
          Converts the information that needs to be stored into the coded storage format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PG_TITLE

public static final int PG_TITLE
Position in the first index of the string array that is returned for the page title.

See Also:
Constant Field Values

DO_VAS

public static final int DO_VAS
Position in the first index of the string array that is returned for the code to indicate if a visual analog scale item is in the survey.

See Also:
Constant Field Values

HTML_BODY_START

public static final int HTML_BODY_START
Position in the first index of the string array that is returned for the code that is at the beginning of the body of the web page.

See Also:
Constant Field Values

ITEMS

public static final int ITEMS
Position in the first index of the string array that is returned for the code that holds the survey items.

See Also:
Constant Field Values

ALLOW_COUNT

public static final int ALLOW_COUNT
Position in the first index of the string array that is returned for the code that indicates if the user is allowing me to count the usage of the survey..

See Also:
Constant Field Values

EL_IN

public static final java.lang.String EL_IN
tag for the beginning of an element of a question

See Also:
Constant Field Values

EL_OUT

public static final java.lang.String EL_OUT
tag to close an element of a question.

See Also:
Constant Field Values
Constructor Detail

SBRParse

public SBRParse()
Method Detail

toSBR

public java.lang.String toSBR(java.lang.String pgTitle,
                              boolean doVAS,
                              java.lang.String htmlBodyStart,
                              java.lang.String[][][] items,
                              boolean allowCount)
Converts the information that needs to be stored into the coded storage format.

Parameters:
pgTitle - the title of the survey
doVAS - does the user have any visual analong scale items in the survey
htmlBodyStart - the code at the beginning of the page and form.
items - the string array for the survey items.
allowCount - does the user allow me to count the hits of their survey.
lastQuest - the number of the last question in the survey.
Returns:
String. The text of the survey code file. Each element is enclosed by appropriate fields

fromSBR

public java.lang.String[][][][] fromSBR(java.lang.String file)
Takes the text from the survey code file (.sbr) and parses it into a string array with all of the information needed to recreate the survey. This is a four dimensional array with the first index indicating the type of information held at that level.

Parameters:
file. - the text of the .sbr file.
Returns:
String [][][][] the string array representation of the file.