Top Description Fields Constructors Methods
com.google.common.graph

pack-priv final Class EdgesConnecting<E>

extends AbstractSet<E>
Class Inheritance
Annotations
@ElementTypesAreNonnullByDefault
Type Parameters
<E>
Edge parameter type
Static Imports
com.google.common.base.Preconditions.checkNotNull

A class to represent the set of edges connecting an (implicit) origin node to a target node.

The nodeToOutEdge map means this class only works on networks without parallel edges. See MultiEdgesConnecting for a class that works with parallel edges.

Author
James Sexton

Field Summary

Modifier and TypeField and Description
private final Map<?, E>
private final Object

Constructor Summary

AccessConstructor and Description
pack-priv
EdgesConnecting(Map<?, E> nodeToEdgeMap, Object targetNode)

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(Object
element whose presence in this set is to be tested
edge
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.
private E
public UnmodifiableIterator<E>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).
Inherited from java.util.AbstractSet:
equalshashCoderemoveAll

Field Detail

nodeToOutEdgeback to summary
private final Map<?, E> nodeToOutEdge
targetNodeback to summary
private final Object targetNode

Constructor Detail

EdgesConnectingback to summary
pack-priv EdgesConnecting(Map<?, E> nodeToEdgeMap, Object targetNode)

Method Detail

containsback to summary
public boolean contains(Object edge)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
edge:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override
getConnectingEdgeback to summary
private E getConnectingEdge()
Annotations
@CheckForNull
iteratorback to summary
public UnmodifiableIterator<E> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:UnmodifiableIterator<E>

an iterator over the elements in this set

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override