Beispiel #1
0
        /**
         * Static method to construct a new BitSetBuffer, preloaded with the bits
         * from the preload parameter, and then filled with the bits from the
         * second bitsetbuffer parameter.
         *
         * @param preloadBits - boolean array of bits to be prepended to the new
         *          bitset
         * @param bitsetToAppend - full bitset to be appended to the residual bits array
         * @return - new Bitset preloaded with residual bits and new bitset
         */
        public static BitSetBuffer merge(bool[] preloadBits, BitSetBuffer bitsetToAppend)
        {
            BitSetBuffer returnValue = new BitSetBuffer(preloadBits.Length + bitsetToAppend.size(), preloadBits);

            int pointer = 0;

            while (pointer < bitsetToAppend.size() && !returnValue.isFull())
            {
                try
                {
                    returnValue.add(bitsetToAppend[pointer]);
                }
                catch (BitSetFullException e)
                {
                    //e.printStackTrace();
                }

                pointer++;
            }

            return(returnValue);
        }
Beispiel #2
0
 public void dispose()
 {
     mMessage = null;
 }
Beispiel #3
0
 MessageAssembler(MessageFramer framer, int messageLength)
 {
     _framer  = framer;
     mMessage = new BitSetBuffer(messageLength);
 }
Beispiel #4
0
    /**
     * Static method to construct a new BitSetBuffer, preloaded with the bits
     * from the preload parameter, and then filled with the bits from the 
     * second bitsetbuffer parameter.
     * 
     * @param preloadBits - boolean array of bits to be prepended to the new
     *          bitset
     * @param bitsetToAppend - full bitset to be appended to the residual bits array 
     * @return - new Bitset preloaded with residual bits and new bitset
     */
    public static BitSetBuffer merge( bool[] preloadBits, BitSetBuffer bitsetToAppend )
    {
        BitSetBuffer returnValue = new BitSetBuffer( preloadBits.Length + bitsetToAppend.size(), preloadBits );

        int pointer = 0;
        
        while( pointer < bitsetToAppend.size() && !returnValue.isFull() )
        {
            try
            {
                returnValue.add( bitsetToAppend[pointer] );
            }
            catch( BitSetFullException e )
            {
                //e.printStackTrace();
            }
            
            pointer++;
        }
        
        return returnValue;
    }
Beispiel #5
0
 /**
  * Constructs a new BitSetBuffer from an existing one
  */
 private BitSetBuffer( BitSetBuffer toCopyFrom )
 {
     this.SetLength( toCopyFrom.size() );
     this.or( toCopyFrom );
     this.mPointer = toCopyFrom.pointer();
 }
Beispiel #6
0
 /**
  * Constructs a new BitSetBuffer from an existing one
  */
 private BitSetBuffer(BitSetBuffer toCopyFrom)
 {
     this.SetLength(toCopyFrom.size());
     this.or(toCopyFrom);
     this.mPointer = toCopyFrom.pointer();
 }