Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-64

Examine IterablePosting interface from context of efficiency code

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: .structures
    • Labels:
      None

      Description

      Nicola had to change the IterablePosting interface for use in the efficiency code. These changes need to be integrated with core, but may involve changes in various places.

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -

          The major change seems to be

          interface IterablePosting
          {
            /** Return true if found another posting */
            public boolean next();
            /** Return id of the current posting */
            public int getId();
          }
          

          became

          interface IterablePosting
          {
            public final int EOL = -1;
            /** Return docid if found another posting, EOL otherwise */
            public int next();
            /** Return id of the current posting */
            public int getId();
          }
          

          I.e. next() method changes from returning boolean to returning docid if posting found, EOL if end of postings.

          This reduced one method call (i.e. next() then getId()) in many cases.

          Does anyone have an objections to this change being made?

          Show
          craigm Craig Macdonald added a comment - The major change seems to be interface IterablePosting { /** Return true if found another posting */ public boolean next(); /** Return id of the current posting */ public int getId(); } became interface IterablePosting { public final int EOL = -1; /** Return docid if found another posting, EOL otherwise */ public int next(); /** Return id of the current posting */ public int getId(); } I.e. next() method changes from returning boolean to returning docid if posting found, EOL if end of postings. This reduced one method call (i.e. next() then getId()) in many cases. Does anyone have an objections to this change being made?
          Hide
          craigm Craig Macdonald added a comment -

          Fixed, for CORE and all other packages.

          Show
          craigm Craig Macdonald added a comment - Fixed, for CORE and all other packages.

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              craigm Craig Macdonald
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: