Package xbird.util.collections

Examples of xbird.util.collections.CharArrayList


            data[i] = val;
            miss[j] = i;
            j += (val > maxcode) ? 1 : 0; // TODO can't eliminate if-then-else control hazard
        }
        // LOOP2: create patch-list       
        final CharArrayList exceptionList = segment.exceptionList;
        if(j > 0) {
            segment.firstException_ = miss[0];
            prev = miss[j - 1]; // last-patch
            for(int i = 0; i < j; i++) {
                int cur = miss[i];
                exceptionList.add(input[cur]);
                data[prev] = cur - prev - 1; // difference of the two exception
                prev = cur;
            }
        }
View Full Code Here


        }

        // LOOP2: patch it up
        int firstException = segment.firstException_;
        if(firstException != -1) {
            final CharArrayList exceptionList = segment.exceptionList;
            int cur = code[firstException]; // REVIEWME  exceptionList was empty
            for(int i = 0, next; cur < n; i++, cur = next) {
                output[cur] = exceptionList.get(i);
                next = cur + code[cur] + 1;
            }
            segment.nextException_ = cur - n;
        }
View Full Code Here

        public CompressedSegment(int bitwidth) {
            this.bitwidth_ = bitwidth;
            this.maxcode_ = 2 ^ bitwidth;
            this.codesBuf = new BitwiseCodec(4096);
            this.codes = null;
            this.exceptionList = new CharArrayList(64);
        }
View Full Code Here

            FastByteArrayInputStream codesIs = new FastByteArrayInputStream(b);
            BitInputStream codesBis = new BitInputStream(codesIs);
            int[] codes = new int[totalEntries];
            unpack(codesBis, bitwidth, codes, totalEntries);
            int exceptions = dis.readShort();
            CharArrayList exceptionList = new CharArrayList(exceptions);
            for(int i = 0; i < exceptions; i++) {
                char c = dis.readChar();
                exceptionList.add(c);
            }
            return new CompressedSegment(totalEntries, bitwidth, firstException, codes, exceptionList);
        }
View Full Code Here

        public CompressedSegment(int bitwidth) {
            this.bitwidth_ = bitwidth;
            this.maxcode_ = 2 ^ bitwidth;
            this.codesBuf = new BitwiseCodec(4096);
            this.codes = null;
            this.exceptionList = new CharArrayList(64);
        }
View Full Code Here

            FastByteArrayInputStream codesIs = new FastByteArrayInputStream(b);
            BitInputStream codesBis = new BitInputStream(codesIs);
            int[] codes = new int[totalEntries];
            unpack(codesBis, bitwidth, codes, totalEntries);
            int exceptions = dis.readShort();
            CharArrayList exceptionList = new CharArrayList(exceptions);
            for(int i = 0; i < exceptions; i++) {
                char c = dis.readChar();
                exceptionList.add(c);
            }
            return new CompressedSegment(totalEntries, bitwidth, firstException, codes, exceptionList);
        }
View Full Code Here

            data[i] = val;
            miss[j] = i;
            j += (val > maxcode) ? 1 : 0; // TODO can't eliminate if-then-else control hazard
        }
        // LOOP2: create patch-list       
        final CharArrayList exceptionList = segment.exceptionList;
        if(j > 0) {
            segment.firstException_ = miss[0];
            prev = miss[j - 1]; // last-patch
            for(int i = 0; i < j; i++) {
                int cur = miss[i];
                exceptionList.add(input[cur]);
                data[prev] = cur - prev - 1; // difference of the two exception
                prev = cur;
            }
        }
View Full Code Here

        }

        // LOOP2: patch it up
        int firstException = segment.firstException_;
        if(firstException != -1) {
            final CharArrayList exceptionList = segment.exceptionList;
            int cur = code[firstException]; // REVIEWME  exceptionList was empty
            for(int i = 0, next; cur < n; i++, cur = next) {
                output[cur] = exceptionList.get(i);
                next = cur + code[cur] + 1;
            }
            segment.nextException_ = cur - n;
        }
View Full Code Here

TOP

Related Classes of xbird.util.collections.CharArrayList

Copyright © 2018 www.massapicom. 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.