pliki do wzorca Strategy
This commit is contained in:
1 parent
ce03bfe1eb
commit
170f480dcd
3 files changed
+39
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package db;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class SearchRecipe {
|
||||
public abstract List<String> obtainRecipeNames();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user