]> git.gag.com Git - debian/openrocket/blob - src/net/sf/openrocket/rocketcomponent/Stage.java
DGP - 1st printing
[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     /**
12      * Check whether the given type can be added to this component.  A Stage allows only BodyComponents to be added.
13      *
14      * @param type The RocketComponent class type to add.
15      *
16      * @return Whether such a component can be added.
17      */
18     @Override
19     public boolean isCompatible (Class<? extends RocketComponent> type) {
20         return BodyComponent.class.isAssignableFrom(type);
21     }
22
23     /**
24      * Accept a visitor to this Stage in the component hierarchy.
25      * 
26      * @param theVisitor  the visitor that will be called back with a reference to this Stage
27      */    
28     @Override 
29     public void accept (final ComponentVisitor theVisitor) {
30         theVisitor.visit(this);
31     }
32 }