use of com.google.security.zynamics.zylib.general.Quad in project binnavi by google.
the class CGlobalEdgeCommentSynchronizer method getEdgeData.
/**
* Returns the edge data of a given edge.
*
* @param edge An edge.
*
* @return <Source Module ID, Source Address, Target Module ID, Target Address>
*
* @throws MaybeNullException Thrown if the edge data could not be determined.
*/
private static Quad<Integer, IAddress, Integer, IAddress> getEdgeData(final INaviEdge edge) throws MaybeNullException {
IAddress srcAddr = null;
IAddress dstAddr = null;
int srcModuleId = -1;
int dstModuleId = -1;
if (edge.getSource() instanceof INaviCodeNode) {
srcAddr = ((INaviCodeNode) edge.getSource()).getAddress();
srcModuleId = ((INaviCodeNode) edge.getSource()).getParentFunction().getModule().getConfiguration().getId();
} else if (edge.getSource() instanceof INaviFunctionNode) {
srcAddr = ((INaviFunctionNode) edge.getSource()).getFunction().getAddress();
srcModuleId = ((INaviFunctionNode) edge.getSource()).getFunction().getModule().getConfiguration().getId();
}
if (edge.getTarget() instanceof INaviCodeNode) {
dstAddr = ((INaviCodeNode) edge.getTarget()).getAddress();
dstModuleId = ((INaviCodeNode) edge.getTarget()).getParentFunction().getModule().getConfiguration().getId();
} else if (edge.getTarget() instanceof INaviFunctionNode) {
dstAddr = ((INaviFunctionNode) edge.getTarget()).getFunction().getAddress();
dstModuleId = ((INaviFunctionNode) edge.getTarget()).getFunction().getModule().getConfiguration().getId();
}
return new Quad<Integer, IAddress, Integer, IAddress>(srcModuleId, srcAddr, dstModuleId, dstAddr);
}
Aggregations