forked from nathan-hadley/ad-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryData.java
More file actions
120 lines (108 loc) · 2.77 KB
/
Copy pathQueryData.java
File metadata and controls
120 lines (108 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* Group 3
* CPSC 5021, Seattle University
* This is free and unencumbered software released into the public domain.
*/
package queryrunner;
/**
* The Class QueryData creates query objects
* with the associated parameters.
*
* @author mckeem, hadley, cooper, li
*/
public class QueryData {
/**
* Instantiates a new query data.
*
* @param title description of query
* @param query the query
* @param parms the parameters
* @param likeparms the parameters using like
* @param isAction the is action
* @param isParm the is parameters
*/
QueryData(String title, String query, String[] parms,
boolean [] likeparms, boolean isAction, boolean isParm) {
queryTitle = title;
queryString = query;
arrayParms = parms;
arrayLikeParms = likeparms;
this.isAction = isAction;
isParms = isParm;
}
/**
* Gets the query string.
*
* @return the string
*/
String GetQueryString()
{
return queryString;
}
/**
* Gets the query title.
*
* @return the title
*/
String GetTitle() { return queryTitle; }
/**
* Gets the amount of parameters.
*
* @return the parameters
*/
int GetParmAmount() {
if (arrayParms == null)
return 0;
else
return arrayParms.length;
}
/**
* Gets the parameters text.
*
* @param index the index
* @return the string
*/
String GetParamText(int index) {
return arrayParms[index];
}
/**
* Gets the like parameters.
*
* @param index the index
* @return true, if successful
*/
boolean GetLikeParam(int index) {
return arrayLikeParms[index];
}
/**
* Gets the all parameters that use like.
*
* @return the boolean[]
*/
boolean [] GetAllLikeParams() {
return arrayLikeParms;
}
/**
* Checks if action query (insert or update).
*
* @return true, if action
*/
boolean IsQueryAction() {
return isAction;
}
/**
* Checks if is query parameter.
*
* @return true, if it contains parameters
*/
boolean IsQueryParm()
{
return isParms;
}
private String queryTitle; // Description of query
private String queryString; // Query string
private String [] arrayParms; // Query parameters
private boolean isAction; // Is it an action query?
private boolean isParms; // Does query have parameters?
private boolean [] arrayLikeParms; // Does query have like parameters?
}