Examples of LongArrayList


Examples of org.rssowl.core.internal.persist.LongArrayList

    if (sorted) {
      fPersistedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
      fUpdatedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
      fRemovedEntities = new SortedLongArrayList(DEFAULT_CAPACITY);
    } else {
      fPersistedEntities = new LongArrayList(DEFAULT_CAPACITY);
      fUpdatedEntities = new LongArrayList(DEFAULT_CAPACITY);
      fRemovedEntities = new LongArrayList(DEFAULT_CAPACITY);
    }
  }
View Full Code Here

Examples of stallone.doubles.fastutils.LongArrayList

        };

        // reset inputfile pointer to start position
        this.randomAccessFile.seek(0);

        LongArrayList tempFramePositions = new LongArrayList(50000); // tmp vector to store the starting position of the
        // frames randomAccessFile input file (length of
        // vector can be increased, the length of a array
        // not !)
        int framesDetected = 0;
        long pos = 0;

        int magicRead; // frameHeader
        int noOfAtomsRead; // frameHeader

        int noOfAtomsRead2; // coordinates header
        int sizeOfCoordinates; // coordinates header

        /*
         * double realExpectedTime = 0.0d; double expectedTime = 0.0d; double
         * eps = 0.1d;
         */

        do
        {
            pos = randomAccessFile.getFilePointer();
            tempFramePositions.add(pos);

            // System.out.println("Frame " + framesDetected + " at " + pos );
            framesDetected++;

            magicRead = randomAccessFile.readInt(); // 4

            if (magicRead == this.magicNrFileVersion)
            {
                noOfAtomsRead = randomAccessFile.readInt(); // 4

                // frameNoRead = randomAccessFile.readInt(); // 4
                // simulationTime = randomAccessFile.readFloat();// 4 is simulation time
                // 36 is 3x3 cell axis a 4bytes each
                randomAccessFile.skipBytes(4 + 4 + 36);
                // 52 randomAccessFile total

                /*
                 * //200 - 0.4 System.out.println( "off: " +
                 * randomAccessFile.getFilePointer() + " frame# " + frameNoRead
                 * + " sim t: " + simulationTime + " expected t after reset: " +
                 * expectedTime + " real t: " + realExpectedTime); if (
                 * Math.abs( (double)simulationTime - expectedTime ) > eps ) {
                 * System.out.println( "Missing: off: " +
                 * randomAccessFile.getFilePointer() + " frame# " + frameNoRead
                 * + " sim t: " + simulationTime + " expected t after reset: " +
                 * expectedTime + " real t: " + realExpectedTime); expectedTime
                 * = simulationTime; } expectedTime += 0.2d; realExpectedTime +=
                 * 0.2d;
                 *
                 */


                // now entering coordinates header
                noOfAtomsRead2 = randomAccessFile.readInt();

                if (noOfAtomsRead == noOfAtomsRead2)
                {

                    if (noOfAtomsRead > 9)
                    { // compressed format (case b)

                        // 4 is precision
                        // 24 = (4 * 2 * 3 ) is min and max of x, y and z
                        // 4 is number of bits used for compression
                        randomAccessFile.skipBytes(4 + 24 + 4);

                        sizeOfCoordinates = randomAccessFile.readInt();

                        int mod4 = sizeOfCoordinates % 4;

                        if (mod4 > 0)
                        {
                            sizeOfCoordinates += (4 - mod4);
                        }

                        randomAccessFile.skipBytes(sizeOfCoordinates); // skip coordinates
                    }
                    else
                    { // uncompressed format (case a)

                        // x, y and z per atom a 4 bytes each
                        randomAccessFile.skipBytes(noOfAtomsRead * 3 * 4);
                    }
                }
                else
                {
                    throw new RuntimeException("Problem with atom sizes");
                } // end if-else
            }
            else
            {
                throw new RuntimeException("No magic bytes found. Error in trajectory.");
            } // end if-else
        }
        while (randomAccessFile.getFilePointer() < randomAccessFile.length());

        this.numOfFrames = framesDetected;

        // copy starting postion of frames from vector into an array and check their size
        int numberOfFrames = tempFramePositions.size();
        this.framePos = new long[numberOfFrames];
        this.frameBroken = new BitSet(numberOfFrames);

        long tmpPosition_old = 0; // tmp variable to calculate the size of a frame

        for (int i = 0; i < numberOfFrames; i++)
        {
            long tmpPosition = tempFramePositions.getLong(i);

            if (((tmpPosition - tmpPosition_old) % 4) != 0)
            { // check if the frame size is a multiple of 4 bytes
                this.frameBroken.set(i); // mark frame as broken
                System.err.println("WARNING: Frame " + i
View Full Code Here

Examples of xbird.util.collections.longs.LongArrayList

                    }
                    ptrs = MultiPtrs.readFrom(ptrTuple);
                }
                ptrsCache.put(pointer, ptrs);
            }
            final LongArrayList lptrs = ptrs.getPointers();
            final int size = lptrs.size();
            for(int i = 0; i < size; i++) {
                final long lptr = lptrs.get(i);
                final byte[] value;
                try {
                    value = retrieveTuple(lptr);
                } catch (DbException e) {
                    LOG.error(PrintUtils.prettyPrintStackTrace(e));
View Full Code Here

Examples of xbird.util.collections.longs.LongArrayList

            super();
        }

        public MultiPtrs(long ptr) {
            super(initData(ptr));
            this._ptrs = new LongArrayList(4);
            _ptrs.add(ptr);
            this._used = 1;
            this._free = 3;
        }
View Full Code Here

Examples of xbird.util.collections.longs.LongArrayList

            this._free = 3;
        }

        private MultiPtrs(byte[] b, long[] ptrs, int used, int free) {
            super(b);
            this._ptrs = new LongArrayList(ptrs, used);
            this._used = used;
            this._free = free;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.