Class EdgesConnecting<E>

  • Type Parameters:
    E - Edge parameter type
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    final class EdgesConnecting<E>
    extends java.util.AbstractSet<E>
    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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<?,​E> nodeToOutEdge  
      private java.lang.Object targetNode  
    • Constructor Summary

      Constructors 
      Constructor Description
      EdgesConnecting​(java.util.Map<?,​E> nodeToEdgeMap, java.lang.Object targetNode)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.Object edge)  
      private E getConnectingEdge()  
      UnmodifiableIterator<E> iterator()  
      int size()  
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        add, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
    • Field Detail

      • nodeToOutEdge

        private final java.util.Map<?,​E> nodeToOutEdge
      • targetNode

        private final java.lang.Object targetNode
    • Constructor Detail

      • EdgesConnecting

        EdgesConnecting​(java.util.Map<?,​E> nodeToEdgeMap,
                        java.lang.Object targetNode)
    • Method Detail

      • iterator

        public UnmodifiableIterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.Set<E>
        Specified by:
        iterator in class java.util.AbstractCollection<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.Set<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • contains

        public boolean contains​(@Nullable
                                java.lang.Object edge)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.Set<E>
        Overrides:
        contains in class java.util.AbstractCollection<E>
      • getConnectingEdge

        @Nullable
        private E getConnectingEdge()