Class ConstantDirectionalEdgeValueTransformer<V,​E>

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

    public class ConstantDirectionalEdgeValueTransformer<V,​E>
    extends java.lang.Object
    implements com.google.common.base.Function<Context<Graph<V,​E>,​E>,​java.lang.Number>
    Returns the constructor-specified value for each edge type.
    Author:
    Joshua O'Madadhain
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Number apply​(Context<Graph<V,​E>,​E> context)  
      void setDirectedValue​(double value)
      Sets the value returned for directed edges to value.
      void setUndirectedValue​(double value)
      Sets the value returned for undirected edges to value.
      • 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

      • undirected_value

        protected java.lang.Double undirected_value
      • directed_value

        protected java.lang.Double directed_value
    • Constructor Detail

      • ConstantDirectionalEdgeValueTransformer

        public ConstantDirectionalEdgeValueTransformer​(double undirected,
                                                       double directed)
        Parameters:
        undirected - the value to return if the edge is undirected
        directed - the value to return if the edge is directed
    • Method Detail

      • apply

        public java.lang.Number apply​(Context<Graph<V,​E>,​E> context)
        Specified by:
        apply in interface com.google.common.base.Function<V,​E>
        Specified by:
        apply in interface java.util.function.Function<V,​E>
      • setUndirectedValue

        public void setUndirectedValue​(double value)
        Sets the value returned for undirected edges to value.
        Parameters:
        value - the new value to return for undirected edges
      • setDirectedValue

        public void setDirectedValue​(double value)
        Sets the value returned for directed edges to value.
        Parameters:
        value - the new value to return for directed edges