34940b00921df57ffc06a3267cfbe959ea90c6f4
[debian/openrocket] / src / net / sf / openrocket / preset / RocketComponentPreset.java
1 package net.sf.openrocket.preset;
2
3 import net.sf.openrocket.motor.Manufacturer;
4 import net.sf.openrocket.rocketcomponent.RocketComponent;
5
6 /**
7  * A model for a preset component.
8  * <p>
9  * A preset component contains a component class type, manufacturer information,
10  * part information, and getter methods for various properties of the component.
11  * 
12  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
13  */
14 public abstract class RocketComponentPreset {
15         
16         private final Class<? extends RocketComponent> componentClass;
17         private final Manufacturer manufacturer;
18         private final String partName;
19         private final String partNo;
20         private final String partDescription;
21         
22         
23         public RocketComponentPreset(Class<? extends RocketComponent> componentClass, Manufacturer manufacturer,
24                         String partName, String partNo, String partDescription) {
25                 this.componentClass = componentClass;
26                 this.manufacturer = manufacturer;
27                 this.partName = partName;
28                 this.partNo = partNo;
29                 this.partDescription = partDescription;
30         }
31         
32         
33         /**
34          * Return the component class that this preset defines.
35          */
36         public Class<? extends RocketComponent> getComponentClass() {
37                 return componentClass;
38         }
39         
40         /**
41          * Return the manufacturer of this preset component.
42          */
43         public Manufacturer getManufacturer() {
44                 return manufacturer;
45         }
46         
47         /**
48          * Return the part name.  This is a short, human-readable name of the part.
49          */
50         public String getPartName() {
51                 return partName;
52         }
53         
54         /**
55          * Return the part number.  This is the part identifier (e.g. "BT-50").
56          */
57         public String getPartNo() {
58                 return partNo;
59         }
60         
61         /**
62          * Return the part description.  This is a longer description of the component.
63          */
64         public String getPartDescription() {
65                 return partDescription;
66         }
67         
68 }