Class AbstractLongSpliterator

java.lang.Object
it.unimi.dsi.fastutil.longs.AbstractLongSpliterator
All Implemented Interfaces:
LongSpliterator, Spliterator<Long>, Spliterator.OfLong, Spliterator.OfPrimitive<Long,LongConsumer,Spliterator.OfLong>
Direct Known Subclasses:
LongBigSpliterators.AbstractIndexBasedSpliterator, LongSpliterators.AbstractIndexBasedSpliterator

public abstract class AbstractLongSpliterator extends Object implements LongSpliterator
An abstract class facilitating the creation of type-specific iterators.
API Notes:
Presently the class hosts finalized versions of default delegating methods such as forEachRemaining(it.unimi.dsi.fastutil.longs.LongConsumer).
  • Method Details

    • tryAdvance

      public final boolean tryAdvance(LongConsumer action)
      Attempts to perform the action on the next element, or do nothing but return false if there are no remaining elements.

      WARNING: Overriding this method is almost always a mistake, as this overload only exists to disambiguate. Instead, override the tryAdvance() overload that uses the JDK's primitive consumer type (e.g., IntConsumer).
      If Java supported final default methods, this would be one, but sadly it does not.

      If you checked and are overriding the version with java.util.function.XConsumer, and still see this warning, then your IDE is incorrectly conflating this method with the proper method to override, and you can safely ignore this message.

      Specified by:
      tryAdvance in interface LongSpliterator
      Parameters:
      action - the action to be performed on the next element.
      Returns:
      whether there was a next element the action was performed on
      See Also:
      Implementation Specification:
      This method just delegates to the interface default method, as the default method, but it is final, so it cannot be overridden.
    • forEachRemaining

      public final void forEachRemaining(LongConsumer action)
      Performs the given action for each remaining element until all elements have been processed or the action throws an exception.

      WARNING: Overriding this method is almost always a mistake, as this overload only exists to disambiguate. Instead, override the forEachRemaining() overload that uses the JDK's primitive consumer type (e.g. IntConsumer).

      If Java supported final default methods, this would be one, but sadly it does not.

      If you checked and are overriding the version with java.util.function.XConsumer, and still see this warning, then your IDE is incorrectly conflating this method with the proper method to override, and you can safely ignore this message.

      Specified by:
      forEachRemaining in interface LongSpliterator
      Parameters:
      action - the action to be performed for each element.
      See Also:
      Implementation Specification:
      This method just delegates to the interface default method, as the default method, but it is final, so it cannot be overridden.