org.apache.solr.handler.component

## 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 of `PivotFacetValue`s associated with a `PivotFacetField` withs pecial tracking of a `PivotFacetValue` corrisponding to the `null` value when `FacetParams.FACET_MISSING` is used.
  See Also:
    `markDirty()`, `PivotFacetField`, `PivotFacetValue`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `PivotFacetFieldValueCollection.PivotFacetCountComparator` Sorts `PivotFacetValue` instances by their count
    `class` | `PivotFacetFieldValueCollection.PivotFacetValueComparator` Sorts `PivotFacetValue` instances by their value

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PivotFacetFieldValueCollection(int minCount, int offset, int limit, String fieldSort)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(PivotFacetValue pfValue)` Adds a `PivotFacetValue` to this collection -- callers must not use this method if a `PivotFacetValue` with the same value already exists in this collection
    `PivotFacetValue` | `get(Comparable value)` Fast lookup to retrieve a `PivotFacetValue` from this collection if it exists
    `PivotFacetValue` | `getAt(int index)` Fetchs a `PivotFacetValue` from this collection via the index, may not be used to fetch the `PivotFacetValue` corrisponding to the missing-value.
    `List<PivotFacetValue>` | `getExplicitValuesList()` Read-Only access to the Collection of `PivotFacetValue`s corrisponding to non-missing values.
    `int` | `getExplicitValuesListSize()` Size of `getExplicitValuesList()`
    `PivotFacetValue` | `getMissingValue()` The `PivotFacetValue` with corisponding to a a value of `null` when `FacetParams.FACET_MISSING` is used.
    `List<PivotFacetValue>` | `getNextLevelValuesToRefine()` Returns the appropriate sub-list of the explicit values that need to be refined, based on the `FacetParams.FACET_OFFSET` & `FacetParams.FACET_LIMIT` for this field.
    `Iterator<PivotFacetValue>` | `iterator()` Iterator over all elements in this Collection, including the result of `getMissingValue()` 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 of `PivotFacetValue`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()

      The `PivotFacetValue` with corisponding to a a value of `null` when `FacetParams.FACET_MISSING` is used.
      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 of `PivotFacetValue`s corrisponding to non-missing values.
      See Also:
        `getMissingValue()`

    - #### getExplicitValuesListSize

          public int getExplicitValuesListSize()

      Size of `getExplicitValuesList()`

    - #### size

          public int size()

      Total number of `PivotFacetValue`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 the `FacetParams.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 a `PivotFacetValue` from this collection if it exists
      Parameters:
        `value` - of the `PivotFacetValue` to lookup, if `null` this returns the same as `getMissingValue()`
      Returns:
        the corrisponding `PivotFacetValue` or null if there is no `PivotFacetValue` in this collection corrisponding to the specified value.

    - #### getAt

          public PivotFacetValue getAt(int index)

      Fetchs a `PivotFacetValue` from this collection via the index, may not be used to fetch the `PivotFacetValue` corrisponding to the missing-value.
      See Also:
        `getExplicitValuesList()`, `List.get(int)`, `getMissingValue()`

    - #### add

          public void add(PivotFacetValue pfValue)

      Adds a `PivotFacetValue` to this collection -- callers must not use this method if a `PivotFacetValue` 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.

      See Also:
        `PivotFacetField.trim()`, `PivotFacet.getTrimmedPivotsAsListOfNamedLists()`

    - #### 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 of `getMissingValue()` as the last element (if it exists)
      Specified by:
        `iterator` in interface `Iterable<PivotFacetValue>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.