|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.pivotselection.AbstractPivotChooser
public abstract class AbstractPivotChooser
Abstract class for pivot selection algorithms hierarchy This class provides basic methods for selecting and accessing pivots and automatically registers statistic DistanceComputations.PivotChooser, i.e. number of distance computations spent in choosing pivots. Pivots are automatically selected if additional pivots are required by pivot getter methods. Pivot selection also supports transactions - if a transaction is initialized, the actual state of the list of selected objects is remember. The transaction ends by either commiting all changes made to the list or by rolling back all the changes.
Field Summary | |
---|---|
protected static StatisticRefCounter |
counterBucketReadBuckets
Global bucket accesses refcounter statistic |
protected static StatisticCounter |
counterObjectDistComp
Global distance computations statistic counter |
protected static StatisticCounter |
counterPivotDistComp
Statistic counter for pivot chooser distance computations |
protected static StatisticRefCounter |
counterPivotReadBuckets
Statistic refcounter for pivot chooser accesses to bucket |
protected java.util.List<LocalAbstractObject> |
preselectedPivots
List of selected pivots |
protected java.util.Set<ObjectProvider<? extends LocalAbstractObject>> |
sampleProviders
Registered sample providers |
Constructor Summary | |
---|---|
AbstractPivotChooser()
|
Method Summary | |
---|---|
void |
addPivot(LocalAbstractObject pivot)
This method appends a new pivot to the currently existing list. |
void |
clear()
Clears the list of preselected pivots. |
void |
deregisterSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
Removes registration of a sample set provider that was previously registered (others are silently ignored). |
LocalAbstractObject |
getLastPivot()
Access to the last selected pivot. |
LocalAbstractObject |
getNextPivot()
Returns a new pivot that is freshly selected. |
LocalAbstractObject |
getPivot()
Access to the first selected pivot (even if more pivots are available). |
LocalAbstractObject |
getPivot(int position)
Returns a reference to a preselected pivot at the desired position. |
java.util.Iterator<LocalAbstractObject> |
iterator()
Provides a read-only iterator over the collection of currently selected pivots |
void |
registerSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
Registers a new sample set provider used by this pivot chooser to select pivots. |
LocalAbstractObject |
removeLastPivot()
Deletes the last pivot from the list of current pivots and returns it. |
void |
selectPivot()
Selects one pivot and appends it to the list of pivots. |
void |
selectPivot(int count)
Method for selecting pivots and appending them to the list of pivots. |
protected abstract void |
selectPivot(int count,
AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
This method carries out the actual pivot selection and must be implemented by subclasses. |
int |
size()
The number of currently selected pivots. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.List<LocalAbstractObject> preselectedPivots
protected final java.util.Set<ObjectProvider<? extends LocalAbstractObject>> sampleProviders
protected static final StatisticCounter counterPivotDistComp
protected static final StatisticCounter counterObjectDistComp
protected static final StatisticRefCounter counterPivotReadBuckets
protected static final StatisticRefCounter counterBucketReadBuckets
Constructor Detail |
---|
public AbstractPivotChooser()
Method Detail |
---|
public void clear()
public int size()
public java.util.Iterator<LocalAbstractObject> iterator()
public LocalAbstractObject getPivot()
public LocalAbstractObject getLastPivot()
public LocalAbstractObject getNextPivot()
public LocalAbstractObject getPivot(int position) throws java.lang.IndexOutOfBoundsException
position
- The possition (number) of the requested pivot
java.lang.IndexOutOfBoundsException
- Thrown if the pivot selection cannot select enough additional pivotspublic LocalAbstractObject removeLastPivot()
public void addPivot(LocalAbstractObject pivot)
pivot
- The pivot added to the preselected listpublic final void selectPivot()
public final void selectPivot(int count)
count
- Number of pivots to generateprotected abstract void selectPivot(int count, AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
addPivot
method.
count
- Number of pivots to generatesampleSetIterator
- Iterator over the sample set of objects to choose new pivots frompublic void registerSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
provider
- the sample set providerpublic void deregisterSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
provider
- the previously registered sample set provider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |