Interface Edge

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, OsidRelationship, Temporal

public interface Edge extends OsidRelationship

An Edge represents relationship between two nodes.

  • Method Details

    • isDirectional

      boolean isDirectional()
      Tests if this is a directional edge.
      Returns:
      true if this edge is directional, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • isBiDirectional

      boolean isBiDirectional()
      Tests if this directional edge is bi-directional.
      Returns:
      true if this edge is directional and bi-directional, false otherwise
      Throws:
      IllegalStateException - isDirectional() is false
      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

      Node getSourceNode() throws OperationFailedException
      Gets the Id of 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 the Id of 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

      Node getDestinationNode() throws OperationFailedException
      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

      EdgeRecord getEdgeRecord(Type edgeRecordType) throws OperationFailedException
      Gets the edge record corresponding to the given Edge record Type .This method is used to retrieve an object implementing the requested record. The edgeRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(edgeRecordType) is true .
      Parameters:
      edgeRecordType - the type of edge record to retrieve
      Returns:
      the edge record
      Throws:
      NullArgumentException - edgeRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(edgeRecordType) is false
      Compliance:
      mandatory - This method must be implemented.