/** * Returns an integer that contains all feature flags for this item. This must be kept in sync with the flags * defined in searchlib/parsequery/parse.h. * * @return The feature flags. */ private byte getFlagsFeature() { byte FLAGS_NORANK = 0x01; byte FLAGS_SPECIALTOKEN = 0x02; byte FLAGS_NOPOSITIONDATA = 0x04; byte FLAGS_ISFILTER = 0x08; byte ret = 0; if (!isRanked()) { ret |= FLAGS_NORANK; } if (isFromSpecialToken()) { ret |= FLAGS_SPECIALTOKEN; } if (!usePositionData()) { ret |= FLAGS_NOPOSITIONDATA; } if (isFilter()) { ret |= FLAGS_ISFILTER; } return ret; }
private void copyAttributes(Item blockAsItem, Item replacement) { copyWeight(blockAsItem, replacement); replacement.setCreator(blockAsItem.getCreator()); replacement.setRanked(blockAsItem.isRanked()); replacement.setPositionData(blockAsItem.usePositionData()); }