create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / rocketcomponent / ComponentAssembly.java
1 package net.sf.openrocket.rocketcomponent;
2
3 import java.util.Collection;
4 import java.util.Collections;
5
6 import net.sf.openrocket.util.Coordinate;
7
8
9
10 /**
11  * A base of component assemblies.
12  * <p>
13  * Note that the mass and CG overrides of the <code>ComponentAssembly</code> class
14  * overrides all sibling mass/CG as well as its own.
15  * 
16  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
17  */
18 public abstract class ComponentAssembly extends RocketComponent {
19
20         /**
21          * Sets the position of the components to POSITION_RELATIVE_AFTER.
22          * (Should have no effect.)
23          */
24         public ComponentAssembly() {
25                 super(RocketComponent.Position.AFTER);
26         }
27         
28         /**
29          * Null method (ComponentAssembly has no bounds of itself).
30          */
31         @Override
32         public Collection<Coordinate> getComponentBounds() { 
33                 return Collections.emptyList();
34         }
35
36         /**
37          * Null method (ComponentAssembly has no mass of itself).
38          */
39         @Override
40         public Coordinate getComponentCG() {
41                 return Coordinate.NUL;
42         }
43
44         /**
45          * Null method (ComponentAssembly has no mass of itself).
46          */
47         @Override
48         public double getComponentMass() {
49                 return 0;
50         }
51         
52         /**
53          * Null method (ComponentAssembly has no mass of itself).
54          */
55         @Override
56         public double getLongitudinalUnitInertia() {
57                 return 0;
58         }
59         
60         /**
61          * Null method (ComponentAssembly has no mass of itself).
62          */
63         @Override
64         public double getRotationalUnitInertia() {
65                 return 0;
66         }
67         
68         /**
69          * Components have no aerodynamic effect, so return false.
70          */
71         @Override
72         public boolean isAerodynamic() {
73                 return false;
74         }
75         
76         /**
77          * Component have no effect on mass, so return false (even though the override values
78          * may have an effect).
79          */
80         @Override
81         public boolean isMassive() {
82                 return false;
83         }
84
85         @Override
86         public boolean getOverrideSubcomponents() {
87                 return true;
88         }
89
90         @Override
91         public void setOverrideSubcomponents(boolean override) {
92                 // No-op
93         }
94         
95         @Override
96         public boolean isOverrideSubcomponentsEnabled() {
97                 return false;
98         }
99         
100 }