|
@@ -6,12 +6,14 @@ bbdoc: Data structures/Maps
|
|
End Rem
|
|
End Rem
|
|
Module BRL.Map
|
|
Module BRL.Map
|
|
|
|
|
|
-ModuleInfo "Version: 1.08"
|
|
|
|
|
|
+ModuleInfo "Version: 1.09"
|
|
ModuleInfo "Author: Mark Sibly"
|
|
ModuleInfo "Author: Mark Sibly"
|
|
ModuleInfo "License: zlib/libpng"
|
|
ModuleInfo "License: zlib/libpng"
|
|
ModuleInfo "Copyright: Blitz Research Ltd"
|
|
ModuleInfo "Copyright: Blitz Research Ltd"
|
|
ModuleInfo "Modserver: BRL"
|
|
ModuleInfo "Modserver: BRL"
|
|
|
|
|
|
|
|
+ModuleInfo "History: 1.09"
|
|
|
|
+ModuleInfo "History: Added index operator overloads to maps."
|
|
ModuleInfo "History: 1.08"
|
|
ModuleInfo "History: 1.08"
|
|
ModuleInfo "History: Added TStringMap."
|
|
ModuleInfo "History: Added TStringMap."
|
|
ModuleInfo "History: (Debug) Assertion on modification during iteration."
|
|
ModuleInfo "History: (Debug) Assertion on modification during iteration."
|
|
@@ -342,7 +344,7 @@ Type TMap
|
|
End Method
|
|
End Method
|
|
|
|
|
|
Rem
|
|
Rem
|
|
- bbdoc: Returns a node enumeration object.
|
|
|
|
|
|
+ bbdoc: Returns a node enumeration Object.
|
|
about: The object returned by #ObjectEnumerator can be used with #EachIn to iterate through the nodes in the map.
|
|
about: The object returned by #ObjectEnumerator can be used with #EachIn to iterate through the nodes in the map.
|
|
End Rem
|
|
End Rem
|
|
Method ObjectEnumerator:TNodeEnumerator()
|
|
Method ObjectEnumerator:TNodeEnumerator()
|
|
@@ -564,7 +566,24 @@ Type TMap
|
|
Wend
|
|
Wend
|
|
node._color=BLACK
|
|
node._color=BLACK
|
|
End Method
|
|
End Method
|
|
|
|
+
|
|
|
|
+ Rem
|
|
|
|
+ bbdoc: Finds a value given a @key using index syntax.
|
|
|
|
+ returns: The value associated with @key.
|
|
|
|
+ about: If the map does not contain @key, a #Null object is returned.
|
|
|
|
+ End Rem
|
|
|
|
+ Method Operator[]:Object(key:Object)
|
|
|
|
+ Return ValueForKey(key)
|
|
|
|
+ End Method
|
|
|
|
|
|
|
|
+ Rem
|
|
|
|
+ bbdoc: Inserts a key/value pair into the map using index syntax.
|
|
|
|
+ about: If the map already contains @key, its value is overwritten with @value.
|
|
|
|
+ End Rem
|
|
|
|
+ Method Operator[]=(key:Object, value:Object)
|
|
|
|
+ Insert(key, value)
|
|
|
|
+ End Method
|
|
|
|
+
|
|
Const RED=-1,BLACK=1
|
|
Const RED=-1,BLACK=1
|
|
|
|
|
|
Field _root:TNode=nil
|
|
Field _root:TNode=nil
|