/** * Returns the first matching structure AFTER the current position */ private Structure findStructure(String namePattern, int rep) throws HL7Exception { Structure s = null; while (s == null) { String currentNameInParent = iterate(false, false); String currentName = getCurrentStructure(0).getName(); if (matches(namePattern, currentName) || matches(namePattern, currentNameInParent)) { s = getCurrentStructure(rep); } } return s; }
/** * Returns the first matching structure AFTER the current position */ private Structure findStructure(String namePattern, int rep) throws HL7Exception { Structure s = null; while (s == null) { String currentNameInParent = iterate(false, false); String currentName = getCurrentStructure(0).getName(); if (matches(namePattern, currentName) || matches(namePattern, currentNameInParent)) { s = getCurrentStructure(rep); } } return s; }
private Structure getStructure(String namePattern, int rep) throws HL7Exception { Structure s = null; if (getCurrentStructure(0).equals(this.getRoot())) drillDown(0); String[] names = getCurrentStructure(0).getParent().getNames(); for (int i = 0; i < names.length && s == null; i++) { if (matches(namePattern, names[i])) { toChild(i); s = getCurrentStructure(rep); } } if (s == null) throw new HL7Exception("Can't find " + namePattern + " as a direct child"); return s; }
private Structure getStructure(String namePattern, int rep) throws HL7Exception { Structure s = null; if (getCurrentStructure(0).equals(this.getRoot())) drillDown(0); String[] names = getCurrentStructure(0).getParent().getNames(); for (int i = 0; i < names.length && s == null; i++) { if (matches(namePattern, names[i])) { toChild(i); s = getCurrentStructure(rep); } } if (s == null) throw new HL7Exception("Can't find " + namePattern + " as a direct child"); return s; }