Top Inners Fields Constructors Methods
com.vladsch.flexmark.experimental.util.collection.iteration

public Class MappingIterable<T, R>

extends Object
implements Iterable<R>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
org.jetbrains.annotations.NotNull, java.util.Iterator, java.util.function.Function

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final @NotNull Function<T, R>
private final @NotNull Iterable<T>

Constructor Summary

AccessConstructor and Description
public
MappingIterable(@NotNull Iterable<T> iterable, @NotNull Function<T, R> function)

Method Summary

Modifier and TypeMethod and Description
public @NotNull Iterator<R>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

myFunctionback to summary
private final @NotNull Function<T, R> myFunction
Annotations
@NotNull
myIterableback to summary
private final @NotNull Iterable<T> myIterable
Annotations
@NotNull

Constructor Detail

MappingIterableback to summary
public MappingIterable(@NotNull Iterable<T> iterable, @NotNull Function<T, R> function)

Method Detail

iteratorback to summary
public @NotNull Iterator<R> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:@NotNull Iterator<R>

an Iterator.

Annotations
@NotNull
@Override
com.vladsch.flexmark.experimental.util.collection.iteration back to summary

private Class MappingIterable.MyIterator<E, V>

extends Object
implements Iterator<V>
Class Inheritance
  • java.lang.Object
  • com.vladsch.flexmark.experimental.util.collection.iteration.MappingIterable.MyIterator
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private final @NotNull Function<E, V>
private final @NotNull Iterator<E>

Constructor Summary

AccessConstructor and Description
public
MyIterator(@NotNull Iterator<E> iterator, @NotNull Function<E, V> function)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public V
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

myFunctionback to summary
private final @NotNull Function<E, V> myFunction
Annotations
@NotNull
myIteratorback to summary
private final @NotNull Iterator<E> myIterator
Annotations
@NotNull

Constructor Detail

MyIteratorback to summary
public MyIterator(@NotNull Iterator<E> iterator, @NotNull Function<E, V> function)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public V next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:V

the next element in the iteration

Annotations
@Override