private KeyValueResult satisfies(long key, int itemCount, byte[] items) { int count = 0; for (int itemIndex = 0; itemIndex < items.length; itemIndex++) { byte item = items[itemIndex]; boolean found = false; for (int i = 0; i < 6; i++) { byte itemFound = ByteUtils.decodeByte(key, 2 + i); if (itemFound == Constants.ANY_ITEM_INDEX) { continue; } if (itemIndex == 0 && count++ > itemCount) { return null; } if (itemFound == item) { found = true; } } if (!found) { return null; } } if (count != itemCount) { return null; } KeyValueResult result = new KeyValueResult(); ByteUtils.decode(key, result.key); return result; }
private KeyValueResult satisfies(long key, int itemCount) { int count = 0; for (int i = 0; i < 6; i++) { byte itemFound = ByteUtils.decodeByte(key, 2 + i); if (itemFound == Constants.ANY_ITEM_INDEX) { continue; } if (count++ > itemCount) { return null; } } if (count != itemCount) { return null; } KeyValueResult result = new KeyValueResult(); ByteUtils.decode(key, result.key); return result; }