Tree_Map

This library provides a way to store a value with a set of keys


Keywords
cross, utility
License
MIT
Install
haxelib install Tree_Map 1.0.0

Documentation

Tree Map data structure for Haxe

This library provides a class that can be used to store a value with a key of multiple values.

Usage

You can create the object with an optional matching function. It will be used on the keys.

public function new(?m:(v1:K, v2:K) -> Bool)

You can check if your keys has already set a value.

public function has(keys:Array<K>):Bool

You can get the value stored for given keys. If it is not set it will return null.

public function get(keys:Array<K>):V

You can add a value to the tree with the given keys. You should avoid null because it is currently the value used to show there is no return. It will throw an exception if the keys are already used.

public function set(keys:Array<K>, value:V)

The tree can be cleared with this method.

public function clear()