Interface WeightedListHeight

All Superinterfaces:
HeightProvider, Wrapper

@NullMarked @AsOf("3.0.0") public interface WeightedListHeight extends HeightProvider
A height provider which picks an entry from the distribution() proportionally to its weight, then samples that entry's provider.
Since:
3.0.0
See Also:
  • Method Details

    • minInclusive

      default VerticalAnchor minInclusive()
      Description copied from interface: HeightProvider
      The vertical anchor used as the minimum height.
      Specified by:
      minInclusive in interface HeightProvider
      Returns:
      the minimum anchor
    • maxInclusive

      default VerticalAnchor maxInclusive()
      Description copied from interface: HeightProvider
      The vertical anchor used as the maximum height.
      Specified by:
      maxInclusive in interface HeightProvider
      Returns:
      the maximum anchor
    • distribution

      @AsOf("3.0.0") WeightedList<HeightProvider> distribution()
      The weighted pool of providers to sample from.
      Returns:
      the weighted distribution
      Since:
      3.0.0
    • toBuilder

      @AsOf("3.3.0") default WeightedListHeight.Builder toBuilder()
      Creates a new builder with the same weighted distribution as this provider.
      Returns:
      a new builder with the same values
      Since:
      3.3.0
    • of

      @AsOf("3.0.0") static WeightedListHeight of(WeightedList<HeightProvider> distribution)
      Creates a new weighted list height provider.
      Parameters:
      distribution - the weighted pool of providers, which must not be empty
      Returns:
      the weighted list height provider
      Since:
      3.0.0
    • builder

      @AsOf("3.0.0") static WeightedListHeight.Builder builder()
      Creates a new builder.
      Returns:
      a new builder
      Since:
      3.0.0