Class RingElementSelector<T>

java.lang.Object
com.iohao.net.server.balanced.RingElementSelector<T>
All Implemented Interfaces:
ElementSelector<T>, Supplier<T>

public final class RingElementSelector<T> extends Object implements ElementSelector<T>
Round-robin selector backed by an array snapshot.
Since:
21.19
Author:
渔民小镇
date:
2024-10-19
  • Constructor Details

    • RingElementSelector

      public RingElementSelector(List<T> list)
  • Method Details

    • next

      public T next()
      Description copied from interface: ElementSelector
      Returns the next selected element.
      Specified by:
      next in interface ElementSelector<T>
      Returns:
      selected element, or null if none
    • get

      public T get()
      Specified by:
      get in interface Supplier<T>