Permalink
Browse files

visitor stuff done. uses arraylists

  • Loading branch information...
1 parent 3561cad commit a7bce467558f04de5f602555626a6638429e3f86 @esussman committed Apr 16, 2012
@@ -1,13 +1,47 @@
package customerSearch.util;
+
+import customerSearch.algorithms.ExactMatch;
+import customerSearch.algorithms.NaiveMatching;
+import customerSearch.algorithms.SearchStrategy;
+import customerSearch.algorithms.SemanticMatch;
+import customerSearch.products.Version1.SeaGateDriveV1;
+import customerSearch.products.Version2.SeaGateDriveV2;
+import customerSearch.products.Version3.SeaGateDriveV3;
+
public class CompleteSearchVisitor implements ProductVisitor
{
-//Dont search each version together, do it seperately by version.
-//visit(Version1 product)
-//visit(Version2 product)
-//visit(Version3 product)
- public void visit()
+ public void visit(SeaGateDriveV1 drive)
+ {
+ SearchStrategy exactMatch = new ExactMatch();
+ exactMatch.search(drive.getDescription());
+
+ SearchStrategy naiveMatch = new NaiveMatching();
+ naiveMatch.search(drive.getDescription());
+
+ SearchStrategy semanticMatch = new SemanticMatch();
+ semanticMatch.search(drive.getDescription());
+ }
+ public void visit(SeaGateDriveV2 drive)
{
+ SearchStrategy exactMatch = new ExactMatch();
+ exactMatch.search(drive.getDescription());
+
+ SearchStrategy naiveMatch = new NaiveMatching();
+ naiveMatch.search(drive.getDescription());
+
+ SearchStrategy semanticMatch = new SemanticMatch();
+ semanticMatch.search(drive.getDescription());
+ }
+ public void visit(SeaGateDriveV3 drive)
+ {
+ SearchStrategy exactMatch = new ExactMatch();
+ exactMatch.search(drive.getDescription());
+
+ SearchStrategy naiveMatch = new NaiveMatching();
+ naiveMatch.search(drive.getDescription());
+ SearchStrategy semanticMatch = new SemanticMatch();
+ semanticMatch.search(drive.getDescription());
}
}
@@ -1,7 +1,13 @@
package customerSearch.util;
+import customerSearch.products.Version1.SeaGateDriveV1;
+import customerSearch.products.Version2.SeaGateDriveV2;
+import customerSearch.products.Version3.SeaGateDriveV3;
+
public interface ProductVisitor{
- public void visit();
+ public void visit(SeaGateDriveV1 drive);
+ public void visit(SeaGateDriveV2 drive);
+ public void visit(SeaGateDriveV3 drive);
}

0 comments on commit a7bce46

Please sign in to comment.