Class CountingEnclosedIterable<T>

java.lang.Object
com.atlassian.jira.util.collect.CountingEnclosedIterable<T>
All Implemented Interfaces:
EnclosedIterable<T>, Sized

public class CountingEnclosedIterable<T> extends Object implements EnclosedIterable<T>
  • Constructor Details

    • CountingEnclosedIterable

      public CountingEnclosedIterable(EnclosedIterable<T> delegate)
  • Method Details

    • foreach

      public void foreach(Consumer<T> sink)
      Description copied from interface: EnclosedIterable
      Apply the sink to all elements in the Collection.
      Specified by:
      foreach in interface EnclosedIterable<T>
    • size

      public int size()
      Specified by:
      size in interface EnclosedIterable<T>
      Specified by:
      size in interface Sized
      Returns:
      the likely size of the objects passed into the sink in EnclosedIterable.foreach(Consumer). Be careful depending on this size being exact, as in many cases its best efforts value or may be unstable due to concurrent changes.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface EnclosedIterable<T>
      Specified by:
      isEmpty in interface Sized
      Returns:
      true if the there is no data behind it.
    • getCountConsumed

      public int getCountConsumed()