public DeleteState isDeleted(final long procId) { int bitmapIndex = getBitmapIndex(procId); int wordIndex = bitmapIndex >> ADDRESS_BITS_PER_WORD; if (wordIndex >= deleted.length) { return DeleteState.MAYBE; } // The left shift of java only takes care of the lowest several bits(5 for int and 6 for long), // so here we can use bitmapIndex directly, without mod 64 return (deleted[wordIndex] & (1L << bitmapIndex)) != 0 ? DeleteState.YES : DeleteState.NO; }
public boolean isModified(long procId) { int bitmapIndex = getBitmapIndex(procId); int wordIndex = bitmapIndex >> ADDRESS_BITS_PER_WORD; if (wordIndex >= modified.length) { return false; } // The left shift of java only takes care of the lowest several bits(5 for int and 6 for long), // so here we can use bitmapIndex directly, without mod 64 return (modified[wordIndex] & (1L << bitmapIndex)) != 0; }
void updateState(long procId, boolean isDeleted) { int bitmapIndex = getBitmapIndex(procId); int wordIndex = bitmapIndex >> ADDRESS_BITS_PER_WORD; long value = (1L << bitmapIndex); modified[wordIndex] |= value; if (isDeleted) { deleted[wordIndex] |= value; } else { deleted[wordIndex] &= ~value; } }
public boolean isModified(long procId) { int bitmapIndex = getBitmapIndex(procId); int wordIndex = bitmapIndex >> ADDRESS_BITS_PER_WORD; if (wordIndex >= modified.length) { return false; } // The left shift of java only takes care of the lowest several bits(5 for int and 6 for long), // so here we can use bitmapIndex directly, without mod 64 return (modified[wordIndex] & (1L << bitmapIndex)) != 0; }
void updateState(long procId, boolean isDeleted) { int bitmapIndex = getBitmapIndex(procId); int wordIndex = bitmapIndex >> ADDRESS_BITS_PER_WORD; long value = (1L << bitmapIndex); modified[wordIndex] |= value; if (isDeleted) { deleted[wordIndex] |= value; } else { deleted[wordIndex] &= ~value; } }
public DeleteState isDeleted(final long procId) { int bitmapIndex = getBitmapIndex(procId); int wordIndex = bitmapIndex >> ADDRESS_BITS_PER_WORD; if (wordIndex >= deleted.length) { return DeleteState.MAYBE; } // The left shift of java only takes care of the lowest several bits(5 for int and 6 for long), // so here we can use bitmapIndex directly, without mod 64 return (deleted[wordIndex] & (1L << bitmapIndex)) != 0 ? DeleteState.YES : DeleteState.NO; }