Class TwoLevelNavigator

    • Constructor Detail

      • TwoLevelNavigator

        public TwoLevelNavigator​(IntSupplier elemCount,
                                 IntUnaryOperator elemLength)
        Creates a navigator that can be used to find a TwoDimensional.Position within a two dimensional object.
        Parameters:
        elemCount - a supplier that returns the number of "inner lists" within an "outer list" (see TwoDimensional for clarification). For example, List::size
        elemLength - a function that, given the index of an "inner list," returns either the size of that "inner list" of the length of that inner object.
    • Method Detail

      • position

        public TwoDimensional.Position position​(int major,
                                                int minor)
        Description copied from interface: TwoDimensional
        Creates a two dimensional position in some entity (e.g. area, list of lists, list of some object with length) where the major value is the index within the outer list) and the minor value is either the index within the inner list or some amount of length in a list of objects that have length.
        Specified by:
        position in interface TwoDimensional