Exemplo n.º 1
0
 /**
  * Constructor.
  */
 public ByteDataArray()
 {
     this.byteDatas = new ByteData[256];
     for (int i = 0; i < 256; i++)
     {
         this.byteDatas[i] = new ByteData((byte)(i - 128));
     }
     this.byteDataLinkedList = new ByteDataLinkedList();
     this.byteDataBinaryTree = new ByteDataBinaryTree();
     this.headerLength       = 0;
     this.binaryCounter      = 0;
 }
Exemplo n.º 2
0
            public ByteDataLinkedListTests()
            {
                this.byteData2 = new ByteData((byte)2);
                this.byteData2.setCount(2);
                this.byteData4 = new ByteData((byte)4);
                this.byteData4.setCount(4);
                this.byteData0 = new ByteData((byte)10);
                this.byteData3 = new ByteData((byte)3);
                this.byteData3.setCount(3);
                this.byteData1 = new ByteData((byte)1);
                this.byteData1.setCount(1);

                this.byteDataLinkedList = new ByteDataLinkedList();
            }
Exemplo n.º 3
0
 /**
  * Creates binary tree from the linked list.
  *
  * @param linkedList    Orderer ByteData as linked list
  */
 public void createBinaryTreeFromLinkedList(ByteDataLinkedList linkedList)
 {
     linkedList.startIteration();
     while (linkedList.checkObject() != null)
     {
         this.root = new ByteData((byte)0);
         ByteData left  = linkedList.nextObject();
         ByteData right = linkedList.nextObject();
         this.root.setLeftChild(left);
         this.root.setRightChild(right);
         left.setParent(this.root);
         right.setParent(this.root);
         this.root.setCount(left.getCount() + right.getCount());
         linkedList.add(this.root);
     }
 }
Exemplo n.º 4
0
            public ByteDataBinaryTreeTest()
            {
                byteData2.setCount(2);
                byteData4.setCount(4);
                byteData3.setCount(3);
                byteData1.setCount(1);
                byteDatas    = new ByteData[4];
                byteDatas[1] = byteData2;
                byteDatas[3] = byteData4;
                byteDatas[2] = byteData3;
                byteDatas[0] = byteData1;

                this.byteDataLinkedList = new ByteDataLinkedList();
                this.byteDataLinkedList.addArray(byteDatas);

                this.byteDataBinaryTree = new ByteDataBinaryTree();
            }