/** * @see org.apache.uima.cas.ShortArrayFS#toArray() */ public short[] toArray() { return (short[]) toArray(this.casImpl.getShortHeap().heap); }
/** * @see org.apache.uima.cas.ShortArrayFS#copyFromArray(short[], int, int, int) */ public void copyFromArray(short[] src, int srcOffset, int destOffset, int length) { copyFromJavaArray(src, srcOffset, casImpl.getShortHeap().heap, destOffset, length); }
/** * @see org.apache.uima.cas.ShortArrayFS#copyToArray(int, short[], int, int) */ public void copyToArray(int srcOffset, short[] dest, int destOffset, int length) { copyToJavaArray(this.casImpl.getShortHeap().heap, srcOffset, dest, destOffset, length); }
/** * @see org.apache.uima.cas.ShortArrayFS#copyToArray(int, String[], int, int) */ public void copyToArray(int srcOffset, String[] dest, int destOffset, int length) { casImpl.checkArrayBounds(addr, srcOffset, length); srcOffset += casImpl.getHeap().heap[casImpl.getArrayStartAddress(addr)]; final short[] heap = this.casImpl.getShortHeap().heap; for (int i = 0; i < length; i++) { dest[i + destOffset] = Short.toString(heap[i + srcOffset]); } }
break; case Slot_ShortRef: sb.append(cas.getShortHeap().getHeapValue(heap[iHeap + 2 + i])); break; case Slot_LongRef: case Slot_DoubleRef: {
@Override public short ll_getShortArrayValue(int fsRef, int position) { final int pos = this.getHeap().heap[getArrayStartAddress(fsRef)]; return this.getShortHeap().getHeapValue(pos + position); }
break; case Slot_ShortRef: sb.append(cas.getShortHeap().getHeapValue(heap[iHeap + 2 + i])); break; case Slot_LongRef: case Slot_DoubleRef: {
@Override public int ll_createShortArray(int arrayLength) { final int addr = ll_createAuxArray(TypeSystemImpl.shortArrayTypeCode, arrayLength); this.getHeap().heap[addr + arrayContentOffset] = this.getShortHeap().reserve(arrayLength); return addr; }
@Override public void ll_setShortArrayValue(int fsRef, int position, short value) { final int offset = this.getHeap().heap[getArrayStartAddress(fsRef)]; this.getShortHeap().setHeapValue(value, offset + position); if (this.svd.trackingMark != null) { this.logFSUpdate(fsRef, offset+position, ModifiedHeap.SHORTHEAP, 1); } }
System.arraycopy(cas.getByteHeap().heap, 0, this.byteHeapArray, 0, byteHeapSize); final int shortHeapSize = cas.getShortHeap().getSize(); this.shortHeapArray = new short[shortHeapSize]; System.arraycopy(cas.getShortHeap().heap, 0, this.shortHeapArray, 0, shortHeapSize);
shortHeapObj = cas.getShortHeap(); byteHeapObj = cas.getByteHeap();
void reinit(int[] heapMetadata, int[] heapArray, String[] stringTable, int[] fsIndex, byte[] byteHeapArray, short[] shortHeapArray, long[] longHeapArray) { createStringTableFromArray(stringTable); this.getHeap().reinit(heapMetadata, heapArray); if (byteHeapArray != null) { this.getByteHeap().reinit(byteHeapArray); } if (shortHeapArray != null) { this.getShortHeap().reinit(shortHeapArray); } if (longHeapArray != null) { this.getLongHeap().reinit(longHeapArray); } reinitIndexedFSs(fsIndex); }
this.getShortHeap().reset(); this.getLongHeap().reset();
public String printCasInfo(CASImpl cas) { int heapsz= cas.getHeap().getNextId() * 4; StringHeapDeserializationHelper shdh = cas.getStringHeap().serialize(); int charssz = shdh.charHeap.length * 2; int strintsz = cas.getStringHeap().getSize() * 8; int strsz = charssz + strintsz; int fsindexessz = cas.getIndexedFSs().length * 4; int bytessz = cas.getByteHeap().getSize(); int shortsz = cas.getShortHeap().getSize() * 2; int longsz = cas.getLongHeap().getSize() * 8; int total = heapsz + strsz + fsindexessz + bytessz + shortsz + longsz; return String.format("CAS info before compression: totalSize(bytes): %,d%n" + " mainHeap: %,d(%d%%)%n" + " Strings: [%,d(%d%%): %,d chars %,d ints]%n" + " fsIndexes: %,d(%d%%)%n" + " byte/short/long Heaps: [%,d %,d %,d]", total, heapsz, (100L*heapsz)/total, strsz, (100L*strsz)/ total, charssz, strintsz, fsindexessz, (100L*fsindexessz) / total, bytessz, shortsz, longsz ); }
String printCasInfo(CASImpl cas) { int heapsz= cas.getHeap().getNextId() * 4; StringHeapDeserializationHelper shdh = cas.getStringHeap().serialize(); int charssz = shdh.charHeap.length * 2; int strintsz = cas.getStringHeap().getSize() * 8; int strsz = charssz + strintsz; int fsindexessz = cas.getIndexedFSs().length * 4; int bytessz = cas.getByteHeap().getSize(); int shortsz = cas.getShortHeap().getSize() * 2; int longsz = cas.getLongHeap().getSize() * 8; int total = heapsz + strsz + fsindexessz + bytessz + shortsz + longsz; return String.format("CAS info before compression: totalSize(bytes): %,d%n" + " mainHeap: %,d(%d%%)%n" + " Strings: [%,d(%d%%): %,d chars %,d ints]%n" + " fsIndexes: %,d(%d%%)%n" + " byte/short/long Heaps: [%,d %,d %,d]", total, heapsz, (100L*heapsz)/total, strsz, (100L*strsz)/ total, charssz, strintsz, fsindexessz, (100L*fsindexessz) / total, bytessz, shortsz, longsz ); }
if (c1.getShortHeap().getHeapValue(c1heap[iHeap + 2] + i) != c2.getShortHeap().getHeapValue(c2heap[iHeap + 2] + i)) { return mismatchFs();
shortHeapObj = cas.getShortHeap(); byteHeapObj = cas.getByteHeap();
this.getStringHeap().getSize(), this.getByteHeap().getSize(), this.getShortHeap().getSize(), this.getLongHeap().getSize(), this);
shortHeapObj = cas.getShortHeap(); byteHeapObj = cas.getByteHeap();
shortHeapObj = cas.getShortHeap(); byteHeapObj = cas.getByteHeap();