/** * Gets an {@link java.lang.Iterable} with all edges. This method is mutually exclusive with * {@link #sendMessageToAllNeighbors(Object)} and may be called only once. * * <p>If the {@link EdgeDirection} is OUT (default), then this iterator contains outgoing edges. * * <p>If the {@link EdgeDirection} is IN, then this iterator contains incoming edges. * * <p>If the {@link EdgeDirection} is ALL, then this iterator contains both outgoing and incoming edges. * * @return An iterator with all edges. */ @SuppressWarnings("unchecked") public Iterable<Edge<K, EV>> getEdges() { if (edgesUsed) { throw new IllegalStateException("Can use either 'getEdges()' or 'sendMessageToAllNeighbors()' exactly once."); } edgesUsed = true; this.edgeIterator.set((Iterator<Edge<K, EV>>) edges); return this.edgeIterator; }
/** * Gets an {@link java.lang.Iterable} with all edges. This method is mutually exclusive with * {@link #sendMessageToAllNeighbors(Object)} and may be called only once. * * <p>If the {@link EdgeDirection} is OUT (default), then this iterator contains outgoing edges. * * <p>If the {@link EdgeDirection} is IN, then this iterator contains incoming edges. * * <p>If the {@link EdgeDirection} is ALL, then this iterator contains both outgoing and incoming edges. * * @return An iterator with all edges. */ @SuppressWarnings("unchecked") public Iterable<Edge<K, EV>> getEdges() { if (edgesUsed) { throw new IllegalStateException("Can use either 'getEdges()' or 'sendMessageToAllNeighbors()' exactly once."); } edgesUsed = true; this.edgeIterator.set((Iterator<Edge<K, EV>>) edges); return this.edgeIterator; }
/** * Gets an {@link java.lang.Iterable} with all edges. This method is mutually exclusive with * {@link #sendMessageToAllNeighbors(Object)} and may be called only once. * * <p>If the {@link EdgeDirection} is OUT (default), then this iterator contains outgoing edges. * * <p>If the {@link EdgeDirection} is IN, then this iterator contains incoming edges. * * <p>If the {@link EdgeDirection} is ALL, then this iterator contains both outgoing and incoming edges. * * @return An iterator with all edges. */ @SuppressWarnings("unchecked") public Iterable<Edge<K, EV>> getEdges() { if (edgesUsed) { throw new IllegalStateException("Can use either 'getEdges()' or 'sendMessageToAllNeighbors()' exactly once."); } edgesUsed = true; this.edgeIterator.set((Iterator<Edge<K, EV>>) edges); return this.edgeIterator; }
/** * Gets an {@link java.lang.Iterable} with all edges. This method is mutually exclusive with * {@link #sendMessageToAllNeighbors(Object)} and may be called only once. * <p> * If the {@link EdgeDirection} is OUT (default), then this iterator contains outgoing edges. * If the {@link EdgeDirection} is IN, then this iterator contains incoming edges. * If the {@link EdgeDirection} is ALL, then this iterator contains both outgoing and incoming edges. * * @return An iterator with all edges. */ @SuppressWarnings("unchecked") public Iterable<Edge<K, EV>> getEdges() { if (edgesUsed) { throw new IllegalStateException("Can use either 'getEdges()' or 'sendMessageToAllNeighbors()' exactly once."); } edgesUsed = true; this.edgeIterator.set((Iterator<Edge<K, EV>>) edges); return this.edgeIterator; }
void init(IterationRuntimeContext context) { this.runtimeContext = context; this.outValue = new Tuple2<>(); this.edgeIterator = new EdgesIterator<>(); }
void init(IterationRuntimeContext context) { this.runtimeContext = context; this.outValue = new Tuple2<>(); this.edgeIterator = new EdgesIterator<>(); }
void init(IterationRuntimeContext context) { this.runtimeContext = context; this.outValue = new Tuple2<>(); this.edgeIterator = new EdgesIterator<>(); }
void init(IterationRuntimeContext context) { this.runtimeContext = context; this.outValue = new Tuple2<>(); this.edgeIterator = new EdgesIterator<>(); }