/** * Get the values of the fields as an ArrayList. * * @param nullSequence * The sequence for the NULL value * @return The values of the fields as an ArrayList. */ public ArrayList<Object> getFieldsAsList() { if (cachedList == null) { cachedList = new ArrayList<Object>(); } else { cachedList.clear(); } for (int i = 0; i < fieldInfoList.length; i++) { cachedList.add(fieldInfoList[i].uncheckedGetField()); } return cachedList; } }
/** * Get one field out of the struct. * * If the field is a primitive field, return the actual object. Otherwise * return the LazyObject. This is because PrimitiveObjectInspector does not * have control over the object used by the user - the user simply directly * use the Object instead of going through Object * PrimitiveObjectInspector.get(Object). * * NOTE: separator and nullSequence has to be the same each time this method * is called. These two parameters are used only once to parse each record. * * @param fieldID * The field ID * @param nullSequence * The sequence for null value * @return The field as a LazyObject */ public Object getField(int fieldID) { return fieldInfoList[fieldID].uncheckedGetField(); }