*/
public class FieldList
{
+ /** Array of Field objects making the list */
private Field[] _fieldArray;
/**
* Constructor giving array of Field objects
- * @param inFieldArray
+ * @param inFieldArray array of Field objects
*/
public FieldList(Field[] inFieldArray)
{
/**
- * Check whether the FieldList contains the given
- * Field object
+ * Check whether the FieldList contains the given Field object
* @param inField Field to check
* @return true if the FieldList contains the given field
*/
}
+ /**
+ * Extend the field list to include the specified field
+ * @param inField Field to add
+ * @return new index of added Field
+ */
+ public int extendList(Field inField)
+ {
+ // See if field is already in list
+ int currIndex = getFieldIndex(inField);
+ if (currIndex >= 0) return currIndex;
+ // Need to extend - increase array size
+ int oldNumFields = _fieldArray.length;
+ Field[] fields = new Field[oldNumFields + 1];
+ System.arraycopy(_fieldArray, 0, fields, 0, oldNumFields);
+ _fieldArray = fields;
+ // Add new field and return index
+ _fieldArray[oldNumFields] = inField;
+ return oldNumFields;
+ }
+
+
/**
* Convert to String for debug
*/