eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TSTree':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: TSTree


Inheritance:

   Object
   |
   +--Collection
      |
      +--KeyedCollection
         |
         +--TSTree
            |
            +--TSMultiTree

Package:
stx:libbasic2
Category:
Collections-Ordered-Trees
Version:
rev: 1.12 date: 2018/09/18 13:32:17
user: stefan
file: TSTree.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Avi Bryant

Description:


BTree and TSTree

A bunch of collection classes that are useful for building large indices of things. 
It's especially geared towards people using OODBs like GOODS, but can be used it in the image too: 
the BTree class is great for when you need to select numeric keys by range, 
and TSTree makes a solid basis for full-text search. 
TreeSet has an interesting optimized #intersection: that lets you compare two collections without 
looking at every item of either. 

TSTree has similar properties as BTree for String  keys. 
So as well as keeping them sorted, you can do efficient lookups of all 
the keys with a given prefix.  One other neat trick TSTree can do is a certain 
amount of fuzzy matching (eg find all keys with an edit distance of 3 from 
'foo') which makes it especially useful for spell checking and similar 
applications.


[license:]
    Dual licensed under both SqueakL and MIT. 
    This enables both base Squeak inclusion and 100% reuse.


Class protocol:

queries
o  treeNodeClass


Instance protocol:

accessing
o  at: aString ifAbsent: exceptionBlock

o  at: aString ifAbsentPut: exceptionBlock

o  at: aString put: anObject
(comment from inherited method)
add the argument anObject under key, aKey to the receiver.
Return anObject (sigh).
WARNING: do not add elements while iterating over the receiver.
Iterate over a copy to do this.

o  removeKey: aString

o  removeKey: aString ifAbsent: errorBlock

o  values

enumerating
o  do: aBlock
(comment from inherited method)
evaluate aBlock for each value

searching
o  matchesForPrefix: aString

o  matchesForPrefix: aString do: aBlock

o  matchesForString: aString distance: aNumber

o  matchesForString: aString distance: aNumber do: aBlock

o  matchesForString: aString distance: aNumber limitNodes: maxNodes do: aBlock

testing
o  isFixedSize
return true if the receiver cannot grow



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 29 Mar 2024 12:29:25 GMT