Ticket #2220: paragraphs.patch

File paragraphs.patch, 1.9 KB (added by deni, 15 years ago)
  • modules/org.sophie2.base.model.text/src/main/java/org/sophie2/base/model/text/smart/position/HotIndexInterval.java

    ### Eclipse Workspace Patch 1.0
    #P sophie
     
    11package org.sophie2.base.model.text.smart.position; 
    22 
     3import org.sophie2.base.commons.util.Hash; 
     4import org.sophie2.base.commons.util.Hashable; 
     5import org.sophie2.base.commons.util.Hasher; 
     6 
    37/** 
    48 * A class representing an interval in the text between two indexes. 
    59 *  
    610 * @author diana 
    711 */ 
    8 public class HotIndexInterval { 
     12public class HotIndexInterval implements Hashable { 
    913         
    1014        private final int begin; 
    1115        private final int end; 
     
    7276                } 
    7377                return true; 
    7478        } 
     79 
     80        public Hash getHash() { 
     81                Hasher hasher = new Hasher(); 
     82                hasher.addInt(this.begin); 
     83                hasher.addInt(this.end); 
     84                return hasher.toHash(); 
     85        } 
    7586         
    7687} 
  • modules/org.sophie2.base.model.text/src/main/java/org/sophie2/base/model/text/smart/ImmHotText.java

     
    595595                                        , this.subSingleInterval.getEnd())); 
    596596                        hasher.addHashed(ImmHashingTree.getHash(this.styleValues, 0,  
    597597                                        this.styleValues.size())); 
     598                        hasher.addHashed(this.subSingleInterval.getHash()); 
    598599                        this.styledHash = hasher.toHash(); 
    599600                } 
    600601                return this.styledHash;