public static <D, R> R nullGet(Mapping<? super D, ? extends R> mapping, D key) { return safeGet(mapping, key, null); }
public static <N1, E1, NP1, EP1, N2, E2, NP2, EP2> Mapping<N1, N2> copyUniversalPlain(UniversalGraph<N1, E1, NP1, EP1> in, MutableGraph<N2, E2, NP2, EP2> out, Mapping<? super NP1, ? extends NP2> npConversion, Mapping<? super EP1, ? extends EP2> epConversion) { Mapping<? super N1, ? extends NP2> npMapping = Mappings.compose(in::getNodeProperty, npConversion); Mapping<? super E1, ? extends EP2> epMapping = Mappings.compose(in::getEdgeProperty, epConversion); return copyPlain(in, out, npMapping, epMapping); }
@Override public Iterator<R> iterator() { return apply(mapping, coll.iterator()); }
public static <N1, E1, NP1, EP1, N2, E2, NP2, EP2> Mapping<N1, N2> copyUniversalTraversal(UniversalIndefiniteGraph<N1, E1, NP1, EP1> in, MutableGraph<N2, E2, NP2, EP2> out, TraversalOrder order, int limit, Collection<? extends N1> initialNodes, Mapping<? super NP1, ? extends NP2> npConversion, Mapping<? super EP1, ? extends EP2> epConversion) { Mapping<? super N1, ? extends NP2> npMapping = Mappings.compose(in::getNodeProperty, npConversion); Mapping<? super E1, ? extends EP2> epMapping = Mappings.compose(in::getEdgeProperty, epConversion); return copyTraversal(in, out, order, limit, initialNodes, npMapping, epMapping); }
/** * Applies a mapping to an iterable. The result is an iterable whose iterator returns the results of applying the * specified mapping to each of the elements returned by the original iterable. * * @param <D> * domain class. * @param <R> * range clas. * @param mapping * the mapping to apply. * @param it * the underlying iterable. * * @return the mapped iterable. */ public static <D, R> Iterable<R> apply(final Mapping<? super D, R> mapping, final Iterable<? extends D> it) { return () -> apply(mapping, it.iterator()); }
public static <N1, E1, NP1, EP1, N2, E2, NP2, EP2> Mapping<N1, N2> copyUniversalPlain(UniversalGraph<N1, E1, NP1, EP1> in, MutableGraph<N2, E2, NP2, EP2> out, Mapping<? super NP1, ? extends NP2> npConversion, Mapping<? super EP1, ? extends EP2> epConversion) { Mapping<? super N1, ? extends NP2> npMapping = Mappings.compose(in::getNodeProperty, npConversion); Mapping<? super E1, ? extends EP2> epMapping = Mappings.compose(in::getEdgeProperty, epConversion); return copyPlain(in, out, npMapping, epMapping); }
public static <D> D idGet(Mapping<D, D> mapping, D key) { return safeGet(mapping, key, key); }
public static <N1, E1, NP1, EP1, N2, E2, NP2, EP2> Mapping<N1, N2> copyUniversalTraversal(UniversalIndefiniteGraph<N1, E1, NP1, EP1> in, MutableGraph<N2, E2, NP2, EP2> out, TraversalOrder order, int limit, Collection<? extends N1> initialNodes, Mapping<? super NP1, ? extends NP2> npConversion, Mapping<? super EP1, ? extends EP2> epConversion) { Mapping<? super N1, ? extends NP2> npMapping = Mappings.compose(in::getNodeProperty, npConversion); Mapping<? super E1, ? extends EP2> epMapping = Mappings.compose(in::getEdgeProperty, epConversion); return copyTraversal(in, out, order, limit, initialNodes, npMapping, epMapping); }