Write an aspect that counts different kinds of method calls, JAVA Programming

 Problem statement Part 1 Write an aspect that counts different kinds of method calls in a Java program. Your aspect should meet the following requirements: 

The aspect should maintain the following counts: (1) calls to public methods, (2) calls to private methods, (3) calls to protected methods, (4) calls to package-private methods (i.e., those that are not public, private, or protected), (5) calls to static methods, calls to (6) non-static methods, (7) calls to all methods. Note that these sets of methods are not mutually exclusive; a method can, for example, be public and non-static.  

Count every method call, excluding the main( ) method that began the program. Be sure to count method calls made within the executions of other methods. (So, if we call a public method x( ) that calls a public method y( ) that calls a public method z( ), that should add 3 to the count of calls to public methods and 3 to the count of calls to all methods.) 

Do not include constructors in the counts. 

Include calls to methods in the Java library, but don't include the method calls that the library methods make to other library methods.  

If the advice in your aspect calls any methods, do not include these method calls in the count.  

As the program is ending, print a message to System.out that indicates the value of each of your counts, in a simple tabular form. The message should appear after any other output generated by the program.

Your aspect should not be specific to a particular program; it should be possible to weave it into any existing Java program. You may not assume that the program will have only one main() method (i.e., only one method with the signature public static void main(String[] args)), nor that main() methods will not call each other, but the output showing the method calls counts should only appear when the last main() method is returning. 

You may assume that the aspect will be compiled together with all of the source code of the program it modifies. However, the other parts of the program must not be dependent upon the contents of the aspect. It should be possible to compile a program with or without the aspect; other than the method counting feature, the program's behavior should not change as a result of include the aspect or leaving it out.

 

Posted Date: 2/26/2013 1:44:28 AM | Location : United States







Related Discussions:- Write an aspect that counts different kinds of method calls, Assignment Help, Ask Question on Write an aspect that counts different kinds of method calls, Get Answer, Expert's Help, Write an aspect that counts different kinds of method calls Discussions

Write discussion on Write an aspect that counts different kinds of method calls
Your posts are moderated
Related Questions
I am having an combox box and values are retrieved from the database having inputs and labels i want to created the dynamic form accroding to user input on combox box values

java code for finding area under curve y=f(x) between x=a and a=b integrate y=f(x) between the li,its of a and b. the area under a curve between two points can be found by doing a

Explain what is FontMetrics in Java? No word wrapping is completed when you draw a string in an applet, even if you embed newlines in the string along with \n. If you expect th

Elaborate Vector or Object oriented graphics along with at least one example. Object Oriented Graphics are the graphics that are commonly oriented towards the objects and have

Decode the Code Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new techn

Question: (a) (i) Explain the concept of inheritance. Illustrate your answer with a suitable Java example. (ii) Java does not support multiple inheritance but does provide

Cross platform stock market game Project Description: I want someone to develop a simple stock market game. This will mainly be a facebook and android app, face book being mo

You are to write a program name arrayScaling.java that will randomly generate 5000 integer number raging from 1 - 49 and place them in an array. 1.  The program will scale thi

Write a program called LandThePlane that calculates whether a plane successfully lands or not.   The program begins by prompting (asking) the user for the following details, in th

Write a program that manages a list of train tickets, JAVA Programming