Example #1
0
  /**
   * Get the element without checking out-of-bound index.
   *
   * @param index index to the array element
   */
  private Object uncheckedGetElement(int index) {

    if (elementIsNull[index]) {
      return null;
    } else {
      if (!elementInited[index]) {
        elementInited[index] = true;
        if (arrayElements[index] == null) {
          arrayElements[index] =
              LazyBinaryFactory.createLazyBinaryObject((oi).getListElementObjectInspector());
        }
        arrayElements[index].init(bytes, elementStart[index], elementLength[index]);
      }
    }
    return arrayElements[index].getObject();
  }
 public ReusableRowContainer() {
   if (internalValueOi != null) {
     valueStruct = (LazyBinaryStruct) LazyBinaryFactory.createLazyBinaryObject(internalValueOi);
     needsComplexObjectFixup = hasComplexObjects(internalValueOi);
     if (needsComplexObjectFixup) {
       complexObjectArrayBuffer =
           new ArrayList<Object>(
               Collections.nCopies(internalValueOi.getAllStructFieldRefs().size(), null));
     } else {
       complexObjectArrayBuffer = null;
     }
   } else {
     valueStruct = null; // No rows?
     needsComplexObjectFixup = false;
     complexObjectArrayBuffer = null;
   }
   uselessIndirection = new ByteArrayRef();
   hashMapResult = new BytesBytesMultiHashMap.Result();
   clearRows();
 }