Make ComponentPresetDao and interface with implementation in ComponentPresetDatabase...
[debian/openrocket] / core / src / net / sf / openrocket / database / ComponentPresetDao.java
1 package net.sf.openrocket.database;
2
3 import java.util.List;
4
5 import net.sf.openrocket.preset.ComponentPreset;
6
7 public interface ComponentPresetDao {
8
9         public List<ComponentPreset> listAll();
10         
11         public void insert( ComponentPreset preset );
12
13         public List<ComponentPreset> listForType( ComponentPreset.Type type );
14
15         /**
16          * Return a list of component presets based on the type.
17          * All components returned will be of Type type.
18          * 
19          * @param type  
20          * @param favorite if true, only return the favorites.  otherwise return all matching.
21          * @return
22          */
23         public List<ComponentPreset> listForType( ComponentPreset.Type type, boolean favorite );
24
25         public List<ComponentPreset> listForTypes( ComponentPreset.Type ... type );
26
27         public void setFavorite( ComponentPreset preset, boolean favorite );
28         
29 }