Package edu.cmu.tetrad.graph
Class Edge
java.lang.Object
edu.cmu.tetrad.graph.Edge
- All Implemented Interfaces:
- TetradSerializable,- Serializable,- Comparable<Edge>
Represents an edge node1 *-# node2 where * and # are endpoints of type Endpoint--that is, Endpoint.TAIL,
 Endpoint.ARROW, or Endpoint.CIRCLE.
 
Note that because speed is of the essence, and Edge cannot be compared to an object of any other type; this will throw an exception.
- Author:
- josephramsey
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidaddProperty(Edge.Property property) intfinal booleanTwo edges are equal just in case they connect the same nodes and have the same endpoints proximal to each node.final EndpointgetDistalEndpoint(Node node) final NodegetDistalNode(Node node) Traverses the edge in an undirected fashion--given one node along the edge, returns the node at the opposite end of the edge.final Endpointfinal Endpointfinal NodegetNode1()final NodegetNode2()doublefinal EndpointgetProximalEndpoint(Node node) final inthashCode()booleanbooleanbooleanisNull()booleanpointsTowards(Node node) reverse()static EdgeGenerates a simple exemplar of this class to test serialization.final voidfinal voidvoidsetHighlighted(boolean highlighted) voidsetProbability(double probability) final StringtoString()Produces a string representation of the edge.
- 
Constructor Details- 
EdgeConstructs a new edge by specifying the nodes it connects and the endpoint types.- Parameters:
- node1- the first node
- node2- the second node _
- endpoint1- the endpoint at the first node
- endpoint2- the endpoint at the second node
 
- 
Edge
 
- 
- 
Method Details- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.
- 
getNode1- Returns:
- the A node.
 
- 
getNode2- Returns:
- the B node.
 
- 
getEndpoint1- Returns:
- the endpoint of the edge at the A node.
 
- 
setEndpoint1
- 
getEndpoint2- Returns:
- the endpoint of the edge at the B node.
 
- 
setEndpoint2
- 
getProximalEndpoint- Returns:
- the endpoint nearest to the given node.
- Throws:
- IllegalArgumentException- if the given node is not along the edge.
 
- 
getDistalEndpoint- Returns:
- the endpoint furthest from the given node.
- Throws:
- IllegalArgumentException- if the given node is not along the edge.
 
- 
getDistalNodeTraverses the edge in an undirected fashion--given one node along the edge, returns the node at the opposite end of the edge.
- 
isDirectedpublic boolean isDirected()- Returns:
- true just in case this edge is directed.
 
- 
pointsTowards- Returns:
- true just in case the edge is pointing toward the given node-- that is, x --> node or x o--> node.
 
- 
reverse- Returns:
- the edge with endpoints reversed.
 
- 
toStringProduces a string representation of the edge.
- 
hashCodepublic final int hashCode()
- 
equalsTwo edges are equal just in case they connect the same nodes and have the same endpoints proximal to each node.
- 
compareTo- Specified by:
- compareToin interface- Comparable<Edge>
 
- 
isNullpublic boolean isNull()
- 
getLineColor
- 
addProperty
- 
getProperties
- 
addEdgeTypeProbability
- 
getEdgeTypeProbabilities
- 
getProbabilitypublic double getProbability()
- 
setProbabilitypublic void setProbability(double probability) 
- 
isHighlightedpublic boolean isHighlighted()
- 
setHighlightedpublic void setHighlighted(boolean highlighted) 
 
-