de.caff.generics.util.combi

## Class IntPartitions.Partition

- java.lang.Object
- - de.caff.generics.util.combi.IntPartitions.Partition

- All Implemented Interfaces:
    Countable<IntPartitions.Part>, Indexable<IntPartitions.Part>, Sizeable, java.lang.Iterable<IntPartitions.Part>
  Enclosing class:
    IntPartitions

      public static class IntPartitions.Partition
      extends java.lang.Object
      implements Indexable<IntPartitions.Part>

  One partition.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface de.caff.generics.Indexable

      `Indexable.Base<TT>, Indexable.IndexableSpliterator<TElem>, Indexable.ListView<T>`

  - ### Field Summary

    - ### Fields inherited from interface de.caff.generics.Indexable

      `EMPTY, EMPTY_INDEXABLE_STRING`

    - ### Fields inherited from interface de.caff.generics.Sizeable

      `NULL`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IntPartitions.Partition` | `frozen()` Get a frozen version of this countable.
    `IntPartitions.Part` | `get(int index)` Get the element at the given index.
    `int` | `getSumOfCounts()` Get the sum over all counts.
    `int` | `size()` Get the size.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface de.caff.generics.Indexable

      `addToArray, addToArray, addToCollection, asBase, asCollection, asList, binarySearch, checkIndex, combine, compare, downCast, emptyIndexable, equal, findAll, findAllX, findFirst, findFirst, findFirst, findFirstX, findLast, findLast, findLast, findNext, findNext, findNext, findNextX, findPrevious, findPrevious, findPrevious, first, firstMatch, firstMatch, firstMatchX, forEachEntry, forEachEntryFragile, fromArray, fromCollection, fromCollection, fromCountable, fromCountable, fromEnumeration, fromEnumeration, fromIterable, fromIterable, fromIterable, fromIterable, fromIterator, fromList, fromOptional, frozenSpliterator, getMod, gyt, hash, headSet, indexedView, indexes, init, initByIndex, initFragile, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, listIterator, mapArray, optional, ordered, reverse, rotated, singleton, spliterator, subSet, sybSet, tailSet, toString, view, view, viewArray, viewArray, viewAsBooleanIndexable, viewAsByteIndexable, viewAsCharIndexable, viewAsDict, viewAsDoubleIndexable, viewAsFloatIndexable, viewAsIntIndexable, viewAsLongIndexable, viewAsShortIndexable, viewByIndex, viewFragile, viewList, viewList, viewListN, viewListN, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, withAppendedItem, withCachedHash, withExchangedItemAt, withInsertedItemAt, withPrependedItem, withRemovedItemAt, withSwappedItemsAt`

    - ### Methods inherited from interface de.caff.generics.Countable

      `addAllTo, combined, combined, containsEq, containsRef, downCast, empty, equal, equals, filtered, filteredToIndexable, filterToCountable, firstOrNull, foldLeft, forEachFragile, freeze, frozen, getAny, groupingBy, groupingBy, hasAll, hasAny, isSorted, isStrictlySorted, lastOrNull, mappingBy, mappingBy, optFirst, optLast, orderedCombination, parellelStream, sorted, stream, toArray, toArray, toList, toString, uniform, viewCollection, viewCollection, viewCollectionN, viewCollectionN`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Method Detail

    - #### getSumOfCounts

          public int getSumOfCounts()

      Get the sum over all counts.
      Returns:
        sum of the `counts` of all parts used in this partition

    - #### get

          public IntPartitions.Part get(int index)

      Description copied from interface: `Indexable`
      Get the element at the given index.
      Specified by:
        `get` in interface `Indexable<IntPartitions.Part>`
      Parameters:
        `index` - index between `0` and `size() - 1`
      Returns:
        element at the given index

    - #### size

          public int size()

      Description copied from interface: `Sizeable`
      Get the size. Size is never negative.
      Specified by:
        `size` in interface `Sizeable`
      Returns:
        the size of this object, usually the number of contained elements, must not be negative

    - #### frozen

          @NotNull
          public IntPartitions.Partition frozen()

      Description copied from interface: `Countable`
      Get a frozen version of this countable.

      Often countables are used as a view to underlying collections. Although this interface is immutable, the underlying collection might nevertheless change. This method copies the current state of this countable into an unmodifiable state, and returns a Countable which is stable in size and will return always the same elements. Beware: it is still possible that any element itself changes when the elements are mutable. Use `Countable.frozen(Function, boolean)` to take care of this.

      Calling `frozen()` again on the returned object will just return the object itself, so you can safely call this method more than once.

      Specified by:
        `frozen` in interface `Countable<IntPartitions.Part>`
      Returns:
        frozen indexable version of this countable