Permalink
Browse files

Added new directory for the Data Management System project and blog s…

…eries. Updated test/beginner files.
  • Loading branch information...
1 parent 3f59f54 commit 9d2f93477d2e83e9107a71c2decdcc022a89e439 Iran Hutchinson committed Jun 23, 2011
@@ -155,7 +155,8 @@ public void checkParameters(String[] args) {
* @return ArrayList an array list of customers
*
*/
- static ArrayList generateCustomers(Class documentClass) throws Exception {
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ static ArrayList generateCustomers(Class documentClass) throws Exception {
ArrayList<HashMap<String,Object>> customers = new ArrayList<HashMap<String,Object>>();
for (int i=0;i<documentCount;i++) {
HashMap<String,Object> customer = (HashMap<String, Object>) documentClass.newInstance();
@@ -71,7 +71,7 @@ void load() {
* @param key key
* @param pattern pattern argument
*/
- void startsWith(String key, String pattern) {
+ public void startsWith(String key, String pattern) {
System.out.println("StartsWith query. Key = " + key + " startsWith " + pattern);
Query query = new StartsWith(key,pattern);
executeQuery(query);
@@ -85,7 +85,7 @@ void startsWith(String key, String pattern) {
* @param from second query from parameter
* @param to second query to parameter
*/
- void and(String key1, String pattern, String key2, int from, int to) {
+ public void and(String key1, String pattern, String key2, int from, int to) {
System.out.println("key1.startsWith(pattern) AND key2.between(from,to) query.");
Query query = new And(new StartsWith(key1,pattern),new Between(key2,from,to));
executeQuery(query);
@@ -98,7 +98,7 @@ void and(String key1, String pattern, String key2, int from, int to) {
* @param key2 key to be used in second sub-query
* @param i2 GT query argument
*/
- void or(String key1, int i1, String key2, int i2) {
+ public void or(String key1, int i1, String key2, int i2) {
System.out.println("(key1 < ?) OR (key2 > ?) query.");
Query query = new Or(new LT(key1,i1),new GT(key2,i2));
executeQuery(query);
@@ -112,7 +112,7 @@ void or(String key1, int i1, String key2, int i2) {
* @param from from value
* @param to to value
*/
- void between(String key, int from, int to) {
+ public void between(String key, int from, int to) {
System.out.println("Between query. Key = " + key +" between: " + from + " and " + to);
Query query = new Between(key,from,to);
query.limit(15);
@@ -124,7 +124,7 @@ void between(String key, int from, int to) {
* @param key key
* @param value value
*/
- void equals(String key, Object value) {
+ public void equals(String key, Object value) {
System.out.println("Equals query. Key = " + key + ", Value = " + value);
Query query = new Equals(key,value);
executeQuery(query);
@@ -135,7 +135,7 @@ void equals(String key, Object value) {
* @param key key
* @param pattern pattern
*/
- void patternMatch(String key, String pattern) {
+ public void patternMatch(String key, String pattern) {
System.out.println("Pattern Match query. Matching: " + pattern);
Query query = new PatternMatch(key,pattern);
executeQuery(query);
@@ -18,7 +18,7 @@
* @param key key
* @param pattern starts with pattern
*/
- abstract void startsWith(String key, String pattern);
+ public abstract void startsWith(String key, String pattern);
/** between query. Finds all elements whose values
* corresponding to the given <CODE>key</CODE> are between
@@ -28,36 +28,36 @@
* @param from from value
* @param to to value
*/
- abstract void between(String key, int from, int to);
+ public abstract void between(String key, int from, int to);
/** Runs a sample And query by combining two conditions.
*/
- abstract void and(String key1, String pattern, String key2, int from, int to);
+ public abstract void and(String key1, String pattern, String key2, int from, int to);
/** Runs a sample Or query by combining two conditions.
*/
- abstract void or(String key1, int i1, String key2, int i2);
+ public abstract void or(String key1, int i1, String key2, int i2);
/** Runs a sample Equals query.
*
* @param key key
* @param value value to match
*/
- abstract void equals(String key, Object value);
+ public abstract void equals(String key, Object value);
/** Perform PatternMatch query.
*
* @param key key
* @param pattern pattern
*/
- abstract void patternMatch(String key, String pattern);
+ public abstract void patternMatch(String key, String pattern);
/** Runs a simple test
*
* @param args program arguments
* @throws Exception
*/
- void runTest(String[] args) throws Exception {
+ public void runTest(String[] args) throws Exception {
generateSampleData();
init(args);
deleteData();

0 comments on commit 9d2f934

Please sign in to comment.