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 ofPivotFacetValue
s associated with aPivotFacetField
withs pecial tracking of aPivotFacetValue
corrisponding to thenull
value whenFacetParams.FACET_MISSING
is used.- See Also:
markDirty()
,PivotFacetField
,PivotFacetValue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PivotFacetFieldValueCollection.PivotFacetCountComparator
SortsPivotFacetValue
instances by their countstatic class
PivotFacetFieldValueCollection.PivotFacetValueComparator
SortsPivotFacetValue
instances 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 void
add(PivotFacetValue pfValue)
Adds aPivotFacetValue
to this collection -- callers must not use this method if aPivotFacetValue
with the same value already exists in this collectionPivotFacetValue
get(Comparable value)
Fast lookup to retrieve aPivotFacetValue
from this collection if it existsPivotFacetValue
getAt(int index)
Fetchs aPivotFacetValue
from this collection via the index, may not be used to fetch thePivotFacetValue
corrisponding to the missing-value.List<PivotFacetValue>
getExplicitValuesList()
Read-Only access to the Collection ofPivotFacetValue
s corrisponding to non-missing values.int
getExplicitValuesListSize()
Size ofgetExplicitValuesList()
PivotFacetValue
getMissingValue()
List<PivotFacetValue>
getNextLevelValuesToRefine()
Returns the appropriate sub-list of the explicit values that need to be refined, based on theFacetParams.FACET_OFFSET
&FacetParams.FACET_LIMIT
for this field.Iterator<PivotFacetValue>
iterator()
Iterator over all elements in this Collection, including the result ofgetMissingValue()
as the last element (if it exists)void
markDirty()
Indicates that the values in this collection have been modified by the caller.int
size()
Total number ofPivotFacetValue
s, including the "missing" value if used.void
sort()
Sorts the collection and recursively sorts the collections assocaited with any sub-pivots.String
toString()
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.-
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 the
PivotFacetValue
s contained in this collection must call this method after doing so.
-
getMissingValue
public PivotFacetValue getMissingValue()
- Returns:
- the appropriate
PivotFacetValue
object, 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 ofPivotFacetValue
s corrisponding to non-missing values.- See Also:
getMissingValue()
-
getExplicitValuesListSize
public int getExplicitValuesListSize()
Size ofgetExplicitValuesList()
-
size
public int size()
Total number ofPivotFacetValue
s, 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_LIMIT
for this field.- See Also:
getExplicitValuesList()
,List.subList(int, int)
-
get
public PivotFacetValue get(Comparable value)
Fast lookup to retrieve aPivotFacetValue
from this collection if it exists- Parameters:
value
- of thePivotFacetValue
to lookup, ifnull
this returns the same asgetMissingValue()
- Returns:
- the corrisponding
PivotFacetValue
or null if there is noPivotFacetValue
in this collection corrisponding to the specified value.
-
getAt
public PivotFacetValue getAt(int index)
Fetchs aPivotFacetValue
from this collection via the index, may not be used to fetch thePivotFacetValue
corrisponding to the missing-value.- See Also:
getExplicitValuesList()
,List.get(int)
,getMissingValue()
-
add
public void add(PivotFacetValue pfValue)
Adds aPivotFacetValue
to this collection -- callers must not use this method if aPivotFacetValue
with 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:
iterator
in interfaceIterable<PivotFacetValue>
-
-