Class PivotFacetFieldValueCollection
- java.lang.Object
-
- org.apache.solr.handler.component.PivotFacetFieldValueCollection
-
- All Implemented Interfaces:
Iterable<PivotFacetValue>
public class PivotFacetFieldValueCollection extends Object implements Iterable<PivotFacetValue>
Emcapsulates a collection ofPivotFacetValues associated with aPivotFacetFieldwiths pecial tracking of aPivotFacetValuecorrisponding to thenullvalue whenFacetParams.FACET_MISSINGis used.- See Also:
markDirty(),PivotFacetField,PivotFacetValue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPivotFacetFieldValueCollection.PivotFacetCountComparatorSortsPivotFacetValueinstances by their countstatic classPivotFacetFieldValueCollection.PivotFacetValueComparatorSortsPivotFacetValueinstances by their value
-
Constructor Summary
Constructors Constructor Description PivotFacetFieldValueCollection(int minCount, int offset, int limit, String fieldSort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(PivotFacetValue pfValue)Adds aPivotFacetValueto this collection -- callers must not use this method if aPivotFacetValuewith the same value already exists in this collectionPivotFacetValueget(Comparable value)Fast lookup to retrieve aPivotFacetValuefrom this collection if it existsPivotFacetValuegetAt(int index)Fetchs aPivotFacetValuefrom this collection via the index, may not be used to fetch thePivotFacetValuecorrisponding to the missing-value.List<PivotFacetValue>getExplicitValuesList()Read-Only access to the Collection ofPivotFacetValues corrisponding to non-missing values.intgetExplicitValuesListSize()Size ofgetExplicitValuesList()PivotFacetValuegetMissingValue()List<PivotFacetValue>getNextLevelValuesToRefine()Returns the appropriate sub-list of the explicit values that need to be refined, based on theFacetParams.FACET_OFFSET&FacetParams.FACET_LIMITfor this field.Iterator<PivotFacetValue>iterator()Iterator over all elements in this Collection, including the result ofgetMissingValue()as the last element (if it exists)voidmarkDirty()Indicates that the values in this collection have been modified by the caller.intsize()Total number ofPivotFacetValues, including the "missing" value if used.voidsort()Sorts the collection and recursively sorts the collections assocaited with any sub-pivots.StringtoString()voidtrim()Destructive method that recursively prunes values from the data structure based on the counts for those values and the effective sort, mincount, limit, and offset being used for each field.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
PivotFacetFieldValueCollection
public PivotFacetFieldValueCollection(int minCount, int offset, int limit, String fieldSort)
-
-
Method Detail
-
markDirty
public void markDirty()
Indicates that the values in this collection have been modified by the caller. Any caller that manipulates thePivotFacetValues contained in this collection must call this method after doing so.
-
getMissingValue
public PivotFacetValue getMissingValue()
- Returns:
- the appropriate
PivotFacetValueobject, may be null if we "missing" is not in use, or if it does not meat the mincount.
-
getExplicitValuesList
public List<PivotFacetValue> getExplicitValuesList()
Read-Only access to the Collection ofPivotFacetValues corrisponding to non-missing values.- See Also:
getMissingValue()
-
getExplicitValuesListSize
public int getExplicitValuesListSize()
Size ofgetExplicitValuesList()
-
size
public int size()
Total number ofPivotFacetValues, including the "missing" value if used.- See Also:
getMissingValue(),getExplicitValuesList()
-
getNextLevelValuesToRefine
public List<PivotFacetValue> getNextLevelValuesToRefine()
Returns the appropriate sub-list of the explicit values that need to be refined, based on theFacetParams.FACET_OFFSET&FacetParams.FACET_LIMITfor this field.- See Also:
getExplicitValuesList(),List.subList(int, int)
-
get
public PivotFacetValue get(Comparable value)
Fast lookup to retrieve aPivotFacetValuefrom this collection if it exists- Parameters:
value- of thePivotFacetValueto lookup, ifnullthis returns the same asgetMissingValue()- Returns:
- the corrisponding
PivotFacetValueor null if there is noPivotFacetValuein this collection corrisponding to the specified value.
-
getAt
public PivotFacetValue getAt(int index)
Fetchs aPivotFacetValuefrom this collection via the index, may not be used to fetch thePivotFacetValuecorrisponding to the missing-value.- See Also:
getExplicitValuesList(),List.get(int),getMissingValue()
-
add
public void add(PivotFacetValue pfValue)
Adds aPivotFacetValueto this collection -- callers must not use this method if aPivotFacetValuewith the same value already exists in this collection
-
trim
public void trim()
Destructive method that recursively prunes values from the data structure based on the counts for those values and the effective sort, mincount, limit, and offset being used for each field.This method should only be called after all refinement is completed.
-
sort
public void sort()
Sorts the collection and recursively sorts the collections assocaited with any sub-pivots.- See Also:
FacetParams.FACET_SORT,PivotFacetField.sort()
-
iterator
public Iterator<PivotFacetValue> iterator()
Iterator over all elements in this Collection, including the result ofgetMissingValue()as the last element (if it exists)- Specified by:
iteratorin interfaceIterable<PivotFacetValue>
-
-