commonMain.jetbrains.datalore.base.composite.NavComposite.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lets-plot-common Show documentation
Show all versions of lets-plot-common Show documentation
Lets-Plot JVM package without rendering part
/*
* Copyright (c) 2019. JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
package jetbrains.datalore.base.composite
/**
* Composite which supports optimized navigation between siblings.
*
* If we store children in an array and a composite has a lot of children, navigation might be
* expensive because we need to use indexOf which takes O(children). This class is an optimized
* version of Composite tailored for such cases.
*
* Invariants:
* - prevSibling, nextSibling, firstChild and lastChild must be consistent with the children collection from
* Composite.
*/
interface NavComposite> : Composite {
fun nextSibling(): CompositeT?
fun prevSibling(): CompositeT?
fun firstChild(): CompositeT?
fun lastChild(): CompositeT?
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy