Returns how 'deep' in a structure an Equipment is. @return how 'deep' in a structure an Equipment is.
()
| 2914 | * @return how 'deep' in a structure an Equipment is. |
| 2915 | */ |
| 2916 | public int itemDepth() |
| 2917 | { |
| 2918 | if (getParent() == null) |
| 2919 | { |
| 2920 | return 0; |
| 2921 | } |
| 2922 | |
| 2923 | int i = 1; |
| 2924 | Equipment anEquip = getParent(); |
| 2925 | |
| 2926 | while (anEquip.getParent() != null) |
| 2927 | { |
| 2928 | anEquip = anEquip.getParent(); |
| 2929 | ++i; |
| 2930 | } |
| 2931 | |
| 2932 | return i; |
| 2933 | } |
| 2934 | |
| 2935 | /** |
| 2936 | * load a "line" i.e. a String and use its data to populate the attributes |
no test coverage detected