Class Edge
- All Implemented Interfaces:
- TetradSerializable,- Serializable,- Comparable<Edge>
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.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddEdgeTypeProbability.voidaddProperty(Edge.Property property) addProperty.intcompareTo.final booleanfinal EndpointgetDistalEndpoint(Node node) getDistalEndpoint.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.Getter for the fieldedgeTypeProbabilities.final EndpointGetter for the fieldendpoint1.final EndpointGetter for the fieldendpoint2.Getter for the fieldlineColor.final NodegetNode1()Getter for the fieldnode1.final NodegetNode2()Getter for the fieldnode2.doubleGetter for the fieldprobability.Getter for the fieldproperties.final EndpointgetProximalEndpoint(Node node) getProximalEndpoint.final inthashCode()hashCode.booleanisDirected.booleanisHighlighted.booleanisNull()isNull.booleanpointsTowards(Node node) pointsTowards.reverse()reverse.static EdgeGenerates a simple exemplar of this class to test serialization.final voidSetter for the fieldendpoint1.final voidSetter for the fieldendpoint2.voidsetHighlighted(boolean highlighted) Setter for the fieldhighlighted.voidsetProbability(double probability) Setter for the fieldprobability.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
 
- 
EdgeConstructor for Edge. - Parameters:
- edge- a- Edgeobject
 
 
- 
- 
Method Details- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a Edgeobject
 
- 
getNode1Getter for the field node1.- Returns:
- the A node.
 
- 
getNode2Getter for the field node2.- Returns:
- the B node.
 
- 
getEndpoint1Getter for the field endpoint1.- Returns:
- the endpoint of the edge at the A node.
 
- 
setEndpoint1Setter for the field endpoint1.- Parameters:
- e- a- Endpointobject
 
- 
getEndpoint2Getter for the field endpoint2.- Returns:
- the endpoint of the edge at the B node.
 
- 
setEndpoint2Setter for the field endpoint2.- Parameters:
- e- a- Endpointobject
 
- 
getProximalEndpointgetProximalEndpoint. - Parameters:
- node- a- Nodeobject
- Returns:
- the endpoint nearest to the given node.
- Throws:
- IllegalArgumentException- if the given node is not along the edge.
 
- 
getDistalEndpointgetDistalEndpoint. - Parameters:
- node- a- Nodeobject
- 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()isDirected. - Returns:
- true just in case this edge is directed.
 
- 
pointsTowardspointsTowards. - Parameters:
- node- a- Nodeobject
- Returns:
- true just in case the edge is pointing toward the given node-- that is, x --> node or x o--> node.
 
- 
reversereverse. - Returns:
- the edge with endpoints reversed.
 
- 
toStringProduces a string representation of the edge.
- 
hashCodepublic final int hashCode()hashCode. 
- 
equalsTwo edges are equal just in case they connect the same nodes and have the same endpoints proximal to each node. 
- 
compareTocompareTo. - Specified by:
- compareToin interface- Comparable<Edge>
- Parameters:
- _edge- a- Edgeobject
- Returns:
- a int
 
- 
isNullpublic boolean isNull()isNull. - Returns:
- a boolean
 
- 
getLineColorGetter for the field lineColor.- Returns:
- a Colorobject
 
- 
addPropertyaddProperty. - Parameters:
- property- a- Edge.Propertyobject
 
- 
getPropertiesGetter for the field properties.- Returns:
- a ArrayListobject
 
- 
addEdgeTypeProbabilityaddEdgeTypeProbability. - Parameters:
- prob- a- EdgeTypeProbabilityobject
 
- 
getEdgeTypeProbabilitiesGetter for the field edgeTypeProbabilities.- Returns:
- a Listobject
 
- 
getProbabilitypublic double getProbability()Getter for the field probability.- Returns:
- a double
 
- 
setProbabilitypublic void setProbability(double probability) Setter for the field probability.- Parameters:
- probability- a double
 
- 
isHighlightedpublic boolean isHighlighted()isHighlighted. - Returns:
- a boolean
 
- 
setHighlightedpublic void setHighlighted(boolean highlighted) Setter for the field highlighted.- Parameters:
- highlighted- a boolean
 
 
-