b16cd4b660e96a39c42d99533f66061cea79080f
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / Stage.java
1 package net.sf.openrocket.rocketcomponent;
2
3 public class Stage extends ComponentAssembly {
4         
5     @Override
6     public String getComponentName () {
7         return "Stage";
8     }
9         
10         
11         @Override
12         public boolean allowsChildren() {
13                 return true;
14         }
15         
16     /**
17          * Check whether the given type can be added to this component.  A Stage allows 
18          * only BodyComponents to be added.
19      *
20      * @param type The RocketComponent class type to add.
21      *
22      * @return Whether such a component can be added.
23      */
24     @Override
25     public boolean isCompatible (Class<? extends RocketComponent> type) {
26         return BodyComponent.class.isAssignableFrom(type);
27     }
28
29     /**
30      * Accept a visitor to this Stage in the component hierarchy.
31      * 
32      * @param theVisitor  the visitor that will be called back with a reference to this Stage
33      */    
34     @Override 
35     public void accept (final ComponentVisitor theVisitor) {
36         theVisitor.visit(this);
37     }
38 }