|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Sav.Z.Script
Can be executed many times for different Z databases or Zigzag multitudes of a Session. Represents many of Zigzag Statements formed after text analyzing. If Zigzag Scripts are executed a few times, database connection need be opened by modifyBase()/useBase() before and closed by closeBase() after.
The example sequentially prints information about each user.
String names[] = { "Ann", "Daniel" }; String text = "$mul user ~;" + "$user = =User.(Name:$name);" ; Script scr = new Script(text); ss.analyse(scr); if (!scr.hasErrors()) { ss.useBase("Users"); for (int i = 0; i < names.length; ++i) { ss.set("name", names[i]); ss.execute(scr); String users[] = ss.get("user"); System.out.println((i + 1) + ": Name: " + names[i] + ", User: " + users[0]); } ss.closeBase("Users"); }
Session.z(java.lang.String)
,
Session.analyse(Sav.Z.Script)
,
Session.execute(Sav.Z.Script)
,
Statement
Field Summary | |
static int |
BASE
|
static int |
BRACE
|
static int |
BRACE_TERM
|
static int |
BRACKET
|
static int |
BRACKET_TERM
|
static int |
CATEGORY
|
static int |
COLON
|
static int |
COMMA
|
static int |
CONJUNCTIVE
|
static int |
DECLARATION
|
static int |
DECLARED
|
static int |
DELIVERED
|
static int |
DESCRIPTIVE
|
static int |
DIVIDE
|
static int |
ELLIPSIS
|
static int |
EQUALITY
|
static int |
EXTRACTION
|
static int |
FILE
|
static int |
INEQUALITY
|
static java.lang.String |
KEYS
|
static int |
LEFT_SLASH
|
static int |
MULTITUDE
|
static int |
NONE
|
static int |
NUMBER
|
static int |
P1
|
static int |
P2
|
static int |
PARENTHESIS
|
static int |
PARENTHESIS_TERM
|
static int |
PROCEDURE
|
static int |
QUOTE
|
static int |
RANGE
|
static int |
RIGHT_SLASH
|
static int |
SPACE
|
static int |
SPECIFICATION
|
static int |
STRING
|
static int |
TERMINATION
|
static int |
WORD
|
Constructor Summary | |
Script(java.lang.String text)
Constructs a new Script. |
Method Summary | |
int |
countStatements()
Counts Statements of analyzed Script. |
java.lang.String |
getText()
Returns address of full text string, a Script was created by means of which. |
boolean |
hasErrors()
Tests to see if Script has Errors. |
boolean |
hasFailures()
Tests to see if Script has Failures. |
boolean |
hasStatements()
Returns true if Script was analyzed and has a Zigzag Statement. |
boolean |
hasWarnings()
Tests to see if Script has Warnings. |
Statement[] |
statements()
Returns array of Script's Statements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String KEYS
public static final int NONE
public static final int CATEGORY
public static final int PROCEDURE
public static final int MULTITUDE
public static final int FILE
public static final int BASE
public static final int SPECIFICATION
public static final int ELLIPSIS
public static final int NUMBER
public static final int STRING
public static final int QUOTE
public static final int WORD
public static final int SPACE
public static final int BRACE
public static final int BRACKET
public static final int PARENTHESIS
public static final int BRACE_TERM
public static final int BRACKET_TERM
public static final int PARENTHESIS_TERM
public static final int RANGE
public static final int COLON
public static final int DIVIDE
public static final int LEFT_SLASH
public static final int RIGHT_SLASH
public static final int EXTRACTION
public static final int INEQUALITY
public static final int EQUALITY
public static final int DECLARATION
public static final int COMMA
public static final int TERMINATION
public static final int P1
public static final int DESCRIPTIVE
public static final int CONJUNCTIVE
public static final int P2
public static final int DELIVERED
public static final int DECLARED
Constructor Detail |
public Script(java.lang.String text)
text
- string, whose address is passed, no contentsMethod Detail |
public java.lang.String getText()
public Statement[] statements()
null
if Script was not analyzedpublic boolean hasStatements()
true
if Script was analyzed and has a Zigzag Statement.public int countStatements()
public boolean hasWarnings()
public boolean hasErrors()
Session.analyse(Sav.Z.Script)
public boolean hasFailures()
Session.execute(Sav.Z.Script)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |