com.joanju.cg.api
Class CallSite

java.lang.Object
  extended by com.joanju.cg.api.EndpointAPI
      extended by com.joanju.cg.api.CallSite
All Implemented Interfaces:
java.lang.Comparable

public class CallSite
extends EndpointAPI
implements java.lang.Comparable

A call site is the location of a RUN statement, a reference to a user function, etc.

This class implements compareTo, equals, and hashCode for easy storage and sorting. If stored in a TreeSet, the objects would be sorted by the internal instruction address.


Field Summary
 
Fields inherited from class com.joanju.cg.api.EndpointAPI
cuFileName, longSigId, sourceColumn, sourceFileID, sourceFileName, sourceLine
 
Constructor Summary
CallSite(AbstractCall call)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare by addresses.
 boolean equals(java.lang.Object obj)
          Test if addresses are equal.
 java.util.ArrayList<Procedure> findMismatches()
          Find targets of this call where the signatures mismatch.
 java.lang.String getAddressEncoding()
          Get a unique String encoding of this record's address.
 AbstractCall getBytecode()
          This fetches the (low-level) Bytecode instruction record for the call.
 java.util.ArrayList<Procedure> getProcedureList()
          Get the list of potential target procedures for this call site.
 int hashCode()
          Return the hash code of the address.
 boolean isFullyResolved()
          Was Callgraph able to fully resolve this call?
 
Methods inherited from class com.joanju.cg.api.EndpointAPI
getCuFileID, getCuFileName, getNodeNum, getSignature, getSourceColumn, getSourceFileID, getSourceFileName, getSourceLine
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallSite

public CallSite(AbstractCall call)
         throws java.sql.SQLException,
                java.io.IOException
Throws:
java.sql.SQLException
java.io.IOException
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Compare by addresses.

Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object obj)
Test if addresses are equal.

Overrides:
equals in class java.lang.Object

findMismatches

public java.util.ArrayList<Procedure> findMismatches()
                                              throws java.sql.SQLException,
                                                     java.io.IOException
Find targets of this call where the signatures mismatch.

Throws:
java.sql.SQLException
java.io.IOException

getAddressEncoding

public java.lang.String getAddressEncoding()
Get a unique String encoding of this record's address.


getBytecode

public AbstractCall getBytecode()
This fetches the (low-level) Bytecode instruction record for the call. The AbstractCall object should not be considered part of the public API.


getProcedureList

public java.util.ArrayList<Procedure> getProcedureList()
                                                throws java.sql.SQLException,
                                                       java.io.IOException
Get the list of potential target procedures for this call site. The list is not sorted in any particular order.

Throws:
java.io.IOException
java.sql.SQLException
See Also:
Procedure, isFullyResolved()

hashCode

public int hashCode()
Return the hash code of the address.

Overrides:
hashCode in class java.lang.Object

isFullyResolved

public boolean isFullyResolved()
                        throws java.sql.SQLException,
                               java.io.IOException
Was Callgraph able to fully resolve this call?

It is often important to know whether Callgraph was able to fully resolve a call. An example of partly unresolved is when one of the values for RUN VALUE comes from an expression that Callgraph does not evaluate.

Usage note: The value for isFullyResolved is calculated in the getProcedureList function, and stored. If you are going to call both functions, call getProcedureList first, for efficiency sake.

Throws:
java.sql.SQLException
java.io.IOException
See Also:
getProcedureList()


Copyright © 2008 Joanju Software. All Rights Reserved.