/** * returns the object for the given index * @param index the index * @param store an object to store the result * @return */ public final T get(int index, T store) { serialize(); int j = getCompactIndex(index); return deserialize(j, store); }
/** * decompress and return object array * @return decompress and return object array */ @SuppressWarnings("unchecked") public final T[] toObjectArray() { try { T[] compactArr = (T[]) Array.newInstance(getElementClass(), getSerializedSize() / getTupleSize()); for (int i = 0; i < compactArr.length; i++) { compactArr[i] = getElementClass().newInstance(); deserialize(i, compactArr[i]); } T[] objArr = (T[]) Array.newInstance(getElementClass(), getTotalObjectSize()); for (int i = 0; i < objArr.length; i++) { int compactIndex = getCompactIndex(i); objArr[i] = compactArr[compactIndex]; } return objArr; } catch (Exception e) { return null; } }
/** * returns the object for the given index * @param index the index * @param store an object to store the result * @return */ public final T get(int index, T store) { serialize(); int j = getCompactIndex(index); return deserialize(j, store); }
/** * returns the object for the given index * @param index the index * @param store an object to store the result * @return */ public final T get(int index, T store) { serialize(); int j = getCompactIndex(index); return deserialize(j, store); }
/** * decompress and return object array * @return decompress and return object array */ public final T[] toObjectArray() { try { T[] compactArr = (T[]) Array.newInstance(getElementClass(), getSerializedSize() / getTupleSize()); for (int i = 0; i < compactArr.length; i++) { compactArr[i] = getElementClass().newInstance(); deserialize(i, compactArr[i]); } T[] objArr = (T[]) Array.newInstance(getElementClass(), getTotalObjectSize()); for (int i = 0; i < objArr.length; i++) { int compactIndex = getCompactIndex(i); objArr[i] = compactArr[compactIndex]; } return objArr; } catch (Exception e) { return null; } }
/** * decompress and return object array * @return decompress and return object array */ @SuppressWarnings("unchecked") public final T[] toObjectArray() { try { T[] compactArr = (T[]) Array.newInstance(getElementClass(), getSerializedSize() / getTupleSize()); for (int i = 0; i < compactArr.length; i++) { compactArr[i] = getElementClass().newInstance(); deserialize(i, compactArr[i]); } T[] objArr = (T[]) Array.newInstance(getElementClass(), getTotalObjectSize()); for (int i = 0; i < objArr.length; i++) { int compactIndex = getCompactIndex(i); objArr[i] = compactArr[compactIndex]; } return objArr; } catch (Exception e) { return null; } }