Browse Source

pliki do wzorca Strategy

master
Piotr Dergun 10 years ago
parent
commit
170f480dcd
3 changed files with 39 additions and 0 deletions
  1. +15
    -0
      src/main/java/db/AllRecipes.java
  2. +7
    -0
      src/main/java/db/SearchRecipe.java
  3. +17
    -0
      src/main/java/db/SearchRecipeNameTag.java

+ 15
- 0
src/main/java/db/AllRecipes.java View File

@ -0,0 +1,15 @@
package db;
import java.util.List;
public class AllRecipes extends SearchRecipe {
public List<String> obtainRecipeNames() {
Cookbook myCb = new Cookbook();
List<String> names = myCb.obtainNames();
myCb.closeConnection();
return names;
}
}

+ 7
- 0
src/main/java/db/SearchRecipe.java View File

@ -0,0 +1,7 @@
package db;
import java.util.List;
public abstract class SearchRecipe {
public abstract List<String> obtainRecipeNames();
}

+ 17
- 0
src/main/java/db/SearchRecipeNameTag.java View File

@ -0,0 +1,17 @@
package db;
import java.util.List;
import ksiazka.kucharska.FrmMain;
public class SearchRecipeNameTag extends SearchRecipe {
public List<String> obtainRecipeNames() {
Cookbook myCb = new Cookbook();
List<String> names = myCb.obtainSearchedNames(FrmMain.txtSearch.getText(), FrmMain.txtSearch.getText());
myCb.closeConnection();
return names;
}
}

Loading…
Cancel
Save