mirror of https://github.com/deavmi/niknaks
Compare commits
3 Commits
9610689e14
...
82a9978b4b
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | 82a9978b4b | |
Tristan B. Velloza Kildaire | f1c46316a9 | |
Tristan B. Velloza Kildaire | 1ebed93db7 |
|
@ -39,7 +39,7 @@ is expected to grow over time.
|
|||
* Some textual manipulation routines as well
|
||||
* `niknaks.containers`
|
||||
* Some useful container types
|
||||
* Things such as `CacheMap`
|
||||
* Things such as `CacheMap`, `Graph` and `VisitationTree`
|
||||
* `niknaks.mechanisms`
|
||||
* User-defined input prompter, retry mechanisms
|
||||
* `niknaks.config`
|
||||
|
|
|
@ -764,6 +764,17 @@ public class Graph(T)
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains the value associated with
|
||||
* this graph node
|
||||
*
|
||||
* Returns: the value `T`
|
||||
*/
|
||||
public T getValue()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends another graph node
|
||||
* to the array of children
|
||||
|
@ -1054,6 +1065,12 @@ unittest
|
|||
assert(treeOfStrings.opIndex!(Graph!(string))(1) == subtree_2);
|
||||
assert(treeOfStrings.opIndex!(Graph!(string))(2) == subtree_3);
|
||||
|
||||
assert(treeOfStrings[0] == subtree_1.getValue());
|
||||
assert(treeOfStrings[1] == subtree_2.getValue());
|
||||
assert(treeOfStrings[2] == subtree_3.getValue());
|
||||
|
||||
assert(treeOfStrings.opDollar() == 3);
|
||||
|
||||
InclusionStratergy!(string) strat = toDelegate(&Always!(string));
|
||||
TouchStratergy!(string) touch = toDelegate(&DebugTouch!(string));
|
||||
|
||||
|
|
Loading…
Reference in New Issue