/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: BitArray.java,v 1.2.4.1 2005/09/06 05:56:52 pvedula Exp $
*/
/**
* @author Morten Jorgensen
*/
private int[] _bits;
private int _bitSize;
private int _intSize;
private int _mask;
// This table is used to prevent expensive shift operations
// (These operations are inexpensive on CPUs but very expensive on JVMs.)
private final static int[] _masks = {
0x80000000, 0x40000000, 0x20000000, 0x10000000,
0x08000000, 0x04000000, 0x02000000, 0x01000000,
0x00800000, 0x00400000, 0x00200000, 0x00100000,
0x00080000, 0x00040000, 0x00020000, 0x00010000,
0x00008000, 0x00004000, 0x00002000, 0x00001000,
0x00000800, 0x00000400, 0x00000200, 0x00000100,
0x00000080, 0x00000040, 0x00000020, 0x00000010,
0x00000008, 0x00000004, 0x00000002, 0x00000001 };
private final static boolean DEBUG_ASSERTIONS = false;
/**
* Constructor. Defines the initial size of the bit array (in bits).
*/
public BitArray() {
this(32);
}
}
}
/**
* Set the mask for this bit array. The upper 8 bits of this mask
* indicate the DOM in which the nodes in this array belong.
*/
}
/**
* See setMask()
*/
public int getMask() {
return(_mask);
}
/**
* Returns the size of this bit array (in bits).
*/
public final int size() {
return(_bitSize);
}
/**
* Returns true if the given bit is set
*/
if (DEBUG_ASSERTIONS) {
throw new Error(
"Programmer's assertion in BitArray.getBit");
}
}
}
/**
* Returns the next set bit from a given position
*/
if (bits != 0) {
return((i << 5) + b);
}
}
}
startBit = 0;
}
return(DTMAxisIterator.END);
}
/**
* This method returns the Nth bit that is set in the bit array. The
* current position is cached in the following 4 variables and will
* help speed up a sequence of next() call in an index iterator. This
* method is a mess, but it is fast and it works, so don't fuck with it.
*/
// Return last node if position we're looking for is the same
// Start from beginning of position we're looking for is before
// the point where we left off the last time.
}
// Scan through the bit array - skip integers that have no bits set
return (_node);
}
}
}
_bit = 0;
}
}
return(0);
}
/**
* Returns the integer array in which the bit array is contained
*/
public final int[] data() {
return(_bits);
}
/**
* Sets a given bit
*/
if (DEBUG_ASSERTIONS) {
throw new Error(
"Programmer's assertion in BitArray.getBit");
}
}
final int i = (bit >>> 5);
}
/**
* Merge two bit arrays. This currently only works for nodes from
* a single DOM (because there is only one _mask per array).
*/
// Take other array's bits if we have node set
if (_last == -1) {
}
// Only merge if other array has any bits set
// Merge these bits into other array if other array is larger
}
else {
}
}
return(this);
}
/**
* Resizes the bit array - try to avoid using this method!!!
*/
}
}
}
}
/**
* Read the whole tree from a file (serialized)
*/
throws IOException, ClassNotFoundException {
}
}