V
- The type of node labels.E
- The type of edge labels.public class DAGEdge<V,E> extends Object implements Serializable
DAGNodeBuilder
.
Two edges are equal if they connect the same pair of nodes and have the same label.
DAGNode
,
Serialized FormModifier and Type | Method and Description |
---|---|
static <V,E> DAGEdge<V,E> |
create(DAGNode<V,E> head,
DAGNode<V,E> tail,
E label) |
boolean |
equals(Object o) |
static <V,E> com.google.common.base.Function<DAGEdge<V,E>,DAGNode<V,E>> |
extractHead() |
static <V,E> com.google.common.base.Function<DAGEdge<V,E>,DAGNode<V,E>> |
extractTail() |
DAGNode<V,E> |
getHead()
Get the edge's head (starting node).
|
E |
getLabel()
Get the edge's label.
|
DAGNode<V,E> |
getTail()
Get the edge's tail (ending node).
|
int |
hashCode() |
static <V,E> com.google.common.base.Predicate<DAGEdge<V,E>> |
headMatches(com.google.common.base.Predicate<? super DAGNode<V,E>> pred) |
static <E> com.google.common.base.Predicate<DAGEdge<?,E>> |
labelMatches(com.google.common.base.Predicate<? super E> pred) |
static <V,E> com.google.common.base.Predicate<DAGEdge<V,E>> |
tailMatches(com.google.common.base.Predicate<? super DAGNode<V,E>> pred) |
String |
toString() |
static <V,E> com.google.common.base.Function<DAGEdge<V,E>,DAGEdge<V,E>> |
transformNodes(com.google.common.base.Function<? super DAGNode<V,E>,? extends DAGNode<V,E>> func)
Transform an edge.
|
@Nonnull public DAGNode<V,E> getHead()
@Nonnull public DAGNode<V,E> getTail()
public static <E> com.google.common.base.Predicate<DAGEdge<?,E>> labelMatches(com.google.common.base.Predicate<? super E> pred)
public static <V,E> com.google.common.base.Predicate<DAGEdge<V,E>> tailMatches(com.google.common.base.Predicate<? super DAGNode<V,E>> pred)
public static <V,E> com.google.common.base.Function<DAGEdge<V,E>,DAGNode<V,E>> extractTail()
public static <V,E> com.google.common.base.Predicate<DAGEdge<V,E>> headMatches(com.google.common.base.Predicate<? super DAGNode<V,E>> pred)
public static <V,E> com.google.common.base.Function<DAGEdge<V,E>,DAGNode<V,E>> extractHead()
public static <V,E> com.google.common.base.Function<DAGEdge<V,E>,DAGEdge<V,E>> transformNodes(com.google.common.base.Function<? super DAGNode<V,E>,? extends DAGNode<V,E>> func)
V
- The type of vertices.E
- The type of edges.func
- The node transformation function. If this function returns null, that is treated
as equivalent to the identity function.Copyright © 2016 GroupLens Research. All rights reserved.