@ SuppressWarnings ( "unchecked" ) final Spliterator < E_OUT > sourceStageSpliterator ( ) { if ( this != sourceStage ) throw new IllegalStateException ( ) ; if ( linkedOrConsumed ) throw new IllegalStateException ( MSG_STREAM_LINKED ) ; linkedOrConsumed = true ; if ( sourceStage . sourceSpliterator != null ) { @ SuppressWarnings ( "unchecked" ) Spliterator < E_OUT > s = sourceStage . sourceSpliterator ; sourceStage . sourceSpliterator = null ; return s ; } else if ( sourceStage . sourceSupplier != null ) { @ SuppressWarnings ( "unchecked" ) Spliterator < E_OUT > s = ( Spliterator < E_OUT > ) sourceStage . sourceSupplier . get ( ) ; sourceStage . sourceSupplier = null ; return s ; } else { throw new IllegalStateException ( MSG_CONSUMED ) ; } }
Gets the source stage spliterator if this pipeline stage is the source stage . The pipeline is consumed after this method is called and returns successfully .