MCPcopy Create free account
hub / github.com/PCGen/pcgen / itemDepth

Method itemDepth

code/src/java/pcgen/core/Equipment.java:2916–2933  ·  view source on GitHub ↗

Returns how 'deep' in a structure an Equipment is. @return how 'deep' in a structure an Equipment is.

()

Source from the content-addressed store, hash-verified

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

Callers 3

getLongNameTokenMethod · 0.80
getLongNameTokenMethod · 0.80
getLongNameTokenMethod · 0.80

Calls 1

getParentMethod · 0.95

Tested by

no test coverage detected