@Override public E getShortestPathEdge(N target) { Record<N, E> rec = records.get(target); if (rec == null) { return null; } return rec.reach; }
@Override public boolean startExploration(N node, TarjanSCCRecord data) { records.put(node, data); return true; }
public static <D, R> Mapping<D, R> fromMap(Map<D, R> map) { return new MapMapping<>(map); } }
public static <D> D idGet(Mapping<D, D> mapping, D key) { return safeGet(mapping, key, key); }
@Override public E getShortestPathEdge(N target) { Record<N, E> rec = records.get(target); if (rec == null) { return null; } return rec.reach; }
@Override public boolean startExploration(N node, TarjanSCCRecord data) { records.put(node, data); return true; }
/** * Get the range object <code>elem</code> maps to. * * @param elem * object from the domain. * * @return the object from the range corresponding to <code>elem</code>. */ @Override default R apply(D elem) { return get(elem); }
public static <D, R> MapMapping<D, R> create(Map<D, R> map) { return new MapMapping<>(map); }
public static <D, R> R nullGet(Mapping<? super D, ? extends R> mapping, D key) { return safeGet(mapping, key, null); }
@Override public float getShortestPathDistance(N target) { Record<N, E> rec = records.get(target); if (rec == null) { return Graphs.INVALID_DISTANCE; } return rec.dist; }
@Override public float getShortestPathDistance(N target) { Record<N, E> rec = records.get(target); if (rec == null) { return Graphs.INVALID_DISTANCE; } return rec.dist; }
public boolean hasVisited(N node) { return (records.get(node) != null); }
public boolean hasVisited(N node) { return (records.get(node) != null); }