Results 1 to 4 of 4
  1. #1
    speedy8727 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default call matrix on file level

    Dear

    I need to build a table (output in cvs file) and each cell(i,j) of the table has to indicate how many times file x refers to file y. The files all have the .java extension, but they can be in different (sub)folders.
    For example:
    to-> file1.java /a/file2.java
    file1.java 0 2
    /a/file2.java 5 0
    So, a/file2.java refers 5 times to file1.java.

    But I have more than 1000 files, so it is impossible to calculate all these numbers manually.

    Can anyone help me?
    Kind regards

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: call matrix on file level

    What if a class, say, A, in its own file refers to a class C in file B.java where the content of B.java is a public class B and a package scope class C? Does file A refer to file B?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: call matrix on file level

    Your terminology is confusing as Jos has pointed out.
    Files contain classes. Code in a class can refer to other classes. All the classes could be in the same file or in different files.
    It is possible for classes in different packages to have the same name.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: call matrix on file level

    There's more why this approach won't work; not just package scope classes in files with a different name but also the construct Class.forName( ... ) can't be tracked by any software at all. So any form of a caller-callee tree is doomed to be incorrect.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Writing file input in a matrix
    By Neovenator in forum New To Java
    Replies: 50
    Last Post: 01-26-2012, 04:24 PM
  2. Top level and member level
    By Differintegral in forum New To Java
    Replies: 1
    Last Post: 07-30-2010, 03:50 AM
  3. how to call higher level super class method?
    By satheeshtech in forum Advanced Java
    Replies: 2
    Last Post: 01-12-2010, 03:11 PM
  4. [SOLVED] Class-level vs Object-level method()
    By mfaizan24 in forum New To Java
    Replies: 7
    Last Post: 06-23-2009, 09:18 AM
  5. how to call a JAR FILE from HTML
    By leonard in forum Java Applets
    Replies: 1
    Last Post: 08-05-2007, 06:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •