Class EdgePredicateFilter<V,​E>

  • All Implemented Interfaces:
    com.google.common.base.Function<Graph<V,​E>,​Graph<V,​E>>, Filter<V,​E>, java.util.function.Function<Graph<V,​E>,​Graph<V,​E>>

    public class EdgePredicateFilter<V,​E>
    extends java.lang.Object
    implements Filter<V,​E>
    Transforms the input graph into one which contains only those edges that pass the specified Predicate. The filtered graph is a copy of the original graph (same type, uses the same vertex and edge objects). All vertices from the original graph are copied into the new graph (even if they are not incident to any edges in the new graph).
    Author:
    Joshua O'Madadhain
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.google.common.base.Predicate<E> edge_pred  
    • Constructor Summary

      Constructors 
      Constructor Description
      EdgePredicateFilter​(com.google.common.base.Predicate<E> edge_pred)
      Creates an instance based on the specified edge Predicate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Graph<V,​E> apply​(Graph<V,​E> g)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.google.common.base.Function

        equals
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Field Detail

      • edge_pred

        protected com.google.common.base.Predicate<E> edge_pred
    • Constructor Detail

      • EdgePredicateFilter

        public EdgePredicateFilter​(com.google.common.base.Predicate<E> edge_pred)
        Creates an instance based on the specified edge Predicate.
        Parameters:
        edge_pred - the predicate that specifies which edges to add to the filtered graph
    • Method Detail

      • apply

        public Graph<V,​E> apply​(Graph<V,​E> g)
        Specified by:
        apply in interface com.google.common.base.Function<V,​E>
        Specified by:
        apply in interface java.util.function.Function<V,​E>