Class PredicatedParallelEdgeIndexFunction<V,​E>

  • All Implemented Interfaces:
    edu.uci.ics.jung.graph.util.EdgeIndexFunction<V,​E>

    public class PredicatedParallelEdgeIndexFunction<V,​E>
    extends java.lang.Object
    implements edu.uci.ics.jung.graph.util.EdgeIndexFunction<V,​E>
    A class which creates and maintains indices for parallel edges. Edges are evaluated by a Predicate function and those that evaluate to true are excluded from computing a parallel offset
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<E,​java.lang.Integer> edge_index  
      protected org.apache.commons.collections4.Predicate<E> predicate  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getIndex​(edu.uci.ics.jung.graph.Graph<V,​E> graph, E e)
      Returns the index for the specified edge.
      protected int getIndex​(edu.uci.ics.jung.graph.Graph<V,​E> graph, E e, V v)  
      protected int getIndex​(edu.uci.ics.jung.graph.Graph<V,​E> graph, E e, V v, V u)  
      static <V,​E>
      PredicatedParallelEdgeIndexFunction<V,​E>
      getInstance()  
      org.apache.commons.collections4.Predicate<E> getPredicate()  
      void reset()
      Clears all edge indices for all edges in all graphs.
      void reset​(edu.uci.ics.jung.graph.Graph<V,​E> graph, E e)
      Resets the indices for this edge and its parallel edges.
      void setPredicate​(org.apache.commons.collections4.Predicate<E> predicate)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • edge_index

        protected java.util.Map<E,​java.lang.Integer> edge_index
      • predicate

        protected org.apache.commons.collections4.Predicate<E> predicate
    • Method Detail

      • getIndex

        public int getIndex​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                            E e)
        Returns the index for the specified edge. Calculates the indices for e and for all edges parallel to e.
        Specified by:
        getIndex in interface edu.uci.ics.jung.graph.util.EdgeIndexFunction<V,​E>
      • getIndex

        protected int getIndex​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                               E e,
                               V v,
                               V u)
      • getIndex

        protected int getIndex​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                               E e,
                               V v)
      • getPredicate

        public org.apache.commons.collections4.Predicate<E> getPredicate()
        Returns:
        the predicate
      • setPredicate

        public void setPredicate​(org.apache.commons.collections4.Predicate<E> predicate)
        Parameters:
        predicate - the predicate to set
      • reset

        public void reset​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                          E e)
        Resets the indices for this edge and its parallel edges. Should be invoked when an edge parallel to e has been added or removed.
        Specified by:
        reset in interface edu.uci.ics.jung.graph.util.EdgeIndexFunction<V,​E>
        Parameters:
        e -
      • reset

        public void reset()
        Clears all edge indices for all edges in all graphs. Does not recalculate the indices.
        Specified by:
        reset in interface edu.uci.ics.jung.graph.util.EdgeIndexFunction<V,​E>