Examples of HuffNode


Examples of org.candlepin.util.X509V3ExtensionUtil.HuffNode

            "1111", "010", "100", "101", "110", "00"};
        List<HuffNode> huffNodes = new ArrayList<HuffNode>();
        List<Object> members = new ArrayList<Object>();
        for (int i = 1; i <= 10; i++) {
            Object o = new Object();
            huffNodes.add(v3extensionUtil.new HuffNode(o, i));
            members.add(o);
        }
        HuffNode trieParent = v3extensionUtil.makeTrie(huffNodes);
        v3extensionUtil.printTrie(trieParent, 0);
        assertEquals(trieParent.getWeight(), 55);
        assertEquals(trieParent.getLeft().getWeight(), 22);
        assertEquals(trieParent.getRight().getWeight(), 33);

        int idx = 0;
        for (Object o : members) {
            assertEquals(paths[idx], v3extensionUtil.findHuffPath(trieParent, o));
            Object found = v3extensionUtil.findHuffNodeValueByBits(trieParent,
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.