Apparatus and method for a runtime method overloading resolver
First Claim
Patent Images
1. An apparatus for resolving method overloading at runtime, comprising:
- a. a number of computer readable media; and
b. computer readable program code stored on said number of computer readable media, said computer readable program code for resolving a target method, wherein said target method comprises at least one parameter, said program code comprising;
i. program code for accessing an application programming interface file comprising a number of methods overloaded with said target method; and
ii. program code for selecting one of said number of methods, said code for selecting comprising;
(1) program code for selecting an exact method, wherein a data type of each of said at least one parameter of said exact method is the same data type of a corresponding said at least one parameter of said target method;
(2) program code for determining that if there is no exact method, then a best method is to be selected; and
(3) program code for selecting said best method, said code for selecting said best method comprising;
a. program code for selecting a number of candidate methods from said number of methods, and wherein a data type of each of said at least one parameter of said target method can be assigned to a data type of a corresponding said at least one parameter of each of said number of candidate methods;
b. program code for scoring each of said number of candidate methods wherein said program code for scoring each of said number of candidate methods comprises program code for determining if a first candidate method can be assigned to a second candidate method, said code for determining comprising;
I. program code for determining if a data type of a given one of said at least one parameter of said first candidate method can be assigned to a data type of a corresponding said at least one parameter of said second candidate method parameter; and
II. program code for assigning a point if a data type of each of said at least one parameter of said first candidate method can be assigned to a data type of a corresponding said at least one parameter of said second candidate method; and
c. said code for selecting said best method further comprising program code for selecting one of said number of candidate methods having the best score, wherein said one of said number of candidate methods having the best score comprises said best method.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus for resolving method overloading at runtime that includes accessing an application programming interface file to retrieve methods that belong to the same class as a target method to select an exact method, which is a method where a data type of each of the parameters of the exact method is the same data type of a corresponding parameter of the target method, and if there is no exact method, to find a best method, which is a best method that most closely matches the target method.
90 Citations
20 Claims
-
1. An apparatus for resolving method overloading at runtime, comprising:
-
a. a number of computer readable media; and
b. computer readable program code stored on said number of computer readable media, said computer readable program code for resolving a target method, wherein said target method comprises at least one parameter, said program code comprising;
i. program code for accessing an application programming interface file comprising a number of methods overloaded with said target method; and
ii. program code for selecting one of said number of methods, said code for selecting comprising;
(1) program code for selecting an exact method, wherein a data type of each of said at least one parameter of said exact method is the same data type of a corresponding said at least one parameter of said target method;
(2) program code for determining that if there is no exact method, then a best method is to be selected; and
(3) program code for selecting said best method, said code for selecting said best method comprising;
a. program code for selecting a number of candidate methods from said number of methods, and wherein a data type of each of said at least one parameter of said target method can be assigned to a data type of a corresponding said at least one parameter of each of said number of candidate methods;
b. program code for scoring each of said number of candidate methods wherein said program code for scoring each of said number of candidate methods comprises program code for determining if a first candidate method can be assigned to a second candidate method, said code for determining comprising;
I. program code for determining if a data type of a given one of said at least one parameter of said first candidate method can be assigned to a data type of a corresponding said at least one parameter of said second candidate method parameter; and
II. program code for assigning a point if a data type of each of said at least one parameter of said first candidate method can be assigned to a data type of a corresponding said at least one parameter of said second candidate method; and
c. said code for selecting said best method further comprising program code for selecting one of said number of candidate methods having the best score, wherein said one of said number of candidate methods having the best score comprises said best method. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
a. program code for accessing a conversion/widening matrix to determine a first index for a given one of said at least one parameter of said given candidate method, and a second index for a corresponding said at least one parameter of said target method, wherein said index corresponds to a given data type'"'"'s conversion hierarchy level; and
b. program code for calculating the difference between said first index and said second index.
-
-
7. An apparatus as in claim 6, wherein said best score is one of said number of candidate methods having the least number of points.
-
8. An apparatus as in claim 5, wherein program code for determining a proximity factor for a given one of said at least one parameter of said given candidate method comprises program code for determining the number of ancestors from a class of a corresponding one of said at least one parameter of said target method to a class of said given one of said at least one parameter of said given candidate method.
-
9. An apparatus as in claim 1, additionally comprising program code for implementing a network protocol for using said runtime method overloading resolver in a distributed environment, said program code comprising:
-
a. program code for serializing said variable number of application-usable objects into a variable number of serialized objects, wherein each of said variable number of application-usable objects corresponds to a different one of said variable number of serialized objects, and each of said variable number of serialized objects comprises at least one byte;
b. program code for creating a two-dimensional array of bytes, said program code comprising;
i. program code for creating a first dimension array comprising a number of elements, wherein each of said number of elements of said first dimension array represents a given one of said variable number of serialized objects by referencing a second dimension array comprising a number of elements; and
ii. program code for creating said second dimension array, wherein said number of elements of said second dimension array referenced by said given element of said first dimension array comprise said at least one byte of said given one of said variable number of serialized objects, whereby each of said number of elements of said second dimension array comprises one of at least one byte of said given one of said variable number of serialized objects; and
c. program code for storing said given one of said variable number of serialized objects in said two-dimensional array of bytes.
-
-
10. An apparatus as in claim 9, additionally comprising:
-
a. program code for transmitting said two-dimensional array of bytes over a network;
b. program code for re-creating a variable number of application-usable objects from said two-dimensional array of bytes, comprising;
i. program code for accessing said two-dimensional array of bytes to extract each of said variable number of serialized objects; and
ii. program code for deserializing each of said variable number of serialized objects into said variable number of application-usable objects.
-
-
11. An apparatus as in claim 9, wherein said program code for creating a first dimension array comprising a number of elements comprises program code for creating a first dimension array comprising a number of elements wherein a number associated with a given one of said number of elements of said first dimension array corresponds to a relative position of a variable number of application-usable objects, wherein said application-usable objects are positioned in a particular order.
-
12. A method for resolving method overloading at runtime, comprising:
-
a. accessing an application programming interface file comprising a number of methods overloaded with a target method; and
b. selecting one of said number of methods, comprising;
i. selecting an exact method, wherein a data type of each of said at least one parameter of said exact method is the same data type of a corresponding said at least one parameter of said target method; and
ii. if there is no exact method, selecting a best method by;
(1) selecting a number of candidate methods from said number of methods, and wherein a data type of each of said at least one parameter of said target method can be assigned to a data type of a corresponding said at least one parameter of each of said number of candidate methods;
(2) scoring each of said number of candidate methods wherein said scoring each of said number of candidate methods comprises determining if a first candidate method can be assigned to a second candidate method, said determining comprising;
I. determining if a data type of a given one of said at least one parameter of said first candidate method can be assigned to a data type of a corresponding said at least one parameter of said second candidate method parameter; and
II. assigning a point if a data type of each of said at least one parameter of said first candidate method can be assigned to a data type of a corresponding said at least one parameter of said second candidate method; and
(3) said selecting a best method further comprising selecting one of said number of candidate methods having the best score as said best method. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20)
a. accessing a conversion/widening matrix to determine a first index for a given one of said at least one parameter of said given candidate method, and a second index for a corresponding said at least one parameter of said target method, wherein said index corresponds to a given data type'"'"'s conversion hierarchy level; and
b. calculating the difference between said first index and said second index.
-
-
17. A method as in claim 15, wherein determining a proximity factor for a given one of said at least one parameter of said given candidate method comprises determining the number of ancestors from a class of a corresponding one of said at least one parameter of said target method to a class of said given one of said at least one parameter of said given candidate method.
-
18. A method as in claim 12, additionally comprising implementing a network protocol for using said runtime method overloading resolver in a distributed environment, comprising:
-
a. creating a two-dimensional array of bytes, comprising;
i. serializing said variable number of application-usable objects into a variable number of serialized objects, wherein each of said variable number of application-usable objects corresponds to a different one of said variable number of serialized objects, and each of said variable number of serialized objects comprises at least one byte;
ii. creating a first dimension array comprising a number of elements, wherein each of said number of elements of said first dimension array represents a given one of said variable number of serialized objects by referencing a second dimension array comprising a number of elements; and
iii. creating said second dimension array, wherein said number of elements of said second dimension array referenced by said given element of said first dimension array comprise said at least one byte of said given one of said variable number of serialized objects, whereby each of said number of elements of said second dimension array comprises one of at least one byte of said given one of said variable number of serialized objects; and
b. storing said given one of said variable number of serialized objects in said two-dimensional array of bytes.
-
-
19. A method as in claim 18, additionally comprising:
-
a. transmitting said two-dimensional array of bytes over a network;
b. re-creating a variable number of application-usable objects from said two-dimensional array of bytes, comprising;
i. accessing said two-dimensional array of bytes to extract each of said variable number of serialized objects; and
ii. deserializing each of said variable number of serialized objects into said variable number of application-usable objects.
-
-
20. A method as in claim 18, wherein said creating a first dimension array comprises creating a first dimension array comprising a number of elements wherein a number associated with a given one of said number of elements of said first dimension array corresponds to a relative position of a variable number of application-usable objects, wherein said application-usable objects are positioned in a particular order.
Specification