/** * Creates a new bit set key. * @param bits the array of bits * @param numBits the number of bits that are '1' in the given bits */ private BitSetKey(long[] bits, int numBits) { this.bits = bits; names = new Name[numBits]; int i = nextSetBit(0); int j = 0; while (i >= 0) { names[j++] = BitSetENTCacheImpl.this.getName(i); i = nextSetBit(i + 1); } hashCode = calcHashCode(); }
/** * Creates a new bit set key. * @param bits the array of bits * @param numBits the number of bits that are '1' in the given bits */ private BitSetKey(long[] bits, int numBits) { this.bits = bits; names = new Name[numBits]; int i = nextSetBit(0); int j = 0; while (i >= 0) { names[j++] = BitSetENTCacheImpl.this.getName(i); i = nextSetBit(i + 1); } hashCode = calcHashCode(); }
/** * Creates a new bit set key. * @param names the node type names * @param maxBit the approximative number of the greatest bit */ public BitSetKey(Name[] names, int maxBit) { this.names = names; bits = new long[maxBit / BPW + 1]; for (int i = 0; i < names.length; i++) { int n = getBitNumber(names[i]); bits[n / BPW] |= OR_MASK[n % BPW]; } hashCode = calcHashCode(); }
/** * Creates a new bit set key. * @param names the node type names * @param maxBit the approximative number of the greatest bit */ public BitSetKey(Name[] names, int maxBit) { this.names = names; bits = new long[maxBit / BPW + 1]; for (int i = 0; i < names.length; i++) { int n = getBitNumber(names[i]); bits[n / BPW] |= OR_MASK[n % BPW]; } hashCode = calcHashCode(); }