Code explanation

  • Marc

    Hi there,

    I'm trying to 1) trace the code and 2) understand some statements.

    1) tracing the code

    where is the code that executes when I choose from the menu:

    1.a) Table > All Stocks > List All

    and then, after choosing one stock in the displayed table:

    1.b) Symbols > Table

    I am curious to see how are the quote stored and then retrieved.

    2) understanding some statements

    I have never seen these kinds of statements (the "run()" inside a method):

        public void tableStocks(final int type) {
            Thread thread = new Thread(new Runnable() {
                    public void run() {
                        String title =
                            new String(Locale.getString("LIST_IT",
                        tableStocks(title, type, null, null, null);

    My guess is that a thread is defined, then the "method/code" associated with that thread is described, and then the thread is started. However that's just a guess... Would anyone have a reference (web page etc) that I can read on the subject?

    Thank you

    • Mark Hummel
      Mark Hummel

      1. Hint: What sort of user interface element is involved here? What sort of frame is created? Search for class names with this element as a suffix. If I recall correctly from previous discussions, you are a linux user. So combinations of find and grep are useful ways of discovering where things are in the source. e.g find . -name "*java" |xargs grep "void methodName"

      2. Pretty much. The code is an implementation of the Runnable interface. See:

      Hope that helps,

    • Marc

      Thanks. Will check the references in #2.

      re: 1), I put some breakpoints in:

      public void tableStocks(final int type)

      public void tableStocks(final List symbols)

      private void tableStocks(String title, int type, String rule, SortedSet symbols, TradingDate date)

      and started to have an idea of what's going on.

      It lead me to QuoteModule(EODQuoteBundle quoteBundle,String filterExpressionString,boolean singleDate) and extractQuotesUsingRule(String filterExpression, EODQuoteBundle quoteBundle) but I have not found yet where the code is accessing the "files" containing the historical data.

    • Mark Hummel
      Mark Hummel

      Check out quote/ There a few references to it in EODQuoteBundle.