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

Method getParentIdPath

code/src/java/pcgen/core/character/EquipSet.java:278–299  ·  view source on GitHub ↗

the Parent Id Path is everything except our Id if id_path is "0.2.8.15", our Parent Id is "0.2.8" @return parent id path

()

Source from the content-addressed store, hash-verified

276 * @return parent id path
277 **/
278 public String getParentIdPath()
279 {
280 final StringBuilder buf = new StringBuilder(50);
281
282 // get all tokens and include the delimiter
283 try
284 {
285 final StringTokenizer aTok = new StringTokenizer(id_path, Constants.EQUIP_SET_PATH_SEPARATOR, true);
286
287 // get all tokens (and delimiters) except last two
288 for (int i = aTok.countTokens() - 2; i > 0; i--)
289 {
290 buf.append(aTok.nextToken());
291 }
292 }
293 catch (NullPointerException e)
294 {
295 Logging.errorPrint("Error in EquipSet.getParentIdPath", e);
296 }
297
298 return buf.toString();
299 }
300
301 /**
302 * Set's the number of items in this equipset

Callers 15

addChildrenToPathMethod · 0.95
shiftEquipSetsDownMethod · 0.95
sortEquipmentMethod · 0.95
delEquipSetMethod · 0.95
isPartOfMethod · 0.95
parseEquipmentSetLineMethod · 0.95
initEquipSetMethod · 0.80
getNewIdPathMethod · 0.80
isRootMethod · 0.80
getCalcEquipSetIdMethod · 0.80
canEquipItemMethod · 0.80
getNewChildIdMethod · 0.80

Calls 4

errorPrintMethod · 0.95
nextTokenMethod · 0.80
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected