Examples of Bitfield


Examples of net.yacy.kelondro.order.Bitfield

    public int urlcomps() {
        return (0xff & this.entry.getColByte(col_urlComps));
    }

    public Bitfield flags() {
        return new Bitfield(this.entry.getColBytes(col_flags, false));
    }
View Full Code Here

Examples of net.yacy.kelondro.order.Bitfield

     * @param args
     */
    public static void main(final String[] args) {
        try {
            final DigestURI url = new DigestURI("http", "www.yacy.net", 80, "/");
            final URIMetadataRow urlRef = new URIMetadataRow(url, "YaCy Homepage", "", "", "", 0.0f, 0.0f, new Date(), new Date(), new Date(), "", new byte[] {}, 123, 42, '?', new Bitfield(), UTF8.getBytes("de"), 0, 0, 0, 0, 0, 0);
            final EventOrigin stackNo = EventOrigin.LOCAL_CRAWLING;
            System.out.println("valid test:\n=======");
            // add
            stack(urlRef, urlRef.hash(), url.hash(), stackNo);
            // size
View Full Code Here

Examples of net.yacy.kelondro.order.Bitfield

        this.appdate       = (appdate == null) ? 0 : appdate.getTime();
        this.profileHandle = profileHandle; // must not be null
        this.depth         = depth;
        this.anchors       = anchors;
        this.forkfactor    = forkfactor;
        this.flags         = new Bitfield(rowdef.width(10));
        this.statusMessage = "loaded(args)";
        this.initialHash   = url.hashCode();
        this.status        = WorkflowJob.STATUS_INITIATED;
        this.size          = size;
    }
View Full Code Here

Examples of net.yacy.kelondro.order.Bitfield

        this.appdate = entry.getColLong(5);
        this.profileHandle = (entry.empty(6)) ? null : entry.getColASCII(6).trim();
        this.depth = (int) entry.getColLong(7);
        this.anchors = (int) entry.getColLong(8);
        this.forkfactor = (int) entry.getColLong(9);
        this.flags = new Bitfield(entry.getColBytes(10, true));
        //this.loaddate = entry.getColLong(12);
        //this.lastmodified = entry.getColLong(13);
        this.size = entry.getColLong(14);
        this.statusMessage        = "loaded(kelondroRow.Entry)";
        this.initialHash   = this.url.hashCode();
View Full Code Here

Examples of org.apache.poi.util.BitField

        }
    }

    protected void fillFields(byte [] data, short size, int offset)
    {
        fHighByte = new BitField(0x01); //have to init here, since we are being called
                                        //from super, and class level init hasnt been done.
        field_1_xf_index = LittleEndian.getShort(data, 0 + offset);
        if (getType() == STYLE_BUILT_IN)
        {
            field_2_builtin_style       = data[ 2 + offset ];
View Full Code Here

Examples of org.apache.poi.util.BitField

        }
    }

    protected void fillFields(byte [] data, short size, int offset)
    {
        fHighByte = new BitField(0x01); //have to init here, since we are being called
                                        //from super, and class level init hasnt been done.
        field_1_xf_index = LittleEndian.getShort(data, 0 + offset);
        if (getType() == STYLE_BUILT_IN)
        {
            field_2_builtin_style       = data[ 2 + offset ];
View Full Code Here

Examples of org.h2.util.BitField

        testRandomSetRange();
    }

    private void testNextClearBit() {
        BitSet set = new BitSet();
        BitField field = new BitField();
        set.set(0, 640);
        field.set(0, 640, true);
        assertEquals(set.nextClearBit(0), field.nextClearBit(0));

        Random random = new Random(1);
        field = new BitField();
        field.set(0, 500, true);
        for (int i = 0; i < 100000; i++) {
            int a = random.nextInt(120);
            int b = a + 1 + random.nextInt(200);
            field.clear(a);
            field.clear(b);
            assertEquals(b, field.nextClearBit(a + 1));
            field.set(a);
            field.set(b);
        }
    }
View Full Code Here

Examples of org.h2.util.BitField

            field.set(b);
        }
    }

    private void testByteOperations() {
        BitField used = new BitField();
        testSetFast(used, false);
        testSetFast(used, true);
    }
View Full Code Here

Examples of org.h2.util.BitField

            }
        }
    }

    private void testRandom() {
        BitField bits = new BitField();
        BitSet set = new BitSet();
        int max = 300;
        int count = 100000;
        Random random = new Random(1);
        for (int i = 0; i < count; i++) {
            int idx = random.nextInt(max);
            if (random.nextBoolean()) {
                if (random.nextBoolean()) {
                    bits.set(idx);
                    set.set(idx);
                } else {
                    bits.clear(idx);
                    set.clear(idx);
                }
            } else {
                assertEquals(set.get(idx), bits.get(idx));
                assertEquals(set.nextClearBit(idx), bits.nextClearBit(idx));
                assertEquals(set.length(), bits.length());
            }
        }
    }
View Full Code Here

Examples of org.h2.util.BitField

            }
        }
    }

    private void testGetSet() {
        BitField bits = new BitField();
        for (int i = 0; i < 10000; i++) {
            bits.set(i);
            if (!bits.get(i)) {
                fail("not set: " + i);
            }
            if (bits.get(i + 1)) {
                fail("set: " + i);
            }
        }
        for (int i = 0; i < 10000; i++) {
            if (!bits.get(i)) {
                fail("not set: " + i);
            }
        }
        for (int i = 0; i < 1000; i++) {
            int k = bits.nextClearBit(0);
            if (k != 10000) {
                fail("" + k);
            }
        }
    }
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.