wiki:TEXT_POSITION_INTERNAL
Last modified 15 years ago Last modified on 03/05/10 15:08:43

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=TEXT_POSITION_INTERNAL, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

The navigation between chained frames now cannot be implemented because of internal issues. After this task there will be no visual result but the navigation will be possible to be implemented.

Task requirements

  • This task will remove some of the ImmHotText and HotPos functionality and will reduce the code. The code quality will be improved.

Task result

the result should be code.

Implementation idea

  • Remove the text from the HotPos and add ImmList<ElemOp>.
  • Remove prevText, subSingleInterval, lastOperation, lastChangedInterval from the ImmHotText and add ImmList<ElemOp>.
  • Change getIndex, subText and other related functions of the ImmHotText.
  • Tests will be provided.

(Add links to related tasks that could be useful or helpful.)

How to demo

Run the HotPosTest class.

Design

  • The ImmHotText:ElemOp class will no longer be inner class.
  • Make new class ElemOp in order to let the HotPos class use the text's operations.
  • Add two new abstract function in ElemOp class :
    • getHash() - returns the hash of every ElemOp's object.
    • equals() - returns true if two ElemOp's are equal(have same begin and end positions or same begin and lenght and are of one class).
  • In HotPos class remove the text field and replace it with ImmList<ElemOp> posHistory and ImmList<Integer> posHashHistory.
    • The first field replaces the text field and holds all the text history till the moment of creation of the position.
    • The second one holds the hash of the first field as follows:
      • The first element of this list is the hash of an empty list, the second one is the hash of the list with the first element of the posHistory list,

the third one is the hash of the list with the first two elements of the posHistory list, etc.

  • The second field is used in ImmHotText:getIndex() and ImmHotText:getPosComparator() in order to obtain fast comparison.
  • Add getter methods for the two new fields and remove the old one.
  • In ImmHotText class remove the lastOperation, lastChangedInterval, uid and subSingleInterval fields and replace them with two new:
    • ImmList<ElemOp> textHistory that holds all the text history till now(including NoOps).
    • ImmList<Integer> textHashHistory - the same as the posHashHistory it is saved in order to have faster creation of HotPoses.
    • lastChangedInterval is the interval of the last operation in the textHistory list or null if empty.
    • lastOperation is the textHistory's list last element or null if empty.
    • the uid is no longer needed because the textHistory's size is the same as the uid and cane be used if needed.
  • The logic of the ImmHotText:getIndex is as follows:
    • we get the first index of the posHistory and textHistory list's in witch they differs and after that we traverse the posHistory backwards to this index and update the future index and after that we traverse the textHistory from this index to the end and updatePast index.
    • with this logic there must not be any problems with getting the index of pos that is from another branch of the text(this could not be done with the previous logic).
  • The logic of the ImmHotText:getPosComparator:compare is as follows:
    • we get the first index of the pos1History and pos2History list's in witch they differs and after that we traverse the posHistory backwards to this index and update the future indexes of the two poses.
    • This guarantees that two poses can always be compared even though they are not from the same texts.
  • The ImmHotText:subText is implemented with two replace operation(now the subText is a real new immHotText, not the previos one with another interval) and that's why the subSingleInterval is not needed any more and is removed.

source code: [8772]

Implementation

(Describe and link the implementation results here (from the wiki or the repository).)

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)