@Override public int next() { int bucketValue; bucketValue = ORDINAL_NONE; while(bucketValue == ORDINAL_NONE) { currentBucket++; if(currentBucket >= numBuckets) return NO_MORE_ORDINALS; bucketValue = dataAccess.relativeBucketValue(setOrdinal, currentBucket); } return bucketValue; }
@Override public int next() { int currentBucketValue; currentBucketValue = dataAccess.relativeBucketValue(setOrdinal, currentBucket); if(currentBucketValue == ORDINAL_NONE) { return NO_MORE_ORDINALS; } currentBucket++; currentBucket &= (numBuckets - 1); return currentBucketValue; }
@Override public int relativeBucketValue(int ordinal, int bucketIndex) { return currentDataAccess().relativeBucketValue(ordinal, bucketIndex); }
private HollowSetCachedDelegate(HollowSetTypeDataAccess dataAccess, HollowSetTypeAPI typeAPI, int ordinal) { int size = dataAccess.size(ordinal); int ordinals[] = new int[HashCodes.hashTableSize(size)]; for(int i=0;i<ordinals.length;i++) { ordinals[i] = dataAccess.relativeBucketValue(ordinal, i); } this.ordinals = ordinals; this.size = size; this.hashMask = ordinals.length - 1; this.dataAccess = dataAccess; this.typeAPI = typeAPI; }
@Override public int relativeBucketValue(int ordinal, int bucketIndex) { recordStackTrace(); if(!ordinalIsPresent(ordinal)) return ((HollowSetTypeDataAccess)dataAccess.getTypeDataAccess(getSchema().getName(), ordinal)).relativeBucketValue(ordinal, bucketIndex); return removedRecords().relativeBucketValue(getMappedOrdinal(ordinal), bucketIndex); }