Documentation of 'mikera.indexz.GrowableIndex' Java class
GrowableIndex
mikera.indexz

Class GrowableIndex

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AIndex>, java.lang.Iterable<java.lang.Integer>


    public class GrowableIndex
    extends AIndex
    An index implementation that supports appending, allowing the Index to be enlarged.
    See Also:
    Serialized Form
    • Constructor Detail

      • GrowableIndex

        public GrowableIndex()
      • GrowableIndex

        public GrowableIndex(int initialCapacity)
      • GrowableIndex

        public GrowableIndex(int[] values)
    • Method Detail

      • create

        public static GrowableIndex create(AIndex source)
        Creates a GrowableVector with the specified index values included
        Parameters:
        source -
        Returns:
      • wrap

        public static GrowableIndex wrap(int[] indexes)
        Creates a GrowableVector with the specified index values included
        Parameters:
        source -
        Returns:
      • get

        public int get(int i)
        Description copied from class: AIndex
        Gets the index value at position i
        Specified by:
        get in class AIndex
        Returns:
      • length

        public int length()
        Description copied from class: AIndex
        Returns the length of this index list
        Specified by:
        length in class AIndex
        Returns:
      • set

        public void set(int i,
                        int value)
        Specified by:
        set in class AIndex
      • copyTo

        public void copyTo(int[] array,
                           int offset)
        Overrides:
        copyTo in class AIndex
      • append

        public void append(int i)
      • checkedAppend

        public void checkedAppend(int i)
        Appends to a growable index, ensuring that the added index is higher than the last index
        Parameters:
        i -
      • indexPosition

        public int indexPosition(int x)
        Description copied from class: AIndex
        Looks up an index value in the index, returning its position or -1 if not found Index must be both sorted and distinct.
        Specified by:
        indexPosition in class AIndex
        Returns:
      • last

        public int last()
        Description copied from class: AIndex
        Gets the last index value in this index. Throws an exception if the index is empty
        Specified by:
        last in class AIndex
        Returns:
      • include

        public int include(int i)
        Includes a value in a distinct, sorted growable index.
        Parameters:
        i -
        Returns:
        The position at which the value is added (or already exists)
      • seekPosition

        public int seekPosition(int i)
        Description copied from class: AIndex
        Returns the position at which an index value exists or should be inserted at in an index Index must be both sorted and distinct.
        Overrides:
        seekPosition in class AIndex
        Returns:
        The target position in the index, which will satisfy 0 <= position <= this.length()

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.