Interface Edge
- All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, OsidRelationship, Temporal
An Edge represents relationship between two nodes.
-
Method Summary
Modifier and TypeMethodDescriptiongetCost()Gets the cost of this edge.Gets the destination node of this edge.Gets theIdof the destination node of this edge.Gets the distance of this edge.getEdgeRecord(Type edgeRecordType) Gets the edge record corresponding to the givenEdgerecordType.This method is used to retrieve an object implementing the requested record.Gets theIdof the source node of this edge.Gets the source node of this edge.booleanTests if this directional edge is bi-directional.booleanTests if this is a directional edge.Methods inherited from interface Browsable
getProperties, getPropertiesByRecordTypeModifier and TypeMethodDescriptionGets a list of properties.getPropertiesByRecordType(Type recordType) Gets a list of properties corresponding to the specified record type.Methods inherited from interface Extensible
getRecordTypes, hasRecordTypeModifier and TypeMethodDescriptionGets the record types available in this object.booleanhasRecordType(Type recordType) Tests if this object supports the given recordType.Methods inherited from interface Identifiable
getId, isCurrentMethods inherited from interface OsidObject
getDescription, getDisplayName, getGenusType, isOfGenusTypeModifier and TypeMethodDescriptionGets the description associated with this instance of this OSID object.Gets the preferred display name associated with this instance of this OSID object appropriate for display to the user.Gets the genus type of this object.booleanisOfGenusType(Type genusType) Tests if this object is of the given genusType.Methods inherited from interface OsidRelationship
getEndReason, getEndReasonId, hasEndReasonModifier and TypeMethodDescriptionGets a state indicating why this relationship has ended.Gets a stateIdindicating why this relationship has ended.booleanTests if a reason this relationship came to an end is known.Methods inherited from interface Temporal
getEndDate, getStartDate, isEffectiveModifier and TypeMethodDescriptionGets the end date.Gets the start date.booleanTests if the current date is within the start end end dates inclusive.
-
Method Details
-
isDirectional
boolean isDirectional()Tests if this is a directional edge.- Returns:
trueif this edge is directional,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
isBiDirectional
boolean isBiDirectional()Tests if this directional edge is bi-directional.- Returns:
trueif this edge is directional and bi-directional,falseotherwise- Throws:
IllegalStateException-isDirectional()isfalse- Compliance:
mandatory- This method must be implemented.
-
getCost
BigDecimal getCost()Gets the cost of this edge.- Returns:
- a number representing the cost of this edge
- Compliance:
mandatory- This method must be implemented.
-
getDistance
BigDecimal getDistance()Gets the distance of this edge.- Returns:
- a number representing the distance of this edge
- Compliance:
mandatory- This method must be implemented.
-
getSourceNodeId
Id getSourceNodeId()Gets the source node of this edge. If the edge is uni-directional, the source node is the node at the beginning of the edge, otherwise it may be relative to the means of traversal of the graph.- Returns:
- the source node
Id - Compliance:
mandatory- This method must be implemented.
-
getSourceNode
Gets theIdof the source node of this edge. If the edge is uni-directional, the source node is the node at the beginning of the edge, otherwise it may be relative to the means of traversal of the graph.- Returns:
- the source node
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getDestinationNodeId
Id getDestinationNodeId()Gets theIdof the destination node of this edge. If the edge is uni-directional, the destination node is the node at the end of the edge, otherwise it may be relative to the means of traversal of the graph.- Returns:
- the detsination node
Id - Compliance:
mandatory- This method must be implemented.
-
getDestinationNode
Gets the destination node of this edge. If the edge is uni-directional, the destination node is the node at the end of the edge, otherwise it may be relative to the means of traversal of the graph.- Returns:
- the detsination node
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getEdgeRecord
Gets the edge record corresponding to the givenEdgerecordType.This method is used to retrieve an object implementing the requested record. TheedgeRecordTypemay be theTypereturned ingetRecordTypes()or any of its parents in aTypehierarchy wherehasRecordType(edgeRecordType)istrue.- Parameters:
edgeRecordType- the type of edge record to retrieve- Returns:
- the edge record
- Throws:
NullArgumentException-edgeRecordTypeisnullOperationFailedException- unable to complete requestUnsupportedException-hasRecordType(edgeRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-