/** * Inserts a repetition of a given Field into repetitions of that field by * name. * * @return The newly created and inserted field * @throws HL7Exception * if the named Structure is not part of this Group. */ public Type insertRepetition(int fieldNum, int index) throws HL7Exception { if (fieldNum < 1 || fieldNum > fields.size()) { throw new HL7Exception("The field " + fieldNum + " does not exist in the segment " + this.getClass().getName()); } List<Type> list = fields.get(fieldNum - 1); Type newType = createNewType(fieldNum); list.add(index, newType); return newType; }
/** * Inserts a repetition of a given Field into repetitions of that field by * name. * * @return The newly created and inserted field * @throws HL7Exception * if the named Structure is not part of this Group. */ public Type insertRepetition(int fieldNum, int index) throws HL7Exception { if (fieldNum < 1 || fieldNum > fields.size()) { throw new HL7Exception("The field " + fieldNum + " does not exist in the segment " + this.getClass().getName()); } List<Type> list = fields.get(fieldNum - 1); Type newType = createNewType(fieldNum); list.add(index, newType); return newType; }
Type newType = createNewType(number); arr.add(newType);
Type newType = createNewType(number); arr.add(newType);