public class BucketBallRegion extends BallRegion implements BucketFilterAfterAdd, BucketFilterAfterRemove
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected LocalBucket |
bucket
The bucket on which this ball region should be maintained
|
protected boolean |
needsAdjusting
The flag if there was a modification to bucket
|
pivot, radius
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Constructor and Description |
---|
BucketBallRegion(LocalBucket bucket)
Creates a new instance of BucketBallRegion.
|
BucketBallRegion(LocalBucket bucket,
boolean registerAsFilter)
Creates a new instance of BucketBallRegion.
|
BucketBallRegion(LocalBucket bucket,
boolean registerAsFilter,
LocalAbstractObject pivot)
Creates a new instance of BucketBallRegion.
|
BucketBallRegion(LocalBucket bucket,
boolean registerAsFilter,
LocalAbstractObject pivot,
float radius)
Creates a new instance of BucketBallRegion with specified pivot and radius.
|
Modifier and Type | Method and Description |
---|---|
void |
adjustRadius()
Adjust the radius according to objects in the underlying bucket.
|
void |
filterAfterAdd(LocalAbstractObject object,
LocalBucket bucket)
Adjust this ball region whenever an object is inserted into a bucket.
|
void |
filterAfterRemove(LocalAbstractObject object,
LocalBucket bucket)
Filter object after its removal from a bucket.
|
LocalBucket |
getBucket()
Returns the bucket associated with this ball region.
|
float |
getRadius()
Returns current radius of this ball region.
|
boolean |
needsAdjusting()
Returns true if the underlying bucket has changed without adjusting the radius.
|
void |
setPivot(LocalAbstractObject pivot,
boolean updateRadius)
Sets the pivot for this ball region.
|
void |
setRadius(float radius)
Sets the radius for this ball region.
|
cloneRandomlyModify, dataEquals, dataHashCode, getDistanceImpl, getDistanceRegion, getDistanceRegion, getDistanceRegionImpl, getDistanceRegionImpl, getOverlapWith, getPivot, getSize, isCoveredByRegion, isCoveringRegion, writeData
binarySerialize, clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getBinarySize, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getMaxDistance, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, parseObjectComment, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream, writeObjectComment
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey, toString
protected final LocalBucket bucket
protected boolean needsAdjusting
public BucketBallRegion(LocalBucket bucket)
bucket
- the bucket on which the ball region should be maintainedpublic BucketBallRegion(LocalBucket bucket, boolean registerAsFilter)
bucket
- the bucket on which the ball region should be maintainedregisterAsFilter
- specifies if the automatic registration as bucket filter
is desirablepublic BucketBallRegion(LocalBucket bucket, boolean registerAsFilter, LocalAbstractObject pivot)
bucket
- the bucket on which the ball region should be maintainedregisterAsFilter
- specifies if the automatic registration as bucket filter
is desirablepivot
- the pivot for the new ball regionpublic BucketBallRegion(LocalBucket bucket, boolean registerAsFilter, LocalAbstractObject pivot, float radius)
bucket
- the bucket on which the ball region should be maintainedregisterAsFilter
- specifies if the automatic registration as bucket filter
is desirablepivot
- the pivot for the new ball regionradius
- the radius for the new ball regionpublic LocalBucket getBucket()
public float getRadius()
getRadius
in class BallRegion
public void setRadius(float radius) throws java.lang.IllegalArgumentException
setRadius
in class BallRegion
radius
- the new radiusjava.lang.IllegalArgumentException
- if the specified radius is negativepublic void setPivot(LocalAbstractObject pivot, boolean updateRadius)
LocalAbstractObject.MAX_DISTANCE
if updateRadius
is true.setPivot
in class BallRegion
pivot
- the new pivotupdateRadius
- specifies whether to update the region's radius or notpublic boolean needsAdjusting()
public void adjustRadius()
public void filterAfterAdd(LocalAbstractObject object, LocalBucket bucket)
filterAfterAdd
in interface BucketFilterAfterAdd
object
- the inserted objectbucket
- the bucket where the object will was insertedpublic void filterAfterRemove(LocalAbstractObject object, LocalBucket bucket)
BucketFilterAfterRemove
filterAfterRemove
in interface BucketFilterAfterRemove
object
- the removed objectbucket
- bucket, where the object has been stored