TSTreeNode.st
changeset 5393 b39d48159130
parent 3676 29e4fbe103d6
equal deleted inserted replaced
5392:3f9ffab35f84 5393:b39d48159130
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "{ Package: 'stx:libbasic2' }"
     3 "{ Package: 'stx:libbasic2' }"
     2 
     4 
     3 "{ NameSpace: Smalltalk }"
     5 "{ NameSpace: Smalltalk }"
     4 
     6 
     5 Object subclass:#TSTreeNode
     7 Object subclass:#TSTreeNode
    36             and: [equal isNil
    38             and: [equal isNil
    37             and: [high isNil]]]
    39             and: [high isNil]]]
    38 !
    40 !
    39 
    41 
    40 cullNode: aNode
    42 cullNode: aNode
    41 	low == aNode ifTrue: [^ low _ nil].
    43         low == aNode ifTrue: [^ low := nil].
    42 	equal == aNode ifTrue: [^ equal _ nil].
    44         equal == aNode ifTrue: [^ equal := nil].
    43 	high == aNode ifTrue: [^ high _ nil]
    45         high == aNode ifTrue: [^ high := nil]
    44 !
    46 !
    45 
    47 
    46 do: aBlock
    48 do: aBlock
    47     self nodesDo: [:ea | 
    49     self nodesDo: [:ea | 
    48         |t|
    50         |t|
    52         ]
    54         ]
    53     ].
    55     ].
    54 !
    56 !
    55 
    57 
    56 initializeWithKey: aCharacter
    58 initializeWithKey: aCharacter
    57 	key _ aCharacter
    59         key := aCharacter
    58 !
    60 !
    59 
    61 
    60 lookupString: aString startingAt: i
    62 lookupString: aString startingAt: i
    61 "inlined for performance"
    63 "inlined for performance"
    62 "
    64 "
   150 
   152 
   151     "Modified: / 08-08-2010 / 15:19:05 / cg"
   153     "Modified: / 08-08-2010 / 15:19:05 / cg"
   152 !
   154 !
   153 
   155 
   154 removeString: aString startingAt: i
   156 removeString: aString startingAt: i
   155 	| val |
   157         | val |
   156 	self
   158         self
   157 		lookupString: aString
   159                 lookupString: aString
   158 		startingAt: i
   160                 startingAt: i
   159 		whenFound: [val _ self value. self value: nil]
   161                 whenFound: [val := self value. self value: nil]
   160 		whenNil: [:c | ^ nil]
   162                 whenNil: [:c | ^ nil]
   161 		recurseWith:
   163                 recurseWith:
   162 			[:node :j |
   164                         [:node :j |
   163 			val _ node removeString: aString startingAt: j.
   165                         val := node removeString:aString startingAt:j.
   164 			node canBeCulled ifTrue:
   166                         node canBeCulled ifTrue:
   165 				[self cullNode: node]].
   167                                 [self cullNode: node]].
   166 	^ val
   168         ^ val
   167 !
   169 !
   168 
   170 
   169 value
   171 value
   170 	^ value
   172 	^ value
   171 !
   173 !
   172 
   174 
   173 value: anObject
   175 value: anObject
   174 	value _ anObject
   176         value := anObject
   175 ! !
   177 ! !
   176 
   178 
   177 !TSTreeNode class methodsFor:'documentation'!
   179 !TSTreeNode class methodsFor:'documentation'!
   178 
   180 
   179 version
   181 version