/** * Drills down into the group at the given index within the current * group -- ie sets the location pointer to the first structure within the child * @param childNumber the index of the group child into which to drill * @param rep the group repetition into which to drill */ public void drillDown(int childNumber, int rep) throws HL7Exception { if (childNumber != -1) { Structure s = currentGroup.get(childNames[childNumber], rep); if (!(s instanceof Group)) { throw new HL7Exception("Can't drill into segment"); } Group group = (Group) s; //stack the current group and location GroupContext gc = new GroupContext(this.currentGroup, this.currentChild); this.ancestors.push(gc); this.currentGroup = group; } this.currentChild = 0; this.childNames = this.currentGroup.getNames(); }
/** * Drills down into the group at the given index within the current * group -- ie sets the location pointer to the first structure within the child * @param childNumber the index of the group child into which to drill * @param rep the group repetition into which to drill */ public void drillDown(int childNumber, int rep) throws HL7Exception { if (childNumber != -1) { Structure s = currentGroup.get(childNames[childNumber], rep); if (!(s instanceof Group)) { throw new HL7Exception("Can't drill into segment"); } Group group = (Group) s; //stack the current group and location GroupContext gc = new GroupContext(this.currentGroup, this.currentChild); this.ancestors.push(gc); this.currentGroup = group; } this.currentChild = 0; this.childNames = this.currentGroup.getNames(); }