<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_Apps_2023W_Lecture_17</id>
	<title>Mobile Apps 2023W Lecture 17 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_Apps_2023W_Lecture_17"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_17&amp;action=history"/>
	<updated>2026-04-08T03:33:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_17&amp;diff=24397&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Code==  &lt;syntaxhighlight lang=&quot;kotlin&quot; line&gt; package carleton.comp2601.historyviewer  class HNTree {     var hostComponent: String = &quot;&quot;     var hostSuffix: String = &quot;&quot;     var parent: HNTree = this     var children: MutableList&lt;HNTree&gt; = mutableListOf()     var treeLevel: Int = 0     var expanded: true      fun add(hostPrefix: String) {         var allComponents: List&lt;String&gt;         var component: String         var child: HNTree? = null          /* still have to deal...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_17&amp;diff=24397&amp;oldid=prev"/>
		<updated>2023-03-15T20:00:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Code==  &amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot; line&amp;gt; package carleton.comp2601.historyviewer  class HNTree {     var hostComponent: String = &amp;quot;&amp;quot;     var hostSuffix: String = &amp;quot;&amp;quot;     var parent: HNTree = this     var children: MutableList&amp;lt;HNTree&amp;gt; = mutableListOf()     var treeLevel: Int = 0     var expanded: true      fun add(hostPrefix: String) {         var allComponents: List&amp;lt;String&amp;gt;         var component: String         var child: HNTree? = null          /* still have to deal...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Code==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;kotlin&amp;quot; line&amp;gt;&lt;br /&gt;
package carleton.comp2601.historyviewer&lt;br /&gt;
&lt;br /&gt;
class HNTree {&lt;br /&gt;
    var hostComponent: String = &amp;quot;&amp;quot;&lt;br /&gt;
    var hostSuffix: String = &amp;quot;&amp;quot;&lt;br /&gt;
    var parent: HNTree = this&lt;br /&gt;
    var children: MutableList&amp;lt;HNTree&amp;gt; = mutableListOf()&lt;br /&gt;
    var treeLevel: Int = 0&lt;br /&gt;
    var expanded: true&lt;br /&gt;
&lt;br /&gt;
    fun add(hostPrefix: String) {&lt;br /&gt;
        var allComponents: List&amp;lt;String&amp;gt;&lt;br /&gt;
        var component: String&lt;br /&gt;
        var child: HNTree? = null&lt;br /&gt;
&lt;br /&gt;
        /* still have to deal with getting to the end */&lt;br /&gt;
&lt;br /&gt;
        allComponents = hostPrefix.split(&amp;quot;.&amp;quot;)&lt;br /&gt;
        if (allComponents.last() == &amp;quot;&amp;quot;) {&lt;br /&gt;
            allComponents = allComponents.dropLast(1)&lt;br /&gt;
        }&lt;br /&gt;
        component = allComponents.last()&lt;br /&gt;
&lt;br /&gt;
        if (component == hostPrefix) {&lt;br /&gt;
            return&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        for (c in this.children) {&lt;br /&gt;
                 if (c.hostComponent == component) {&lt;br /&gt;
                     child = c&lt;br /&gt;
                     break&lt;br /&gt;
                 }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (child == null) {&lt;br /&gt;
            child = HNTree()&lt;br /&gt;
            child.parent = this&lt;br /&gt;
            child.hostComponent = component&lt;br /&gt;
            child.hostSuffix = &amp;quot;$component.$hostSuffix&amp;quot;&lt;br /&gt;
            child.treeLevel++&lt;br /&gt;
            children.add(child)&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        child.add(allComponents.dropLast(1).joinToString())&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fun nextNodes(n: Int): List&amp;lt;HNTree&amp;gt; {&lt;br /&gt;
        for (i in 0..n -1) {&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>