/** * 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); }
/** * 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; }
/** * Constructs a new BitSetBuffer from an existing one */ private BitSetBuffer( BitSetBuffer toCopyFrom ) { this.SetLength( toCopyFrom.size() ); this.or( toCopyFrom ); this.mPointer = toCopyFrom.pointer(); }
/** * Constructs a new BitSetBuffer from an existing one */ private BitSetBuffer(BitSetBuffer toCopyFrom) { this.SetLength(toCopyFrom.size()); this.or(toCopyFrom); this.mPointer = toCopyFrom.pointer(); }